bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

propagate 64-bit improvement from gnulib hash module


From: Paul Eggert
Subject: propagate 64-bit improvement from gnulib hash module
Date: Fri, 07 May 2004 00:38:42 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

The gnulib hash module recently upgraded from 32- to 64-bit hashes
on 64-bit hosts.  I installed this patch to Bison to accommodate this.

2004-05-06  Paul Eggert  <address@hidden>

        * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
        unsigned int, for compatibility with latest gnulib hash module.
        * src/state.c (state_hash, state_hasher): Likewise.
        * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
        * src/uniqstr.c (hash_uniqstr): Likewise.
        
Index: src/muscle_tab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.c,v
retrieving revision 1.31
diff -p -u -r1.31 muscle_tab.c
--- src/muscle_tab.c    25 Aug 2003 15:16:24 -0000      1.31
+++ src/muscle_tab.c    7 May 2004 07:28:47 -0000
@@ -1,6 +1,6 @@
 /* Muscle table manager for Bison.
 
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -50,8 +50,8 @@ hash_compare_muscles (void const *x, voi
   return strcmp (m1->key, m2->key) == 0;
 }
 
-static unsigned int
-hash_muscle (const void *x, unsigned int tablesize)
+static size_t
+hash_muscle (const void *x, size_t tablesize)
 {
   muscle_entry const *m = x;
   return hash_string (m->key, tablesize);
Index: src/state.c
===================================================================
RCS file: /cvsroot/bison/bison/src/state.c,v
retrieving revision 1.30
diff -p -u -r1.30 state.c
--- src/state.c 24 May 2003 19:16:02 -0000      1.30
+++ src/state.c 7 May 2004 07:28:49 -0000
@@ -1,6 +1,6 @@
 /* Type definitions for nondeterministic finite state machine for Bison.
 
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -279,19 +279,19 @@ state_comparator (void const *s1, void c
   return state_compare (s1, s2);
 }
 
-static inline unsigned int
-state_hash (state const *s, unsigned int tablesize)
+static inline size_t
+state_hash (state const *s, size_t tablesize)
 {
   /* Add up the state's item numbers to get a hash key.  */
-  unsigned int key = 0;
+  size_t key = 0;
   int i;
   for (i = 0; i < s->nitems; ++i)
     key += s->items[i];
   return key % tablesize;
 }
 
-static unsigned int
-state_hasher (void const *s, unsigned int tablesize)
+static size_t
+state_hasher (void const *s, size_t tablesize)
 {
   return state_hash (s, tablesize);
 }
Index: src/symtab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/symtab.c,v
retrieving revision 1.55
diff -p -u -r1.55 symtab.c
--- src/symtab.c        29 Dec 2002 04:30:18 -0000      1.55
+++ src/symtab.c        7 May 2004 07:28:50 -0000
@@ -1,6 +1,7 @@
 /* Symbol table manager for Bison.
 
-   Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -403,15 +404,15 @@ hash_symbol_comparator (void const *m1, 
   return hash_compare_symbol (m1, m2);
 }
 
-static inline unsigned int
-hash_symbol (const symbol *m, unsigned int tablesize)
+static inline size_t
+hash_symbol (const symbol *m, size_t tablesize)
 {
   /* Since tags are unique, we can hash the pointer itself.  */
   return ((uintptr_t) m->tag) % tablesize;
 }
 
-static unsigned int
-hash_symbol_hasher (void const *m, unsigned int tablesize)
+static size_t
+hash_symbol_hasher (void const *m, size_t tablesize)
 {
   return hash_symbol (m, tablesize);
 }
Index: src/uniqstr.c
===================================================================
RCS file: /cvsroot/bison/bison/src/uniqstr.c,v
retrieving revision 1.3
diff -p -u -r1.3 uniqstr.c
--- src/uniqstr.c       3 Feb 2003 15:35:57 -0000       1.3
+++ src/uniqstr.c       7 May 2004 07:28:50 -0000
@@ -1,6 +1,6 @@
 /* Keep a unique copy of strings.
 
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -97,8 +97,8 @@ hash_compare_uniqstr (void const *m1, vo
   return strcmp (m1, m2) == 0;
 }
 
-static unsigned int
-hash_uniqstr (void const *m, unsigned int tablesize)
+static size_t
+hash_uniqstr (void const *m, size_t tablesize)
 {
   return hash_string (m, tablesize);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]