From a2306446c86b3333e69b082e41ae76ba71a42d9d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Mar 2011 13:57:13 -0700 Subject: Optimize common objects, and adjust other objects accordingly. Major changes still need to be made to each of the servers. --- src/map/magic-interpreter-parser.y | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/map/magic-interpreter-parser.y') diff --git a/src/map/magic-interpreter-parser.y b/src/map/magic-interpreter-parser.y index 8484902..c5ee41d 100644 --- a/src/map/magic-interpreter-parser.y +++ b/src/map/magic-interpreter-parser.y @@ -224,13 +224,13 @@ semicolons : /* empty */ proc_formals_list : /* empty */ - { $$ = aCalloc(sizeof(proc_t), 1); } + { CREATE ($$, proc_t, 1); } | proc_formals_list_ne { $$ = $1; } ; proc_formals_list_ne : ID - { $$ = aCalloc(sizeof(proc_t), 1); + { CREATE ($$, proc_t, 1); $$->args_nr = 1; $$->args = malloc(sizeof(int)); $$->args[0] = intern_id($1); @@ -414,7 +414,7 @@ arg_list : /* empty */ arg_list_ne : expr - { $$.args = aCalloc(sizeof(expr_t *), 1); + { CREATE($$.args, expr_t *, 1); $$.args_nr = 1; $$.args[0] = $1; } @@ -452,7 +452,7 @@ area : location spelldef : spellbody_list { $$ = new_spell($1); } | LET defs IN spellbody_list - { $$ = new_spell($4); + { $$ = new_spell($4); $$->letdefs_nr = $2.letdefs_nr; $$->letdefs = $2.letdefs; $$->spellguard = $4; @@ -693,7 +693,7 @@ effect_list : /* empty */ | effect semicolons effect_list { $$ = set_effect_continuation($1, $3); } ; - + %% @@ -743,7 +743,7 @@ add_spell(spell_t *spell, int line_nr) magic_conf.spells = realloc(magic_conf.spells, magic_conf.spells_nr * sizeof (spell_t*)); magic_conf.spells[index] = spell; - + } static void @@ -867,7 +867,7 @@ spellguard_implication(spellguard_t *a, spellguard_t *b) spellguard_implication(a->next, b); else a->next = b; - + return retval; } -- cgit v1.2.3-60-g2f50