From: Akim Demaille Date: Tue, 7 Nov 2000 11:54:01 +0000 (+0000) Subject: * src/output.c (output): Remove useless variables. X-Git-Tag: BISON-1_28b~72 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/8a4f41d6ed0848c04db9095ad564a2d2b1831fca * src/output.c (output): Remove useless variables. * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second argument `data' for consistency with the prototypes. Qualify it `const'. (obstack_copy, obstack_copy0): Rename the second argument as `address' for consistency. Qualify it `const'. * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow) (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify `const' their input argument (`data' or `address'). Adjust the corresponding macros to include `const' in casts. --- diff --git a/ChangeLog b/ChangeLog index b09ff96d..32252868 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-11-07 Akim Demaille + + * src/output.c (output): Remove useless variables. + * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second + argument `data' for consistency with the prototypes. + Qualify it `const'. + (obstack_copy, obstack_copy0): Rename the second argument as + `address' for consistency. Qualify it `const'. + * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow) + (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify + `const' their input argument (`data' or `address'). + Adjust the corresponding macros to include `const' in casts. + 2000-11-03 Akim Demaille * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/. diff --git a/lib/obstack.c b/lib/obstack.c index 6b32678b..8368f288 100644 --- a/lib/obstack.c +++ b/lib/obstack.c @@ -524,20 +524,20 @@ int (obstack_make_room) (obstack, length) return obstack_make_room (obstack, length); } -void (obstack_grow) (obstack, pointer, length) +void (obstack_grow) (obstack, data, length) struct obstack *obstack; - POINTER pointer; + const POINTER data; int length; { - obstack_grow (obstack, pointer, length); + obstack_grow (obstack, data, length); } -void (obstack_grow0) (obstack, pointer, length) +void (obstack_grow0) (obstack, data, length) struct obstack *obstack; - POINTER pointer; + const POINTER data; int length; { - obstack_grow0 (obstack, pointer, length); + obstack_grow0 (obstack, data, length); } void (obstack_1grow) (obstack, character) @@ -581,20 +581,20 @@ POINTER (obstack_alloc) (obstack, length) return obstack_alloc (obstack, length); } -POINTER (obstack_copy) (obstack, pointer, length) +POINTER (obstack_copy) (obstack, address, length) struct obstack *obstack; - POINTER pointer; + const POINTER address; int length; { - return obstack_copy (obstack, pointer, length); + return obstack_copy (obstack, address, length); } -POINTER (obstack_copy0) (obstack, pointer, length) +POINTER (obstack_copy0) (obstack, address, length) struct obstack *obstack; - POINTER pointer; + const POINTER address; int length; { - return obstack_copy0 (obstack, pointer, length); + return obstack_copy0 (obstack, address, length); } #endif /* __STDC__ */ diff --git a/lib/obstack.h b/lib/obstack.h index 4d49ce02..e3c4543d 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -217,18 +217,18 @@ void obstack_init (struct obstack *obstack); void * obstack_alloc (struct obstack *obstack, int size); -void * obstack_copy (struct obstack *obstack, void *address, int size); -void * obstack_copy0 (struct obstack *obstack, void *address, int size); +void * obstack_copy (struct obstack *obstack, const void *address, int size); +void * obstack_copy0 (struct obstack *obstack, const void *address, int size); void obstack_free (struct obstack *obstack, void *block); void obstack_blank (struct obstack *obstack, int size); -void obstack_grow (struct obstack *obstack, void *data, int size); -void obstack_grow0 (struct obstack *obstack, void *data, int size); +void obstack_grow (struct obstack *obstack, const void *data, int size); +void obstack_grow0 (struct obstack *obstack, const void *data, int size); void obstack_1grow (struct obstack *obstack, int data_char); -void obstack_ptr_grow (struct obstack *obstack, void *data); +void obstack_ptr_grow (struct obstack *obstack, const void *data); void obstack_int_grow (struct obstack *obstack, int data); void * obstack_finish (struct obstack *obstack); @@ -238,7 +238,7 @@ int obstack_object_size (struct obstack *obstack); int obstack_room (struct obstack *obstack); void obstack_make_room (struct obstack *obstack, int size); void obstack_1grow_fast (struct obstack *obstack, int data_char); -void obstack_ptr_grow_fast (struct obstack *obstack, void *data); +void obstack_ptr_grow_fast (struct obstack *obstack, const void *data); void obstack_int_grow_fast (struct obstack *obstack, int data); void obstack_blank_fast (struct obstack *obstack, int size); @@ -385,7 +385,7 @@ __extension__ \ int __len = (length); \ if (__o->next_free + __len > __o->chunk_limit) \ _obstack_newchunk (__o, __len); \ - _obstack_memcpy (__o->next_free, (char *) (where), __len); \ + _obstack_memcpy (__o->next_free, (const char *) (where), __len); \ __o->next_free += __len; \ (void) 0; }) @@ -395,7 +395,7 @@ __extension__ \ int __len = (length); \ if (__o->next_free + __len + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, __len + 1); \ - _obstack_memcpy (__o->next_free, (char *) (where), __len); \ + _obstack_memcpy (__o->next_free, (const char *) (where), __len); \ __o->next_free += __len; \ *(__o->next_free)++ = 0; \ (void) 0; }) @@ -417,7 +417,7 @@ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ - *((void **)__o->next_free)++ = ((void *)datum); \ + *((void **)__o->next_free)++ = ((const void *)datum); \ (void) 0; }) # define obstack_int_grow(OBSTACK,datum) \ diff --git a/src/output.c b/src/output.c index 8783dbd5..fbe007ea 100644 --- a/src/output.c +++ b/src/output.c @@ -1308,8 +1308,6 @@ free_itemsets (void) void output (void) { - int c; - /* output_token_defines(ftable); / * JF put out token defines FIRST */ /* If using a simple parser the definition of YYSTYPE are put into