]> Savannah Git Hosting - gnulib.git/commit
obstack: tidy part 2
authorAlan Modra <amodra@gmail.com>
Wed, 29 Oct 2014 03:32:22 +0000 (14:02 +1030)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 Oct 2014 07:23:38 +0000 (00:23 -0700)
commit8216dffc279801576da195c4a259f4ed2f00b230
treedaea35fc6394ab44e652e18705cd354d1aaab9e1
parentec1a9f7b6f2eab974ec8b2086c9f9c137b921a7d
obstack: tidy part 2

a) Don't be concerned about "not polluting the namespace with stddef.h
   symbols" in obstack.h, since gnulib string.h includes stddef.h
   anyway, and it seems unlikely that anyone would care.
b) Don't roll our own slow memcpy in _obstack_newchunk.
c) Rename obstack_free to _obstack_free.  This makes the naming
   consistent with other obstack functions and obviates the need for
   __obstack_free.  Ancient obstack.c defined both obstack_free and
   _obstack_free.  We continue to do that for _LIBC via an alias.
d) Miscellaneous macro fixes.  The expression used to test for gcc-2.8
   is clever, but nowadays gcc warns on undefined macros.  You'll get
   an undefined macro warning if simulating an old gcc with -U__GNUC__
   -U__GNUC_MINOR__ -D__GNUC__=1.

* lib/obstack.h: Include stddef.h unconditionally.  Formatting fixes.
(PTR_INT_TYPE): Delete, replace with ptrdiff_t.
(__obstack_free): Delete, update refs.
(_obstack_free): Rename from obstack_free.
(__extension__): Avoid undefined macro warning for __GNUC_MINOR__.
(obstack_object_size, obstack_room): Parenthesise !__GNUC__ versions.
* lib/obstack.c: Don't include stddef.h.
(COPYING_UNIT): Delete.
(_obstack_begin): Formatting fix.
(_obstack_newchunk): Use memcpy to move existing object to new chunk.
(_obstack_free): Rename from __obstack_free, update alias.  Move
undef of obstack_free to where it is needed.
lib/obstack.c
lib/obstack.h