From: Wolfgang Bumiller Date: Sat, 28 Apr 2012 10:51:44 +0000 (+0200) Subject: Get rid of ast_setfunc X-Git-Tag: 0.1-rc1~565 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e4a839df954d06da4721ded5192b4f1d27c52ee8;p=xonotic%2Fgmqcc.git Get rid of ast_setfunc --- diff --git a/ast.c b/ast.c index b296bac..a42b0fa 100644 --- a/ast.c +++ b/ast.c @@ -27,12 +27,10 @@ #include "gmqcc.h" #include "ast.h" -#define ast_setfunc(me, fn, what) ( *(void**)&((me)->fn) = what ) - #define ast_instantiate(T, ctx, destroyfn) \ T *self = (T*)mem_a(sizeof(T)); \ ast_node_init((ast_node*)self, ctx); \ - ast_setfunc(&((ast_node*)self)->node, destroy, destroyfn) + ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn; /* It must not be possible to get here. */ static void _ast_node_destroy(ast_node *self) @@ -53,7 +51,7 @@ static void ast_node_init(ast_node *self, lex_ctx ctx) static void ast_expression_init(ast_expression *self, ast_expression_codegen *codegen) { - ast_setfunc(&self->expression, codegen, codegen); + self->expression.codegen = codegen; } ast_value* ast_value_new(lex_ctx ctx, const char *name, int t, bool keep)