--- glibc-2.3.3/iconv/iconvconfig.c.orig 2003-09-14 18:31:53.000000000 +0200 +++ glibc-2.3.3/iconv/iconvconfig.c 2004-03-18 16:08:13.270818328 +0100 @@ -988,6 +988,34 @@ module name offset (following last entry with step count 0) */ + +static struct hash_entry *hash_table; +static size_t hash_size; + +/* Function to insert the names. */ +static void name_insert (const void *nodep, VISIT value, int level) +{ + struct name *name; + unsigned int idx; + unsigned int hval2; + + if (value != leaf && value != postorder) + return; + + name = *(struct name **) nodep; + idx = name->hashval % hash_size; + hval2 = 1 + name->hashval % (hash_size - 2); + + while (hash_table[idx].string_offset != 0) + if ((idx += hval2) >= hash_size) + idx -= hash_size; + + hash_table[idx].string_offset = strtaboffset (name->strent); + + assert (name->module_idx != -1); + hash_table[idx].module_idx = name->module_idx; +} + static int write_output (void) { @@ -995,8 +1023,6 @@ char *string_table; size_t string_table_size; struct gconvcache_header header; - struct hash_entry *hash_table; - size_t hash_size; struct module_entry *module_table; char *extra_table; char *cur_extra_table; @@ -1009,30 +1035,6 @@ + strlen (".XXXXXX")]; char finalname[prefix_len + sizeof (GCONV_MODULES_CACHE)]; - /* Function to insert the names. */ - static void name_insert (const void *nodep, VISIT value, int level) - { - struct name *name; - unsigned int idx; - unsigned int hval2; - - if (value != leaf && value != postorder) - return; - - name = *(struct name **) nodep; - idx = name->hashval % hash_size; - hval2 = 1 + name->hashval % (hash_size - 2); - - while (hash_table[idx].string_offset != 0) - if ((idx += hval2) >= hash_size) - idx -= hash_size; - - hash_table[idx].string_offset = strtaboffset (name->strent); - - assert (name->module_idx != -1); - hash_table[idx].module_idx = name->module_idx; - } - /* Open the output file. */ assert (GCONV_MODULES_CACHE[0] == '/'); strcpy (stpcpy (mempcpy (tmpfname, prefix, prefix_len), GCONV_MODULES_CACHE),