obstack.h (78828) | obstack.h (130561) |
---|---|
1/* obstack.h - object stack macros 2 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 3 1999, 2000 4 Free Software Foundation, Inc. 5 6 7 NOTE: The canonical source of this file is maintained with the GNU C Library. 8 Bugs can be reported to bug-glibc@gnu.org. --- 329 unchanged lines hidden (view full) --- 338# define obstack_chunkfun(h, newchunkfun) \ 339 ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun)) 340 341# define obstack_freefun(h, newfreefun) \ 342 ((h) -> freefun = (void (*)()) (newfreefun)) 343 344#endif 345 | 1/* obstack.h - object stack macros 2 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 3 1999, 2000 4 Free Software Foundation, Inc. 5 6 7 NOTE: The canonical source of this file is maintained with the GNU C Library. 8 Bugs can be reported to bug-glibc@gnu.org. --- 329 unchanged lines hidden (view full) --- 338# define obstack_chunkfun(h, newchunkfun) \ 339 ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun)) 340 341# define obstack_freefun(h, newfreefun) \ 342 ((h) -> freefun = (void (*)()) (newfreefun)) 343 344#endif 345 |
346#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar) | 346#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) |
347 348#define obstack_blank_fast(h,n) ((h)->next_free += (n)) 349 350#define obstack_memory_used(h) _obstack_memory_used (h) 351 352#if defined __GNUC__ && defined __STDC__ && __STDC__ 353/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and 354 does not implement __extension__. But that compiler doesn't define --- 51 unchanged lines hidden (view full) --- 406 *(__o->next_free)++ = 0; \ 407 (void) 0; }) 408 409# define obstack_1grow(OBSTACK,datum) \ 410__extension__ \ 411({ struct obstack *__o = (OBSTACK); \ 412 if (__o->next_free + 1 > __o->chunk_limit) \ 413 _obstack_newchunk (__o, 1); \ | 347 348#define obstack_blank_fast(h,n) ((h)->next_free += (n)) 349 350#define obstack_memory_used(h) _obstack_memory_used (h) 351 352#if defined __GNUC__ && defined __STDC__ && __STDC__ 353/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and 354 does not implement __extension__. But that compiler doesn't define --- 51 unchanged lines hidden (view full) --- 406 *(__o->next_free)++ = 0; \ 407 (void) 0; }) 408 409# define obstack_1grow(OBSTACK,datum) \ 410__extension__ \ 411({ struct obstack *__o = (OBSTACK); \ 412 if (__o->next_free + 1 > __o->chunk_limit) \ 413 _obstack_newchunk (__o, 1); \ |
414 *(__o->next_free)++ = (datum); \ | 414 obstack_1grow_fast (__o, datum); \ |
415 (void) 0; }) 416 417/* These assume that the obstack alignment is good enough for pointers or ints, 418 and that the data added so far to the current object 419 shares that much alignment. */ 420 421# define obstack_ptr_grow(OBSTACK,datum) \ 422__extension__ \ 423({ struct obstack *__o = (OBSTACK); \ 424 if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ 425 _obstack_newchunk (__o, sizeof (void *)); \ | 415 (void) 0; }) 416 417/* These assume that the obstack alignment is good enough for pointers or ints, 418 and that the data added so far to the current object 419 shares that much alignment. */ 420 421# define obstack_ptr_grow(OBSTACK,datum) \ 422__extension__ \ 423({ struct obstack *__o = (OBSTACK); \ 424 if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ 425 _obstack_newchunk (__o, sizeof (void *)); \ |
426 *((void **)__o->next_free)++ = ((void *)datum); \ 427 (void) 0; }) | 426 obstack_ptr_grow_fast (__o, datum); }) |
428 429# define obstack_int_grow(OBSTACK,datum) \ 430__extension__ \ 431({ struct obstack *__o = (OBSTACK); \ 432 if (__o->next_free + sizeof (int) > __o->chunk_limit) \ 433 _obstack_newchunk (__o, sizeof (int)); \ | 427 428# define obstack_int_grow(OBSTACK,datum) \ 429__extension__ \ 430({ struct obstack *__o = (OBSTACK); \ 431 if (__o->next_free + sizeof (int) > __o->chunk_limit) \ 432 _obstack_newchunk (__o, sizeof (int)); \ |
434 *((int *)__o->next_free)++ = ((int)datum); \ | 433 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 *); \ |
435 (void) 0; }) 436 | 440 (void) 0; }) 441 |
437# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr) 438# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) | 442# define obstack_int_grow_fast(OBSTACK,aint) \ 443__extension__ \ 444({ struct obstack *__o1 = (OBSTACK); \ 445 *(int *) __o1->next_free = (aint); \ 446 __o1->next_free += sizeof (int); \ 447 (void) 0; }) |
439 440# define obstack_blank(OBSTACK,length) \ 441__extension__ \ 442({ struct obstack *__o = (OBSTACK); \ 443 int __len = (length); \ 444 if (__o->chunk_limit - __o->next_free < __len) \ 445 _obstack_newchunk (__o, __len); \ | 448 449# define obstack_blank(OBSTACK,length) \ 450__extension__ \ 451({ struct obstack *__o = (OBSTACK); \ 452 int __len = (length); \ 453 if (__o->chunk_limit - __o->next_free < __len) \ 454 _obstack_newchunk (__o, __len); \ |
446 __o->next_free += __len; \ | 455 obstack_blank_fast (__o, __len); \ |
447 (void) 0; }) 448 449# define obstack_alloc(OBSTACK,length) \ 450__extension__ \ 451({ struct obstack *__h = (OBSTACK); \ 452 obstack_blank (__h, (length)); \ 453 obstack_finish (__h); }) 454 --- 70 unchanged lines hidden (view full) --- 525 ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \ 526 _obstack_memcpy ((h)->next_free, (where), (h)->temp), \ 527 (h)->next_free += (h)->temp, \ 528 *((h)->next_free)++ = 0) 529 530# define obstack_1grow(h,datum) \ 531( (((h)->next_free + 1 > (h)->chunk_limit) \ 532 ? (_obstack_newchunk ((h), 1), 0) : 0), \ | 456 (void) 0; }) 457 458# define obstack_alloc(OBSTACK,length) \ 459__extension__ \ 460({ struct obstack *__h = (OBSTACK); \ 461 obstack_blank (__h, (length)); \ 462 obstack_finish (__h); }) 463 --- 70 unchanged lines hidden (view full) --- 534 ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \ 535 _obstack_memcpy ((h)->next_free, (where), (h)->temp), \ 536 (h)->next_free += (h)->temp, \ 537 *((h)->next_free)++ = 0) 538 539# define obstack_1grow(h,datum) \ 540( (((h)->next_free + 1 > (h)->chunk_limit) \ 541 ? (_obstack_newchunk ((h), 1), 0) : 0), \ |
533 (*((h)->next_free)++ = (datum))) | 542 obstack_1grow_fast (h, datum)) |
534 535# define obstack_ptr_grow(h,datum) \ 536( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ 537 ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ | 543 544# define obstack_ptr_grow(h,datum) \ 545( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ 546 ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ |
538 (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum))) | 547 obstack_ptr_grow_fast (h, datum)) |
539 540# define obstack_int_grow(h,datum) \ 541( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ 542 ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ | 548 549# define obstack_int_grow(h,datum) \ 550( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ 551 ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ |
543 (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum))) | 552 obstack_int_grow_fast (h, datum)) |
544 | 553 |
545# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr) 546# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) | 554# define obstack_ptr_grow_fast(h,aptr) \ 555 (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) |
547 | 556 |
557# define obstack_int_grow_fast(h,aint) \ 558 (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr)) 559 |
|
548# define obstack_blank(h,length) \ 549( (h)->temp = (length), \ 550 (((h)->chunk_limit - (h)->next_free < (h)->temp) \ 551 ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ | 560# define obstack_blank(h,length) \ 561( (h)->temp = (length), \ 562 (((h)->chunk_limit - (h)->next_free < (h)->temp) \ 563 ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ |
552 ((h)->next_free += (h)->temp)) | 564 obstack_blank_fast (h, (h)->temp)) |
553 554# define obstack_alloc(h,length) \ 555 (obstack_blank ((h), (length)), obstack_finish ((h))) 556 557# define obstack_copy(h,where,length) \ 558 (obstack_grow ((h), (where), (length)), obstack_finish ((h))) 559 560# define obstack_copy0(h,where,length) \ --- 39 unchanged lines hidden --- | 565 566# define obstack_alloc(h,length) \ 567 (obstack_blank ((h), (length)), obstack_finish ((h))) 568 569# define obstack_copy(h,where,length) \ 570 (obstack_grow ((h), (where), (length)), obstack_finish ((h))) 571 572# define obstack_copy0(h,where,length) \ --- 39 unchanged lines hidden --- |