From: millert Date: Wed, 8 Jan 2014 21:40:25 +0000 (+0000) Subject: Remove CALLOC, MALLOC, FREE and REALLOC macros and just call calloc(), X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ef3564504a4572c5023c4439091728db2adce3e8;p=openbsd Remove CALLOC, MALLOC, FREE and REALLOC macros and just call calloc(), nalloc(), free() and realloc() directly. The macros were casting to the wrong (pre-C89) types and there is no need for them in a C89 world. OK matthew@ --- diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c index 9e9782a6b0a..016e5c4b5d1 100644 --- a/usr.bin/yacc/closure.c +++ b/usr.bin/yacc/closure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: closure.c,v 1.10 2012/05/30 13:12:39 nicm Exp $ */ +/* $OpenBSD: closure.c,v 1.11 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: closure.c,v 1.4 1996/03/19 03:21:29 jtc Exp $ */ /* @@ -132,7 +132,7 @@ set_first_derives(void) print_first_derives(); #endif - FREE(EFF); + free(EFF); } @@ -206,9 +206,9 @@ closure(short *nucleus, int n) void finalize_closure(void) { - FREE(itemset); - FREE(ruleset); - FREE(first_derives + ntokens * WORDSIZE(nrules)); + free(itemset); + free(ruleset); + free(first_derives + ntokens * WORDSIZE(nrules)); } diff --git a/usr.bin/yacc/defs.h b/usr.bin/yacc/defs.h index 32fe6082c15..02de7b5b7b0 100644 --- a/usr.bin/yacc/defs.h +++ b/usr.bin/yacc/defs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: defs.h,v 1.12 2011/04/01 21:21:39 nicm Exp $ */ +/* $OpenBSD: defs.h,v 1.13 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: defs.h,v 1.6 1996/03/19 03:21:30 jtc Exp $ */ /* @@ -137,12 +137,8 @@ /* storage allocation macros */ -#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n))) -#define FREE(x) (free((char*)(x))) -#define MALLOC(n) (malloc((unsigned)(n))) #define NEW(t) ((t*)allocate(sizeof(t))) #define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t)))) -#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n))) /* the structure of a symbol table entry */ diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c index 6a3eba102ae..036ded6a7f2 100644 --- a/usr.bin/yacc/lalr.c +++ b/usr.bin/yacc/lalr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lalr.c,v 1.11 2012/03/03 19:15:00 nicm Exp $ */ +/* $OpenBSD: lalr.c,v 1.12 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: lalr.c,v 1.4 1996/03/19 03:21:33 jtc Exp $ */ /* @@ -276,7 +276,7 @@ set_goto_map(void) } } - FREE(temp_map + ntokens); + free(temp_map + ntokens); } @@ -378,11 +378,11 @@ initialize_F(void) for (i = 0; i < ngotos; i++) { if (reads[i]) - FREE(reads[i]); + free(reads[i]); } - FREE(reads); - FREE(edge); + free(reads); + free(edge); } @@ -468,14 +468,14 @@ build_relations(void) for (i = 0; i < ngotos; i++) if (includes[i]) - FREE(includes[i]); + free(includes[i]); - FREE(includes); + free(includes); includes = new_includes; - FREE(edge); - FREE(states); + free(edge); + free(states); } void @@ -542,7 +542,7 @@ transpose(short **R, int n) } } - FREE(nedges); + free(nedges); for (i = 0; i < n; i++) { @@ -554,7 +554,7 @@ transpose(short **R, int n) } } - FREE(temp_R); + free(temp_R); return (new_R); } @@ -593,11 +593,11 @@ compute_lookaheads(void) for (sp = lookback[i]; sp; sp = next) { next = sp->next; - FREE(sp); + free(sp); } - FREE(lookback); - FREE(F); + free(lookback); + free(F); } void @@ -616,8 +616,8 @@ digraph(short **relation) if (R[i]) traverse(i); - FREE(INDEX); - FREE(VERTICES); + free(INDEX); + free(VERTICES); } diff --git a/usr.bin/yacc/lr0.c b/usr.bin/yacc/lr0.c index 75d1b7a907c..a7632093898 100644 --- a/usr.bin/yacc/lr0.c +++ b/usr.bin/yacc/lr0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lr0.c,v 1.12 2012/03/03 19:15:00 nicm Exp $ */ +/* $OpenBSD: lr0.c,v 1.13 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: lr0.c,v 1.4 1996/03/19 03:21:35 jtc Exp $ */ /* @@ -159,13 +159,13 @@ append_states(void) void free_storage(void) { - FREE(shift_symbol); - FREE(redset); - FREE(shiftset); - FREE(kernel_base); - FREE(kernel_end); - FREE(kernel_items); - FREE(state_set); + free(shift_symbol); + free(redset); + free(shiftset); + free(kernel_base); + free(kernel_end); + free(kernel_items); + free(state_set); } @@ -271,7 +271,7 @@ initialize_states(void) for (i = 0; start_derives[i] >= 0; ++i) continue; - p = (core *) MALLOC(sizeof(core) + i*sizeof(short)); + p = (core *) malloc(sizeof(core) + i*sizeof(short)); if (p == 0) no_space(); p->next = 0; @@ -478,8 +478,8 @@ set_derives(void) void free_derives(void) { - FREE(derives[start_symbol]); - FREE(derives); + free(derives[start_symbol]); + free(derives); } #ifdef DEBUG @@ -512,7 +512,7 @@ set_nullable(void) int empty; int done; - nullable = MALLOC(nsyms); + nullable = malloc(nsyms); if (nullable == 0) no_space(); memset(nullable, 0, nsyms); @@ -556,7 +556,7 @@ set_nullable(void) void free_nullable(void) { - FREE(nullable); + free(nullable); } void diff --git a/usr.bin/yacc/main.c b/usr.bin/yacc/main.c index 9918276eb02..2a2384a2249 100644 --- a/usr.bin/yacc/main.c +++ b/usr.bin/yacc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.23 2009/10/27 23:59:50 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.24 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: main.c,v 1.5 1996/03/19 03:21:38 jtc Exp $ */ /* @@ -221,7 +221,7 @@ allocate(unsigned int n) p = NULL; if (n) { - p = CALLOC(1, n); + p = calloc(1, n); if (!p) no_space(); } return (p); diff --git a/usr.bin/yacc/mkpar.c b/usr.bin/yacc/mkpar.c index 6513afd1bba..5f4083423c3 100644 --- a/usr.bin/yacc/mkpar.c +++ b/usr.bin/yacc/mkpar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkpar.c,v 1.15 2012/03/03 19:15:00 nicm Exp $ */ +/* $OpenBSD: mkpar.c,v 1.16 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: mkpar.c,v 1.4 1996/03/19 03:21:39 jtc Exp $ */ /* @@ -213,7 +213,7 @@ unused_rules(void) int i; action *p; - rules_used = CALLOC(nrules, sizeof(short)); + rules_used = calloc(nrules, sizeof(short)); if (rules_used == NULL) no_space(); for (i = 0; i < nstates; ++i) @@ -384,7 +384,7 @@ free_action_row(action *p) while (p) { q = p->next; - FREE(p); + free(p); p = q; } } @@ -397,5 +397,5 @@ free_parser(void) for (i = 0; i < nstates; i++) free_action_row(parser[i]); - FREE(parser); + free(parser); } diff --git a/usr.bin/yacc/output.c b/usr.bin/yacc/output.c index a8738df92e6..520ef546461 100644 --- a/usr.bin/yacc/output.c +++ b/usr.bin/yacc/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.16 2012/03/03 19:15:00 nicm Exp $ */ +/* $OpenBSD: output.c,v 1.17 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: output.c,v 1.4 1996/03/19 03:21:41 jtc Exp $ */ /* @@ -269,15 +269,15 @@ output_actions(void) width = NEW2(nvectors, short); token_actions(); - FREE(lookaheads); - FREE(LA); - FREE(LAruleno); - FREE(accessing_symbol); + free(lookaheads); + free(LA); + free(LAruleno); + free(accessing_symbol); goto_actions(); - FREE(goto_map + ntokens); - FREE(from_state); - FREE(to_state); + free(goto_map + ntokens); + free(from_state); + free(to_state); sort_actions(); pack_table(); @@ -369,7 +369,7 @@ token_actions(void) } } } - FREE(actionrow); + free(actionrow); } void @@ -408,7 +408,7 @@ goto_actions(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(state_count); + free(state_count); } int @@ -559,14 +559,14 @@ pack_table(void) for (i = 0; i < nvectors; i++) { if (froms[i]) - FREE(froms[i]); + free(froms[i]); if (tos[i]) - FREE(tos[i]); + free(tos[i]); } - FREE(froms); - FREE(tos); - FREE(pos); + free(froms); + free(tos); + free(pos); } @@ -663,9 +663,9 @@ pack_vector(int vector) newmax = maxtable; do { newmax += 200; } while (newmax <= loc); - table = (short *) REALLOC(table, newmax*sizeof(short)); + table = (short *) realloc(table, newmax*sizeof(short)); if (table == 0) no_space(); - check = (short *) REALLOC(check, newmax*sizeof(short)); + check = (short *) realloc(check, newmax*sizeof(short)); if (check == 0) no_space(); for (l = maxtable; l < newmax; ++l) { @@ -783,7 +783,7 @@ output_base(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(base); + free(base); } @@ -820,7 +820,7 @@ output_table(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(table); + free(table); } @@ -855,7 +855,7 @@ output_check(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(check); + free(check); } @@ -996,7 +996,7 @@ output_debug(void) ++outline; fprintf(code_file, "#define YYMAXTOKEN %d\n", max); - symnam = (char **) MALLOC((max+1)*sizeof(char *)); + symnam = (char **) malloc((max+1)*sizeof(char *)); if (symnam == 0) no_space(); /* Note that it is not necessary to initialize the element */ @@ -1137,7 +1137,7 @@ output_debug(void) } if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(symnam); + free(symnam); if (!rflag) ++outline; fprintf(output_file, @@ -1313,11 +1313,11 @@ free_itemsets(void) { core *cp, *next; - FREE(state_table); + free(state_table); for (cp = first_state; cp; cp = next) { next = cp->next; - FREE(cp); + free(cp); } } @@ -1327,11 +1327,11 @@ free_shifts(void) { shifts *sp, *next; - FREE(shift_table); + free(shift_table); for (sp = first_shift; sp; sp = next) { next = sp->next; - FREE(sp); + free(sp); } } @@ -1342,10 +1342,10 @@ free_reductions(void) { reductions *rp, *next; - FREE(reduction_table); + free(reduction_table); for (rp = first_reduction; rp; rp = next) { next = rp->next; - FREE(rp); + free(rp); } } diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c index dc3cba7bc73..6a574d24701 100644 --- a/usr.bin/yacc/reader.c +++ b/usr.bin/yacc/reader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reader.c,v 1.23 2012/04/15 12:44:38 chl Exp $ */ +/* $OpenBSD: reader.c,v 1.24 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: reader.c,v 1.5 1996/03/19 03:21:43 jtc Exp $ */ /* @@ -113,7 +113,7 @@ cachec(int c) if (cinc >= cache_size) { cache_size += 256; - cache = REALLOC(cache, cache_size); + cache = realloc(cache, cache_size); if (cache == NULL) no_space(); } cache[cinc] = c; @@ -130,7 +130,7 @@ get_line(void) if (saw_eof || (c = getc(f)) == EOF) { - if (line) { FREE(line); line = 0; } + if (line) { free(line); line = 0; } cptr = 0; saw_eof = 1; return; @@ -138,9 +138,9 @@ get_line(void) if (line == NULL || linesize != (LINESIZE + 1)) { - if (line) FREE(line); + if (line) free(line); linesize = LINESIZE + 1; - line = MALLOC(linesize); + line = malloc(linesize); if (line == NULL) no_space(); } @@ -153,7 +153,7 @@ get_line(void) if (++i >= linesize) { linesize += LINESIZE; - line = REALLOC(line, linesize); + line = realloc(line, linesize); if (line == 0) no_space(); } c = getc(f); @@ -176,7 +176,7 @@ dup_line(void) if (line == NULL) return (0); s = line; while (*s != '\n') ++s; - p = MALLOC(s - line + 1); + p = malloc(s - line + 1); if (p == NULL) no_space(); s = line; @@ -201,7 +201,7 @@ skip_comment(void) if (*s == '*' && s[1] == '/') { cptr = s + 2; - FREE(st_line); + free(st_line); return; } if (*s == '\n') @@ -422,7 +422,7 @@ loop: if (c == quote) { need_newline = 1; - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -474,7 +474,7 @@ loop: { putc('/', f); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -494,7 +494,7 @@ loop: { if (need_newline) putc('\n', f); ++cptr; - FREE(t_line); + free(t_line); return; } /* fall through */ @@ -552,7 +552,7 @@ loop: { fprintf(text_file, " YYSTYPE;\n"); fprintf(text_file, "#endif /* YYSTYPE_DEFINED */\n"); - FREE(u_line); + free(u_line); return; } goto loop; @@ -572,7 +572,7 @@ loop: if (dflag) putc(c, union_file); if (c == quote) { - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -634,7 +634,7 @@ loop: putc('/', text_file); if (dflag) putc('/', union_file); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -743,10 +743,10 @@ get_literal(void) } cachec(c); } - FREE(s_line); + free(s_line); n = cinc; - s = MALLOC(n); + s = malloc(n); if (s == NULL) no_space(); memcpy(s, cache, n); @@ -798,7 +798,7 @@ get_literal(void) bp->class = TERM; if (n == 1 && bp->value == UNDEFINED) bp->value = *(unsigned char *)s; - FREE(s); + free(s); return (bp); } @@ -879,7 +879,7 @@ get_tag(void) if (c == EOF) unexpected_EOF(); if (c != '>') illegal_tag(t_lineno, t_line, t_cptr); - FREE(t_line); + free(t_line); ++cptr; for (i = 0; i < ntags; ++i) @@ -892,12 +892,12 @@ get_tag(void) { tagmax += 16; tag_table = (char **) - (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *)) - : MALLOC(tagmax*sizeof(char *))); + (tag_table ? realloc(tag_table, tagmax*sizeof(char *)) + : malloc(tagmax*sizeof(char *))); if (tag_table == NULL) no_space(); } - s = MALLOC(cinc); + s = malloc(cinc); if (s == NULL) no_space(); strlcpy(s, cache, cinc); tag_table[ntags] = s; @@ -1066,7 +1066,7 @@ read_declarations(void) int c, k; cache_size = 256; - cache = MALLOC(cache_size); + cache = malloc(cache_size); if (cache == NULL) no_space(); for (;;) @@ -1119,22 +1119,22 @@ initialize_grammar(void) { nitems = 4; maxitems = 300; - pitem = (bucket **) CALLOC(maxitems, sizeof(bucket *)); + pitem = (bucket **) calloc(maxitems, sizeof(bucket *)); if (pitem == NULL) no_space(); nrules = 3; maxrules = 100; - plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *)); + plhs = (bucket **) malloc(maxrules*sizeof(bucket *)); if (plhs == NULL) no_space(); plhs[0] = 0; plhs[1] = 0; plhs[2] = 0; - rprec = (short *) MALLOC(maxrules*sizeof(short)); + rprec = (short *) malloc(maxrules*sizeof(short)); if (rprec == NULL) no_space(); rprec[0] = 0; rprec[1] = 0; rprec[2] = 0; - rassoc = (char *) MALLOC(maxrules*sizeof(char)); + rassoc = (char *) malloc(maxrules*sizeof(char)); if (rassoc == NULL) no_space(); rassoc[0] = TOKEN; rassoc[1] = TOKEN; @@ -1147,7 +1147,7 @@ expand_items(void) { int olditems = maxitems; maxitems += 300; - pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *)); + pitem = (bucket **) realloc(pitem, maxitems*sizeof(bucket *)); if (pitem == NULL) no_space(); memset(pitem + olditems, 0, (maxitems - olditems)*sizeof(bucket *)); } @@ -1157,11 +1157,11 @@ void expand_rules(void) { maxrules += 100; - plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *)); + plhs = (bucket **) realloc(plhs, maxrules*sizeof(bucket *)); if (plhs == NULL) no_space(); - rprec = (short *) REALLOC(rprec, maxrules*sizeof(short)); + rprec = (short *) realloc(rprec, maxrules*sizeof(short)); if (rprec == NULL) no_space(); - rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char)); + rassoc = (char *) realloc(rassoc, maxrules*sizeof(char)); if (rassoc == NULL) no_space(); } @@ -1357,7 +1357,7 @@ loop: { fprintf(f, "yyval.%s", tag); ++cptr; - FREE(d_line); + free(d_line); goto loop; } else if (isdigit(c)) @@ -1365,7 +1365,7 @@ loop: i = get_number(); if (i > n) dollar_warning(d_lineno, i); fprintf(f, "yyvsp[%d].%s", i - n, tag); - FREE(d_line); + free(d_line); goto loop; } else if (c == '-' && isdigit(cptr[1])) @@ -1373,7 +1373,7 @@ loop: ++cptr; i = -get_number() - n; fprintf(f, "yyvsp[%d].%s", i, tag); - FREE(d_line); + free(d_line); goto loop; } else @@ -1444,7 +1444,7 @@ loop: case ';': if (depth > 0) goto loop; fprintf(f, "\nbreak;\n"); - FREE(a_line); + free(a_line); return; case '{': @@ -1454,7 +1454,7 @@ loop: case '}': if (--depth > 0) goto loop; fprintf(f, "\nbreak;\n"); - FREE(a_line); + free(a_line); return; case '\'': @@ -1471,7 +1471,7 @@ loop: putc(c, f); if (c == quote) { - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -1521,7 +1521,7 @@ loop: { putc('/', f); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -1628,9 +1628,9 @@ free_tags(void) for (i = 0; i < ntags; ++i) { assert(tag_table[i]); - FREE(tag_table[i]); + free(tag_table[i]); } - FREE(tag_table); + free(tag_table); } @@ -1643,7 +1643,7 @@ pack_names(void) name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */ for (bp = first_symbol; bp; bp = bp->next) name_pool_size += strlen(bp->name) + 1; - name_pool = MALLOC(name_pool_size); + name_pool = malloc(name_pool_size); if (name_pool == NULL) no_space(); strlcpy(name_pool, "$accept", name_pool_size); @@ -1654,7 +1654,7 @@ pack_names(void) p = t; s = bp->name; while ((*t++ = *s++)) continue; - FREE(bp->name); + free(bp->name); bp->name = p; } } @@ -1696,16 +1696,16 @@ pack_symbols(void) start_symbol = ntokens; nvars = nsyms - ntokens; - symbol_name = (char **) MALLOC(nsyms*sizeof(char *)); + symbol_name = (char **) malloc(nsyms*sizeof(char *)); if (symbol_name == NULL) no_space(); - symbol_value = (short *) MALLOC(nsyms*sizeof(short)); + symbol_value = (short *) malloc(nsyms*sizeof(short)); if (symbol_value == NULL) no_space(); - symbol_prec = (short *) MALLOC(nsyms*sizeof(short)); + symbol_prec = (short *) malloc(nsyms*sizeof(short)); if (symbol_prec == NULL) no_space(); - symbol_assoc = MALLOC(nsyms); + symbol_assoc = malloc(nsyms); if (symbol_assoc == NULL) no_space(); - v = (bucket **) MALLOC(nsyms*sizeof(bucket *)); + v = (bucket **) malloc(nsyms*sizeof(bucket *)); if (v == NULL) no_space(); v[0] = 0; @@ -1800,7 +1800,7 @@ pack_symbols(void) symbol_assoc[k] = v[i]->assoc; } - FREE(v); + free(v); } @@ -1810,15 +1810,15 @@ pack_grammar(void) int i, j; int assoc, prec; - ritem = (short *) MALLOC(nitems*sizeof(short)); + ritem = (short *) malloc(nitems*sizeof(short)); if (ritem == NULL) no_space(); - rlhs = (short *) MALLOC(nrules*sizeof(short)); + rlhs = (short *) malloc(nrules*sizeof(short)); if (rlhs == NULL) no_space(); - rrhs = (short *) MALLOC((nrules+1)*sizeof(short)); + rrhs = (short *) malloc((nrules+1)*sizeof(short)); if (rrhs == NULL) no_space(); - rprec = (short *) REALLOC(rprec, nrules*sizeof(short)); + rprec = (short *) realloc(rprec, nrules*sizeof(short)); if (rprec == NULL) no_space(); - rassoc = REALLOC(rassoc, nrules); + rassoc = realloc(rassoc, nrules); if (rassoc == NULL) no_space(); ritem[0] = -1; @@ -1859,8 +1859,8 @@ pack_grammar(void) } rrhs[i] = j; - FREE(plhs); - FREE(pitem); + free(plhs); + free(pitem); } diff --git a/usr.bin/yacc/symtab.c b/usr.bin/yacc/symtab.c index ba9e6dc5cd0..32a1143e5da 100644 --- a/usr.bin/yacc/symtab.c +++ b/usr.bin/yacc/symtab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: symtab.c,v 1.15 2012/04/10 09:08:50 chl Exp $ */ +/* $OpenBSD: symtab.c,v 1.16 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: symtab.c,v 1.4 1996/03/19 03:21:48 jtc Exp $ */ /* @@ -70,7 +70,7 @@ make_bucket(char *name) bucket *bp; assert(name); - bp = (bucket *) MALLOC(sizeof(bucket)); + bp = (bucket *) malloc(sizeof(bucket)); if (bp == 0) no_space(); bp->link = 0; bp->next = 0; @@ -115,7 +115,7 @@ create_symbol_table(void) { bucket *bp; - symbol_table = CALLOC(TABLE_SIZE, sizeof(bucket *)); + symbol_table = calloc(TABLE_SIZE, sizeof(bucket *)); if (symbol_table == NULL) no_space(); bp = make_bucket("error"); @@ -131,7 +131,7 @@ create_symbol_table(void) void free_symbol_table(void) { - FREE(symbol_table); + free(symbol_table); symbol_table = 0; } @@ -144,6 +144,6 @@ free_symbols(void) for (p = first_symbol; p; p = q) { q = p->next; - FREE(p); + free(p); } } diff --git a/usr.bin/yacc/verbose.c b/usr.bin/yacc/verbose.c index 4f39564ba64..b99f57a6df4 100644 --- a/usr.bin/yacc/verbose.c +++ b/usr.bin/yacc/verbose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: verbose.c,v 1.10 2009/10/27 23:59:50 deraadt Exp $ */ +/* $OpenBSD: verbose.c,v 1.11 2014/01/08 21:40:25 millert Exp $ */ /* $NetBSD: verbose.c,v 1.4 1996/03/19 03:21:50 jtc Exp $ */ /* @@ -55,12 +55,12 @@ verbose(void) if (!vflag) return; - null_rules = (short *) MALLOC(nrules*sizeof(short)); + null_rules = (short *) malloc(nrules*sizeof(short)); if (null_rules == 0) no_space(); fprintf(verbose_file, "\f\n"); for (i = 0; i < nstates; i++) print_state(i); - FREE(null_rules); + free(null_rules); if (nunused) log_unused();