mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
Get rid of ast_setfunc
This commit is contained in:
parent
b4caecf088
commit
e4a839df95
1 changed files with 2 additions and 4 deletions
6
ast.c
6
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)
|
||||
|
|
Loading…
Reference in a new issue