aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/hashval.h10
-rw-r--r--locale/programs/locarchive.c2
-rw-r--r--locale/programs/simple-hash.c4
3 files changed, 9 insertions, 7 deletions
diff --git a/locale/hashval.h b/locale/hashval.h
index 15ec1244cf..e35957dde3 100644
--- a/locale/hashval.h
+++ b/locale/hashval.h
@@ -18,7 +18,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-unsigned long
+#ifndef LONGBITS
+# define LONGBITS (sizeof (long int) * BITSPERBYTE)
+#endif
+
+unsigned long int compute_hashval (const void *key, size_t keylen);
+
+unsigned long int
compute_hashval (key, keylen)
const void *key;
size_t keylen;
@@ -37,5 +43,5 @@ compute_hashval (key, keylen)
hval = (hval << 9) | (hval >> (LONGBITS - 9));
hval += (unsigned long int) *(((char *) key) + cnt++);
}
- return hval != 0 ? hval : ~((unsigned long) 0);
+ return hval != 0 ? hval : ~((unsigned long int) 0);
}
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 9ef373a2e5..de026b2a74 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -531,7 +531,7 @@ add_locale_to_archive (ah, name, data, replace)
(char *) ah->addr + namehashtab[idx].name_offset) == 0)
{
/* Found the entry. */
- if (! replace)
+ if (namehashtab[idx].locrec_offset != 0 && ! replace)
{
if (! be_quiet)
error (0, 0, _("locale '%s' already exists"), name);
diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
index b52b5593d0..c319068677 100644
--- a/locale/programs/simple-hash.c
+++ b/locale/programs/simple-hash.c
@@ -46,10 +46,6 @@
# define BITSPERBYTE 8
#endif
-#ifndef LONGBITS
-# define LONGBITS (sizeof (long) * BITSPERBYTE)
-#endif
-
#ifndef bcopy
# define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif