comparison lib-src/ebrowse.c @ 95480:1c16540a2329

* lib-src/ebrowse.c (xfree): Remove definition; s/xfree/free/
author Jim Meyering <jim@meyering.net>
date Mon, 02 Jun 2008 06:02:30 +0000
parents 9588c3703f38
children e8188ccf57c4
comparison
equal deleted inserted replaced
95479:9588c3703f38 95480:1c16540a2329
584 { 584 {
585 yyerror ("out of memory", NULL); 585 yyerror ("out of memory", NULL);
586 exit (EXIT_FAILURE); 586 exit (EXIT_FAILURE);
587 } 587 }
588 return p; 588 return p;
589 }
590
591
592 /* Like free but always check for null pointers.. */
593
594 void
595 xfree (p)
596 void *p;
597 {
598 free (p);
599 } 589 }
600 590
601 591
602 /* Like strdup, but print an error and exit if not enough memory is 592 /* Like strdup, but print an error and exit if not enough memory is
603 available.. If S is null, return null. */ 593 available.. If S is null, return null. */
2756 MATCH (); 2746 MATCH ();
2757 2747
2758 if (LOOKING_AT ('{') && id && cls) 2748 if (LOOKING_AT ('{') && id && cls)
2759 add_member_defn (cls, id, regexp, pos, hash, 0, sc, flags); 2749 add_member_defn (cls, id, regexp, pos, hash, 0, sc, flags);
2760 2750
2761 xfree (id); 2751 free (id);
2762 id = NULL; 2752 id = NULL;
2763 sc = SC_MEMBER; 2753 sc = SC_MEMBER;
2764 break; 2754 break;
2765 2755
2766 case STRUCT: case UNION: case CLASS: 2756 case STRUCT: case UNION: case CLASS:
2835 2825
2836 skip_matching (); 2826 skip_matching ();
2837 print_info (); 2827 print_info ();
2838 } 2828 }
2839 2829
2840 xfree (id); 2830 free (id);
2841 } 2831 }
2842 2832
2843 2833
2844 /* Parse the body of class CLS. TAG is the tag of the class (struct, 2834 /* Parse the body of class CLS. TAG is the tag of the class (struct,
2845 union, class). */ 2835 union, class). */
3072 } 3062 }
3073 else 3063 else
3074 cls = add_sym (id, cls); 3064 cls = add_sym (id, cls);
3075 3065
3076 *last_id = NULL; 3066 *last_id = NULL;
3077 xfree (id); 3067 free (id);
3078 id = NULL; 3068 id = NULL;
3079 id_size = 0; 3069 id_size = 0;
3080 MATCH (); 3070 MATCH ();
3081 } 3071 }
3082 else 3072 else
3275 3265
3276 skip_matching (); 3266 skip_matching ();
3277 print_info (); 3267 print_info ();
3278 } 3268 }
3279 3269
3280 xfree (*id); 3270 free (*id);
3281 *id = NULL; 3271 *id = NULL;
3282 *cls = NULL; 3272 *cls = NULL;
3283 } 3273 }
3284 3274
3285 /* Parse a declaration. */ 3275 /* Parse a declaration. */
3328 case CLASS: case STRUCT: case UNION: 3318 case CLASS: case STRUCT: case UNION:
3329 /* This is for the case `STARTWRAP class X : ...' or 3319 /* This is for the case `STARTWRAP class X : ...' or
3330 `declare (X, Y)\n class A : ...'. */ 3320 `declare (X, Y)\n class A : ...'. */
3331 if (id) 3321 if (id)
3332 { 3322 {
3333 xfree (id); 3323 free (id);
3334 return; 3324 return;
3335 } 3325 }
3336 3326
3337 case '=': 3327 case '=':
3338 /* Assumed to be the start of an initialization in this 3328 /* Assumed to be the start of an initialization in this
3422 MATCH (); 3412 MATCH ();
3423 3413
3424 if (!cls && id && LOOKING_AT ('{')) 3414 if (!cls && id && LOOKING_AT ('{'))
3425 add_global_defn (id, regexp, pos, hash, 0, sc, flags); 3415 add_global_defn (id, regexp, pos, hash, 0, sc, flags);
3426 3416
3427 xfree (id); 3417 free (id);
3428 id = NULL; 3418 id = NULL;
3429 break; 3419 break;
3430 } 3420 }
3431 } 3421 }
3432 3422
3478 globals (0); 3468 globals (0);
3479 leave_namespace (); 3469 leave_namespace ();
3480 MATCH_IF ('}'); 3470 MATCH_IF ('}');
3481 } 3471 }
3482 3472
3483 xfree (namespace_name); 3473 free (namespace_name);
3484 } 3474 }
3485 } 3475 }
3486 break; 3476 break;
3487 3477
3488 case EXTERN: 3478 case EXTERN: