X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fobstack.h;h=67c0b55b4591c8dabd1fa6bede5a9200c040c716;hb=2b7c2713dc823b924ec88f481be1671bf53b6da3;hp=b7d2404a16e451d00086f49b40dad7e8628cd591;hpb=c5230ae4c155d0e6e9e043a57d77b05e44497b84;p=gnulib.git diff --git a/lib/obstack.h b/lib/obstack.h index b7d2404a1..67c0b55b4 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -1,20 +1,20 @@ /* obstack.h - object stack macros - Copyright (C) 1988-1994, 1996-1999, 2003-2006, 2009-2012 Free Software - Foundation, Inc. + Copyright (C) 1988-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. - 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 3 of the License, 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, 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 General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see + . */ /* Summary: @@ -122,7 +122,7 @@ Summary: #define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) -/* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case +/* Similar to _BPTR_ALIGN (B, P, A), except optimize the common case where pointers can be converted to integers, aligned as integers, and converted back again. If PTR_INT_TYPE is narrower than a pointer (e.g., the AS/400), play it safe and compute the alignment @@ -183,7 +183,7 @@ extern int _obstack_begin (struct obstack *, int, int, extern int _obstack_begin_1 (struct obstack *, int, int, void *(*) (void *, long), void (*) (void *, void *), void *); -extern int _obstack_memory_used (struct obstack *); +extern int _obstack_memory_used (struct obstack *) _GL_ATTRIBUTE_PURE; /* The default name of the function for freeing a chunk is 'obstack_free', but gnulib users can override this by defining '__obstack_free'. */ @@ -342,14 +342,16 @@ __extension__ \ # define obstack_ptr_grow_fast(OBSTACK,aptr) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ - *(const void **) __o1->next_free = (aptr); \ + void *__p1 = __o1->next_free; \ + *(const void **) __p1 = (aptr); \ __o1->next_free += sizeof (const void *); \ (void) 0; }) # define obstack_int_grow_fast(OBSTACK,aint) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ - *(int *) __o1->next_free = (aint); \ + void *__p1 = __o1->next_free; \ + *(int *) __p1 = (aint); \ __o1->next_free += sizeof (int); \ (void) 0; }) @@ -499,9 +501,9 @@ __extension__ \ ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ ((((h)->temp.tempint > 0 \ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp.tempint + (char *) (h)->chunk) \ - : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) + ? (void) ((h)->next_free = (h)->object_base \ + = (h)->temp.tempint + (char *) (h)->chunk) \ + : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk))) #endif /* not __GNUC__ */