bison-patches
[Top][All Lists]
Advanced

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

symbol_list_length should return int, not unsigned int


From: Paul Eggert
Subject: symbol_list_length should return int, not unsigned int
Date: Sun, 09 Jul 2006 12:56:26 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I installed this minor fix:

2006-07-09  Paul Eggert  <address@hidden>

        * src/symlist.c (symbol_list_length): Return int, not unsigned
        int, since callers expect int.  This may need to get revisited
        once we have proper integer overflow checking.

--- src/symlist.c       26 Jun 2006 04:16:50 -0000      1.18
+++ src/symlist.c       9 Jul 2006 19:39:41 -0000
@@ -100,8 +100,8 @@ symbol_list_free (symbol_list *list)
 | Return its length.  |
 `--------------------*/
 
-unsigned int
-symbol_list_length (const symbol_list *l)
+int
+symbol_list_length (symbol_list const *l)
 {
   int res = 0;
   for (/* Nothing. */; l && l->sym; l = l->next)
--- src/symlist.h       26 Jun 2006 04:45:24 -0000      1.16
+++ src/symlist.h       9 Jul 2006 19:39:41 -0000
@@ -47,7 +47,7 @@ typedef struct symbol_list
   const char *action;
   location action_location;
 
-  /* Whether this symbol's value is used in the current action. */
+  /* Whether this symbol's value is used in the current action.  */
   bool used;
 
   /* Precedence/associativity.  */
@@ -76,7 +76,7 @@ symbol_list *symbol_list_prepend (symbol
 void symbol_list_free (symbol_list *l);
 
 /* Return its length. */
-unsigned int symbol_list_length (const symbol_list *l);
+int symbol_list_length (symbol_list const *l);
 
 /* Get symbol N in symbol list L.  */
 symbol_list *symbol_list_n_get (symbol_list *l, int n);




reply via email to

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