2001-08-07 Andreas Jaeger <aj@suse.de>
+ Andreas Schwab <schwab@suse.de>
+ Bruno Haible <haible@clisp.cons.org>
+
+ * locale/programs/3level.h (EMPTY): New macro.
+ (*_get, *_add, *_iterate, *_finalize): Use it instead of ~(uint32_t) 0.
+
+2001-08-08 GOTO Masanori <gotom@debian.or.jp>
+
+ * locale/iso-3166.def: Updates from latest official list.
+
+2001-08-07 Andreas Jaeger <aj@suse.de>
* stdlib/tst-strtod.c: Disable HUGE_VAL tests for older GCCs.
- * iconv/gconv_charset.h (upstr): Add unused attribute to avoid
- warning.
+ * iconv/gconv_charset.h (upstr): Add unused attribute to avoid warning.
- * libio/iopopen.c (_IO_new_proc_open): Fix typos, it's
- _IO_MTSAFE_IO.
+ * libio/iopopen.c (_IO_new_proc_open): Fix typos, it's _IO_MTSAFE_IO.
(_IO_new_proc_close): Likewise.
* libio/oldiopopen.c (_IO_old_proc_open): Likewise.
(_IO_old_proc_close): Likewise.
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
t->level3_alloc = t->level3_size = 0;
}
+/* Marker for an empty slot. This has the value 0xFFFFFFFF, regardless
+ whether 'int' is 16 bit, 32 bit, or 64 bit. */
+#define EMPTY ((uint32_t) ~0)
+
/* Retrieve an entry. */
static inline ELEMENT
CONCAT(TABLE,_get) (struct TABLE *t, uint32_t wc)
if (index1 < t->level1_size)
{
uint32_t lookup1 = t->level1[index1];
- if (lookup1 != ~((uint32_t) 0))
+ if (lookup1 != EMPTY)
{
uint32_t index2 = ((wc >> t->p) & ((1 << t->q) - 1))
+ (lookup1 << t->q);
uint32_t lookup2 = t->level2[index2];
- if (lookup2 != ~((uint32_t) 0))
+ if (lookup2 != EMPTY)
{
uint32_t index3 = (wc & ((1 << t->p) - 1))
+ (lookup2 << t->p);
t->level1_alloc = alloc;
}
while (index1 >= t->level1_size)
- t->level1[t->level1_size++] = ~((uint32_t) 0);
+ t->level1[t->level1_size++] = EMPTY;
}
- if (t->level1[index1] == ~((uint32_t) 0))
+ if (t->level1[index1] == EMPTY)
{
if (t->level2_size == t->level2_alloc)
{
i1 = t->level2_size << t->q;
i2 = (t->level2_size + 1) << t->q;
for (i = i1; i < i2; i++)
- t->level2[i] = ~((uint32_t) 0);
+ t->level2[i] = EMPTY;
t->level1[index1] = t->level2_size++;
}
index2 += t->level1[index1] << t->q;
- if (t->level2[index2] == ~((uint32_t) 0))
+ if (t->level2[index2] == EMPTY)
{
if (t->level3_size == t->level3_alloc)
{
for (index1 = 0; index1 < t->level1_size; index1++)
{
uint32_t lookup1 = t->level1[index1];
- if (lookup1 != ~((uint32_t) 0))
+ if (lookup1 != EMPTY)
{
uint32_t lookup1_shifted = lookup1 << t->q;
uint32_t index2;
for (index2 = 0; index2 < (1 << t->q); index2++)
{
uint32_t lookup2 = t->level2[index2 + lookup1_shifted];
- if (lookup2 != ~((uint32_t) 0))
+ if (lookup2 != EMPTY)
{
uint32_t lookup2_shifted = lookup2 << t->p;
uint32_t index3;
t->level3_size = k;
for (i = 0; i < (t->level2_size << t->q); i++)
- if (t->level2[i] != ~((uint32_t) 0))
+ if (t->level2[i] != EMPTY)
t->level2[i] = reorder3[t->level2[i]];
/* Uniquify level2 blocks. */
t->level2_size = k;
for (i = 0; i < t->level1_size; i++)
- if (t->level1[i] != ~((uint32_t) 0))
+ if (t->level1[i] != EMPTY)
t->level1[i] = reorder2[t->level1[i]];
/* Create and fill the resulting compressed representation. */
for (i = 0; i < t->level1_size; i++)
((uint32_t *) (t->result + level1_offset))[i] =
- (t->level1[i] == ~((uint32_t) 0)
+ (t->level1[i] == EMPTY
? 0
: (t->level1[i] << t->q) * sizeof (uint32_t) + level2_offset);
for (i = 0; i < (t->level2_size << t->q); i++)
((uint32_t *) (t->result + level2_offset))[i] =
- (t->level2[i] == ~((uint32_t) 0)
+ (t->level2[i] == EMPTY
? 0
: (t->level2[i] << t->p) * sizeof (ELEMENT) + level3_offset);
}
#endif
+#undef EMPTY
#undef TABLE
#undef ELEMENT
#undef DEFAULT