]> git.saurik.com Git - bison.git/commitdiff
Use size_t (not unsigned int) for hashes, since the gnulib hash module
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 7 May 2004 07:35:10 +0000 (07:35 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 7 May 2004 07:35:10 +0000 (07:35 +0000)
now uses size_t.

ChangeLog
src/muscle_tab.c
src/state.c
src/symtab.c
src/uniqstr.c

index 00e5048504238e7ceec28bd708d922b2c49a2a38..28a6352f1395536ce2cc4de2f6b4f49d78a2f1a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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.
+       
 2004-05-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        * NEWS: Unescaped newlines are no longer allowed in char & strings.
index 84c707aad86d536d6c0deee533ba5a7e4383554d..bf5c4dd346f30ecae5f4da1157c98e3090f49051 100644 (file)
@@ -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, void const *y)
   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 e6d15f2a4291da03fe6fab73f2a36abd2f1438bd..445c86fd9bf878a80d5d00de9a2a5b9f8ac1563f 100644 (file)
@@ -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 const *s2)
   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 53c9f677431b86b79d471357c40aac06869fdbf1..2a5420519302ce9d1d4b71ae8ed5719485fbdb59 100644 (file)
@@ -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, void const *m2)
   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 fb316cb3cb09f6e8d89ddd361d979b5d5e4c99ad..cc5bc68579c1c05b319db1eee1cde899e2a5039c 100644 (file)
@@ -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, void const *m2)
   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);
 }