+2005-05-05 Bruno Haible <bruno@clisp.org>
+
+ * hash-string.h (__hash_string): Define differently outside glibc.
+ * hash-string.c: Include config.h.
+ * Makefile.in (SOURCES): Add hash-string.c.
+ (OBJECTS): Add hash-string.$lo.
+ (hash-string.lo): New rule.
+ (hash-string.$lo): Depend on hash-string.h.
+ * Makefile.msvc (OBJECTS): Add hash-string.obj.
+ (hash-string.obj): New rule.
+ * Makefile.vms (OBJECTS): Add hash-string.obj.
+ (hash-string.obj): New rule.
+
+2003-06-11 Ulrich Drepper <drepper@redhat.com>
+
+ Remove warnings gcc 3.3 shows.
+ * hash-string.c: New file.
+ * hash-string.h: Remove hash_string definition. Declare __hash_string.
+ * dcigettext.c (_nl_find_msg): Adjust hash_string caller.
+ * loadmsgcat.c (_nl_load_domain): Likewise.
+
2003-04-29 Jakub Jelinek <jakub@redhat.com>
* plural.y: Include string.h. Needed because recent versions of bison
dgettext.c \
gettext.c \
finddomain.c \
+ hash-string.c \
loadmsgcat.c \
localealias.c \
textdomain.c \
dgettext.$lo \
gettext.$lo \
finddomain.$lo \
+ hash-string.$lo \
loadmsgcat.$lo \
localealias.$lo \
textdomain.$lo \
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
finddomain.lo: $(srcdir)/finddomain.c
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
+hash-string.lo: $(srcdir)/hash-string.c
+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c
loadmsgcat.lo: $(srcdir)/loadmsgcat.c
$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
localealias.lo: $(srcdir)/localealias.c
$(OBJECTS): ../config.h libgnuintl.h
bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
-dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
+hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
dcigettext.$lo: $(srcdir)/eval-plural.h
SHELL = /bin/sh
-OBJECTS = bindtextdom.obj dcgettext.obj dgettext.obj gettext.obj finddomain.obj loadmsgcat.obj localealias.obj textdomain.obj l10nflist.obj explodename.obj dcigettext.obj dcngettext.obj dngettext.obj ngettext.obj plural.obj plural-exp.obj localcharset.obj relocatable.obj langprefs.obj localename.obj log.obj printf.obj osdep.obj intl-compat.obj
+OBJECTS = bindtextdom.obj dcgettext.obj dgettext.obj gettext.obj finddomain.obj hash-string.obj loadmsgcat.obj localealias.obj textdomain.obj l10nflist.obj explodename.obj dcigettext.obj dcngettext.obj dngettext.obj ngettext.obj plural.obj plural-exp.obj localcharset.obj relocatable.obj langprefs.obj localename.obj log.obj printf.obj osdep.obj intl-compat.obj
RESOURCES = intl.res
finddomain.obj : $(srcdir)\finddomain.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\finddomain.c
+hash-string.obj : $(srcdir)\hash-string.c $(srcdir)\hash-string.h
+ $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\hash-string.c
+
loadmsgcat.obj : $(srcdir)\loadmsgcat.c libgnuintl.h $(srcdir)\gettextP.h $(srcdir)\gmo.h $(srcdir)\loadinfo.h $(srcdir)\hash-string.h $(srcdir)\plural-exp.h
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c $(srcdir)\loadmsgcat.c
#### End of system configuration section. ####
-OBJECTS = bindtextdom.obj,dcgettext.obj,dgettext.obj,gettext.obj,finddomain.obj,loadmsgcat.obj,localealias.obj,textdomain.obj,l10nflist.obj,explodename.obj,dcigettext.obj,dcngettext.obj,dngettext.obj,ngettext.obj,plural-parse.obj,plural-exp.obj,localcharset.obj,relocatable.obj,langprefs.obj,localename.obj,log.obj,osdep.obj,intl-compat.obj
+OBJECTS = bindtextdom.obj,dcgettext.obj,dgettext.obj,gettext.obj,finddomain.obj,hash-string.obj,loadmsgcat.obj,localealias.obj,textdomain.obj,l10nflist.obj,explodename.obj,dcigettext.obj,dcngettext.obj,dngettext.obj,ngettext.obj,plural-parse.obj,plural-exp.obj,localcharset.obj,relocatable.obj,langprefs.obj,localename.obj,log.obj,osdep.obj,intl-compat.obj
all : intl.olb,libintl.h
write sys$output "Nothing else to be done for 'all'."
finddomain.obj : $(srcdir)finddomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)finddomain.c
+hash-string.obj : $(srcdir)hash-string.c,$(srcdir)hash-string.h
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)hash-string.c
+
loadmsgcat.obj : $(srcdir)loadmsgcat.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)loadmsgcat.c
{
/* Use the hashing table. */
nls_uint32 len = strlen (msgid);
- nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 hash_val = __hash_string (msgid);
nls_uint32 idx = hash_val % domain->hash_size;
nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
--- /dev/null
+/* Implements a string hashing function.
+ Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include "hash-string.h"
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+unsigned long int
+__hash_string (const char *str_param)
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ /* Compute the hash value for the given string. */
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned char) *str++;
+ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
/* Description of GNU message catalog format: string hashing function.
- Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
#define HASHWORDBITS 32
+#ifndef _LIBC
+# ifdef IN_LIBINTL
+# define __hash_string libintl_hash_string
+# else
+# define __hash_string hash_string
+# endif
+#endif
+
/* Defines the so called `hashpjw' function by P.J. Weinberger
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
1986, 1987 Bell Telephone Laboratories, Inc.] */
-static inline unsigned long int
-hash_string (const char *str_param)
-{
- unsigned long int hval, g;
- const char *str = str_param;
-
- /* Compute the hash value for the given string. */
- hval = 0;
- while (*str != '\0')
- {
- hval <<= 4;
- hval += (unsigned char) *str++;
- g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
- if (g != 0)
- {
- hval ^= g >> (HASHWORDBITS - 8);
- hval ^= g;
- }
- }
- return hval;
-}
+extern unsigned long int __hash_string (const char *str_param);
for (i = 0; i < n_inmem_sysdep_strings; i++)
{
const char *msgid = inmem_orig_sysdep_tab[i].pointer;
- nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 hash_val = __hash_string (msgid);
nls_uint32 idx = hash_val % domain->hash_size;
nls_uint32 incr =
1 + (hash_val % (domain->hash_size - 2));
+2005-05-05 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (msgfmt_SOURCES): Add hash-string.c.
+ * Makefile.msvc (msgfmt_OBJECTS): Add hash-string.obj.
+ (hash-string.obj): New rule.
+ * Makefile.vms (msgfmt_OBJECTS): Add hash-string.obj.
+ (hash-string.obj): New rule.
+
2005-05-01 Bruno Haible <bruno@clisp.org>
* x-sh.c (open_singlequote_terminator): New variable.
msgcmp_SOURCES = msgcmp.c
msgfmt_SOURCES = msgfmt.c \
write-mo.c write-java.c write-csharp.c write-resources.c write-tcl.c \
- write-qt.c plural-eval.c
+ write-qt.c plural-eval.c ../../gettext-runtime/intl/hash-string.c
msgmerge_SOURCES = msgmerge.c plural-count.c
msgunfmt_SOURCES = msgunfmt.c \
read-mo.c read-java.c read-csharp.c read-resources.c read-tcl.c
format-qt.obj
msgcmp_OBJECTS = msgcmp.obj
-msgfmt_OBJECTS = msgfmt.obj write-mo.obj write-java.obj write-csharp.obj write-resources.obj write-tcl.obj write-qt.obj plural-eval.obj
+msgfmt_OBJECTS = msgfmt.obj write-mo.obj write-java.obj write-csharp.obj write-resources.obj write-tcl.obj write-qt.obj plural-eval.obj hash-string.obj
msgmerge_OBJECTS = msgmerge.obj plural-count.obj
msgunfmt_OBJECTS = msgunfmt.obj read-mo.obj read-java.obj read-csharp.obj read-resources.obj read-tcl.obj
xgettext_OBJECTS = xgettext.obj x-c.obj x-po.obj x-sh.obj x-python.obj x-lisp.obj x-elisp.obj x-librep.obj x-scheme.obj x-smalltalk.obj x-java.obj x-csharp.obj x-awk.obj x-ycp.obj x-tcl.obj x-perl.obj x-php.obj x-rst.obj x-glade.obj
plural-eval.obj : plural-eval.c
$(CC) $(INCLUDES) $(CFLAGS) -c plural-eval.c
+hash-string.obj : ..\..\gettext-runtime\intl\hash-string.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c ..\..\gettext-runtime\intl\hash-string.c
+
msgmerge.obj : msgmerge.c
$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgmerge.c
format-qt.obj
msgcmp_OBJECTS = msgcmp.obj
-msgfmt_OBJECTS = msgfmt.obj, write-mo.obj, write-java.obj, write-csharp.obj, write-resources.obj, write-tcl.obj, write-qt.obj, plural-eval.obj
+msgfmt_OBJECTS = msgfmt.obj, write-mo.obj, write-java.obj, write-csharp.obj, write-resources.obj, write-tcl.obj, write-qt.obj, plural-eval.obj, hash-string.obj
msgmerge_OBJECTS = msgmerge.obj, plural-count.obj
msgunfmt_OBJECTS = msgunfmt.obj, read-mo.obj, read-java.obj, read-csharp.obj, read-resources.obj, read-tcl.obj
xgettext_OBJECTS = xgettext.obj, x-c.obj, x-po.obj, x-sh.obj, x-python.obj, x-lisp.obj, x-elisp.obj, x-librep.obj, x-scheme.obj, x-smalltalk.obj, x-java.obj, x-csharp.obj, x-awk.obj, x-ycp.obj, x-tcl.obj, x-perl.obj, x-php.obj, x-rst.obj, x-glade.obj
plural-eval.obj : plural-eval.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) plural-eval.c
+hash-string.obj : [-.-.gettext-runtime.intl]hash-string.c
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) [-.-.gettext-runtime.intl]hash-string.c
+
msgmerge.obj : msgmerge.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS),"INSTALLPREFIX=""$(prefix)]""","INSTALLDIR=""$(bindir)]""") msgmerge.c