mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
ast_value_set_name to return bool
This commit is contained in:
parent
e4d92130da
commit
ce43a35307
2 changed files with 3 additions and 2 deletions
3
ast.c
3
ast.c
|
@ -102,11 +102,12 @@ void ast_value_delete(ast_value* self)
|
|||
mem_d(self);
|
||||
}
|
||||
|
||||
void ast_value_set_name(ast_value *self, const char *name)
|
||||
bool ast_value_set_name(ast_value *self, const char *name)
|
||||
{
|
||||
if (self->name)
|
||||
mem_d((void*)self->name);
|
||||
self->name = util_strdup(name);
|
||||
return !!self->name;
|
||||
}
|
||||
|
||||
ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
|
||||
|
|
2
ast.h
2
ast.h
|
@ -111,7 +111,7 @@ struct ast_value_s
|
|||
ast_value* ast_value_new(lex_ctx_t ctx, const char *name, int qctype, bool keep);
|
||||
void ast_value_delete(ast_value*);
|
||||
|
||||
void ast_value_set_name(ast_value*, const char *name);
|
||||
bool ast_value_set_name(ast_value*, const char *name);
|
||||
|
||||
bool ast_value_codegen(ast_value*, ast_function*, ir_value**);
|
||||
|
||||
|
|
Loading…
Reference in a new issue