From: Dale Weiler Date: Tue, 23 Apr 2013 22:50:47 +0000 (+0000) Subject: Make it compile as C++ code too X-Git-Tag: before-library~19^2~1 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=10738da2fb1b72adf1d29cc397b8a0fc836fdea9 Make it compile as C++ code too --- diff --git a/ftepp.c b/ftepp.c index 9d0fed9..233dee5 100644 --- a/ftepp.c +++ b/ftepp.c @@ -312,7 +312,7 @@ static GMQCC_INLINE void ftepp_update_output_condition(ftepp_t *ftepp) static GMQCC_INLINE ppmacro* ftepp_macro_find(ftepp_t *ftepp, const char *name) { - return util_htget(ftepp->macros, name); + return (ppmacro*)util_htget(ftepp->macros, name); } static GMQCC_INLINE void ftepp_macro_delete(ftepp_t *ftepp, const char *name) diff --git a/intrin.h b/intrin.h index 4b4c947..4f672dd 100644 --- a/intrin.h +++ b/intrin.h @@ -404,7 +404,7 @@ ast_expression *intrin_func(parser_t *parser, const char *name) { if ((find = (void*)parser_find_global(parser, name)) && ((ast_value*)find)->expression.vtype == TYPE_FUNCTION) for (i = 0; i < vec_size(parser->functions); ++i) if (((ast_value*)find)->name && !strcmp(parser->functions[i]->name, ((ast_value*)find)->name) && parser->functions[i]->builtin < 0) - return find; + return (ast_expression*)find; if ((find = util_htget(intrin_intrinsics(), name))) { /* intrinsic is in table. This will "generate the function" so diff --git a/parser.c b/parser.c index b3e9882..86c336a 100644 --- a/parser.c +++ b/parser.c @@ -257,7 +257,7 @@ static ast_value* parser_const_string(parser_t *parser, const char *str, bool do { size_t hash = util_hthash(parser->ht_imm_string, str); ast_value *out; - if ( (out = util_htgeth(parser->ht_imm_string, str, hash)) ) { + if ( (out = (ast_value*)util_htgeth(parser->ht_imm_string, str, hash)) ) { if (dotranslate && out->name[0] == '#') { char name[32]; snprintf(name, sizeof(name), "dotranslate_%lu", (unsigned long)(parser->translated++));