From: Wolfgang (Blub) Bumiller Date: Fri, 27 Apr 2012 11:32:52 +0000 (+0200) Subject: ast_value_set_name to return bool X-Git-Tag: 0.1-rc1~581 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=ce43a35307757c97f1bba2d89cb1729c580eba89;hp=e4d92130dac65e6850fa91e712c41e4b013283ca;p=xonotic%2Fgmqcc.git ast_value_set_name to return bool --- diff --git a/ast.c b/ast.c index f42a2fa..35e72eb 100644 --- a/ast.c +++ b/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, diff --git a/ast.h b/ast.h index ec46c9f..00922d6 100644 --- a/ast.h +++ b/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**);