/[gcl]/gcl/binutils/include/obstack.h
ViewVC logotype

Diff of /gcl/binutils/include/obstack.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by camm, Fri Aug 9 05:36:40 2002 UTC revision 1.1.1.1.20.1 by camm, Fri Sep 30 02:10:24 2005 UTC
# Line 343  extern int obstack_exit_failure; Line 343  extern int obstack_exit_failure;
343    
344  #endif  #endif
345    
346  #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)  #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
347    
348  #define obstack_blank_fast(h,n) ((h)->next_free += (n))  #define obstack_blank_fast(h,n) ((h)->next_free += (n))
349    
# Line 411  __extension__                                                          \ Line 411  __extension__                                                          \
411  ({ struct obstack *__o = (OBSTACK);                                     \  ({ struct obstack *__o = (OBSTACK);                                     \
412     if (__o->next_free + 1 > __o->chunk_limit)                           \     if (__o->next_free + 1 > __o->chunk_limit)                           \
413       _obstack_newchunk (__o, 1);                                        \       _obstack_newchunk (__o, 1);                                        \
414     *(__o->next_free)++ = (datum);                                       \     obstack_1grow_fast (__o, datum);                                     \
415     (void) 0; })     (void) 0; })
416    
417  /* These assume that the obstack alignment is good enough for pointers or ints,  /* These assume that the obstack alignment is good enough for pointers or ints,
# Line 423  __extension__                                                          \ Line 423  __extension__                                                          \
423  ({ struct obstack *__o = (OBSTACK);                                     \  ({ struct obstack *__o = (OBSTACK);                                     \
424     if (__o->next_free + sizeof (void *) > __o->chunk_limit)             \     if (__o->next_free + sizeof (void *) > __o->chunk_limit)             \
425       _obstack_newchunk (__o, sizeof (void *));                          \       _obstack_newchunk (__o, sizeof (void *));                          \
426     *((void **)__o->next_free)++ = ((void *)datum);                      \     obstack_ptr_grow_fast (__o, datum); })
    (void) 0; })  
427    
428  # define obstack_int_grow(OBSTACK,datum)                                \  # define obstack_int_grow(OBSTACK,datum)                                \
429  __extension__                                                           \  __extension__                                                           \
430  ({ struct obstack *__o = (OBSTACK);                                     \  ({ struct obstack *__o = (OBSTACK);                                     \
431     if (__o->next_free + sizeof (int) > __o->chunk_limit)                \     if (__o->next_free + sizeof (int) > __o->chunk_limit)                \
432       _obstack_newchunk (__o, sizeof (int));                             \       _obstack_newchunk (__o, sizeof (int));                             \
433     *((int *)__o->next_free)++ = ((int)datum);                           \     obstack_int_grow_fast (__o, datum); })
434    
435    # define obstack_ptr_grow_fast(OBSTACK,aptr)                            \
436    __extension__                                                           \
437    ({ struct obstack *__o1 = (OBSTACK);                                    \
438       *(const void **) __o1->next_free = (aptr);                           \
439       __o1->next_free += sizeof (const void *);                            \
440     (void) 0; })     (void) 0; })
441    
442  # define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)  # define obstack_int_grow_fast(OBSTACK,aint)                            \
443  # define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)  __extension__                                                           \
444    ({ struct obstack *__o1 = (OBSTACK);                                    \
445       *(int *) __o1->next_free = (aint);                                   \
446       __o1->next_free += sizeof (int);                                     \
447       (void) 0; })
448    
449  # define obstack_blank(OBSTACK,length)                                  \  # define obstack_blank(OBSTACK,length)                                  \
450  __extension__                                                           \  __extension__                                                           \
# Line 443  __extension__                                                          \ Line 452  __extension__                                                          \
452     int __len = (length);                                                \     int __len = (length);                                                \
453     if (__o->chunk_limit - __o->next_free < __len)                       \     if (__o->chunk_limit - __o->next_free < __len)                       \
454       _obstack_newchunk (__o, __len);                                    \       _obstack_newchunk (__o, __len);                                    \
455     __o->next_free += __len;                                             \     obstack_blank_fast (__o, __len);                                     \
456     (void) 0; })     (void) 0; })
457    
458  # define obstack_alloc(OBSTACK,length)                                  \  # define obstack_alloc(OBSTACK,length)                                  \
# Line 485  __extension__                                                          \ Line 494  __extension__                                                          \
494  # define obstack_free(OBSTACK, OBJ)                                     \  # define obstack_free(OBSTACK, OBJ)                                     \
495  __extension__                                                           \  __extension__                                                           \
496  ({ struct obstack *__o = (OBSTACK);                                     \  ({ struct obstack *__o = (OBSTACK);                                     \
497     void *__obj = (OBJ);                                                 \     void *__obj = (void *) (OBJ);                                        \
498     if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit)  \     if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit)  \
499       __o->next_free = __o->object_base = __obj;                         \       __o->next_free = __o->object_base = (char *) __obj;                \
500     else (obstack_free) (__o, __obj); })     else (obstack_free) (__o, __obj); })
501    
502  #else /* not __GNUC__ or not __STDC__ */  #else /* not __GNUC__ or not __STDC__ */
# Line 530  __extension__                                                          \ Line 539  __extension__                                                          \
539  # define obstack_1grow(h,datum)                                         \  # define obstack_1grow(h,datum)                                         \
540  ( (((h)->next_free + 1 > (h)->chunk_limit)                              \  ( (((h)->next_free + 1 > (h)->chunk_limit)                              \
541     ? (_obstack_newchunk ((h), 1), 0) : 0),                              \     ? (_obstack_newchunk ((h), 1), 0) : 0),                              \
542    (*((h)->next_free)++ = (datum)))    obstack_1grow_fast (h, datum))
543    
544  # define obstack_ptr_grow(h,datum)                                      \  # define obstack_ptr_grow(h,datum)                                      \
545  ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit)                \  ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit)                \
546     ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0),                \     ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0),                \
547    (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))    obstack_ptr_grow_fast (h, datum))
548    
549  # define obstack_int_grow(h,datum)                                      \  # define obstack_int_grow(h,datum)                                      \
550  ( (((h)->next_free + sizeof (int) > (h)->chunk_limit)                   \  ( (((h)->next_free + sizeof (int) > (h)->chunk_limit)                   \
551     ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0),                   \     ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0),                   \
552    (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))    obstack_int_grow_fast (h, datum))
553    
554    # define obstack_ptr_grow_fast(h,aptr)                                  \
555      (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))
556    
557  # define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)  # define obstack_int_grow_fast(h,aint)                                  \
558  # define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)    (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr))
559    
560  # define obstack_blank(h,length)                                        \  # define obstack_blank(h,length)                                        \
561  ( (h)->temp = (length),                                                 \  ( (h)->temp = (length),                                                 \
562    (((h)->chunk_limit - (h)->next_free < (h)->temp)                      \    (((h)->chunk_limit - (h)->next_free < (h)->temp)                      \
563     ? (_obstack_newchunk ((h), (h)->temp), 0) : 0),                      \     ? (_obstack_newchunk ((h), (h)->temp), 0) : 0),                      \
564    ((h)->next_free += (h)->temp))    obstack_blank_fast (h, (h)->temp))
565    
566  # define obstack_alloc(h,length)                                        \  # define obstack_alloc(h,length)                                        \
567   (obstack_blank ((h), (length)), obstack_finish ((h)))   (obstack_blank ((h), (length)), obstack_finish ((h)))

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.20.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26