[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] obstack.h: a minor const-correctness change
From: |
Jim Meyering |
Subject: |
[Bug-gnulib] obstack.h: a minor const-correctness change |
Date: |
Fri, 14 Mar 2003 11:37:51 +0100 |
I've just checked in this change.
Without it, I'd get a warning for a use of obstack_object_size
in coreutils/src/remove.c.
* obstack.h (obstack_object_size): Declare temporary, __o,
to be const, in order to avoid warnings.
(obstack_room): Likewise.
(obstack_empty_p): Likewise.
Index: obstack.h
===================================================================
RCS file: /fetish/cu/lib/obstack.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -u -r1.17 -r1.18
--- obstack.h 18 Nov 2000 09:53:33 -0000 1.17
+++ obstack.h 20 Jan 2003 15:45:53 -0000 1.18
@@ -368,12 +368,12 @@ extern int obstack_exit_failure;
# define obstack_object_size(OBSTACK) \
__extension__
\
- ({ struct obstack *__o = (OBSTACK); \
+ ({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->next_free - __o->object_base); })
# define obstack_room(OBSTACK) \
__extension__
\
- ({ struct obstack *__o = (OBSTACK); \
+ ({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
# define obstack_make_room(OBSTACK,length) \
@@ -386,7 +386,7 @@ __extension__
\
# define obstack_empty_p(OBSTACK) \
__extension__
\
- ({ struct obstack *__o = (OBSTACK); \
+ ({ struct obstack const *__o = (OBSTACK); \
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
# define obstack_grow(OBSTACK,where,length) \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] obstack.h: a minor const-correctness change,
Jim Meyering <=