Tweak comments.
[gnulib.git] / lib / obstack.h
index 7a0ee11..87bf2a3 100644 (file)
@@ -7,20 +7,19 @@
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@gnu.org.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option) any
-   later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Summary:
 
@@ -123,12 +122,8 @@ extern "C" {
 #endif
 
 #ifndef __INT_TO_PTR
-#if defined __STDC__ && __STDC__
-# define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
-#else
 # define __INT_TO_PTR(P) ((P) + (char *) 0)
 #endif
-#endif
 
 /* We need the type of the resulting object.  If __PTRDIFF_TYPE__ is
    defined, as with GNU C, use that; that way we don't pollute the
@@ -297,17 +292,17 @@ extern int obstack_exit_failure;
 
 # define obstack_init(h)                                       \
   _obstack_begin ((h), 0, 0,                                   \
-                 (void *(*) (long)) obstack_chunk_alloc,       \
+                 (void *(*) (long)) obstack_chunk_alloc,       \
                  (void (*) (void *)) obstack_chunk_free)
 
 # define obstack_begin(h, size)                                        \
   _obstack_begin ((h), (size), 0,                              \
-                 (void *(*) (long)) obstack_chunk_alloc,       \
+                 (void *(*) (long)) obstack_chunk_alloc,       \
                  (void (*) (void *)) obstack_chunk_free)
 
 # define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
   _obstack_begin ((h), (size), (alignment),                               \
-                 (void *(*) (long)) (chunkfun),                           \
+                 (void *(*) (long)) (chunkfun),                           \
                  (void (*) (void *)) (freefun))
 
 # define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
@@ -325,7 +320,7 @@ extern int obstack_exit_failure;
 
 # define obstack_init(h)                                               \
   _obstack_begin ((h), 0, 0,                                           \
-                 (void *(*) ()) obstack_chunk_alloc,                   \
+                 (void *(*) ()) obstack_chunk_alloc,                   \
                  (void (*) ()) obstack_chunk_free)
 
 # define obstack_begin(h, size)                                                \
@@ -335,12 +330,12 @@ extern int obstack_exit_failure;
 
 # define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
   _obstack_begin ((h), (size), (alignment),                               \
-                 (void *(*) ()) (chunkfun),                               \
+                 (void *(*) ()) (chunkfun),                               \
                  (void (*) ()) (freefun))
 
 # define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
   _obstack_begin_1 ((h), (size), (alignment),                          \
-                   (void *(*) ()) (chunkfun),                          \
+                   (void *(*) ()) (chunkfun),                          \
                    (void (*) ()) (freefun), (arg))
 
 # define obstack_chunkfun(h, newchunkfun) \
@@ -372,12 +367,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)                             \
@@ -390,7 +385,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)                            \
@@ -477,7 +472,7 @@ __extension__                                                               \
 
 /* The local variable is named __o1 to avoid a name conflict
    when obstack_blank is called.  */
-# define obstack_finish(OBSTACK)                                       \
+# define obstack_finish(OBSTACK)                                       \
 __extension__                                                          \
 ({ struct obstack *__o1 = (OBSTACK);                                   \
    void *value;                                                                \
@@ -574,7 +569,7 @@ __extension__                                                               \
 # define obstack_copy0(h,where,length)                                 \
  (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
 
-# define obstack_finish(h)                                             \
+# define obstack_finish(h)                                             \
 ( ((h)->next_free == (h)->object_base                                  \
    ? (((h)->maybe_empty_object = 1), 0)                                        \
    : 0),                                                               \
@@ -586,7 +581,7 @@ __extension__                                                               \
     > (h)->chunk_limit - (char *) (h)->chunk)                          \
    ? ((h)->next_free = (h)->chunk_limit) : 0),                         \
   (h)->object_base = (h)->next_free,                                   \
-  __INT_TO_PTR ((h)->temp))
+  (void *) __INT_TO_PTR ((h)->temp))
 
 # if defined __STDC__ && __STDC__
 #  define obstack_free(h,obj)                                          \