From: Dale Weiler Date: Wed, 17 Apr 2013 11:02:42 +0000 (+0000) Subject: Some inline never hurt anyone .. actually, C made a bad decision in it's design,... X-Git-Tag: before-library~47 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dc7e18ec73927a3030519e3187fd3500f6d8a44c;p=xonotic%2Fgmqcc.git Some inline never hurt anyone .. actually, C made a bad decision in it's design, everything should've always been implicitly inline, since most code back in the day was small, if you had large bodies, there should've been an 'outline' keyword for that instead :P --- diff --git a/ftepp.c b/ftepp.c index 320afc8..8034665 100644 --- a/ftepp.c +++ b/ftepp.c @@ -227,7 +227,7 @@ static pptoken *pptoken_make(ftepp_t *ftepp) return token; } -static void pptoken_delete(pptoken *self) +static GMQCC_INLINE void pptoken_delete(pptoken *self) { mem_d(self->value); mem_d(self); @@ -269,7 +269,7 @@ static ftepp_t* ftepp_new() return ftepp; } -static void ftepp_flush_do(ftepp_t *self) +static GMQCC_INLINE void ftepp_flush_do(ftepp_t *self) { vec_free(self->output_string); } @@ -282,13 +282,6 @@ static void ftepp_delete(ftepp_t *self) if (self->includename) vec_free(self->includename); - /* - for (i = 0; i < vec_size(self->macros); ++i) - ppmacro_delete(self->macros[i]); - - vec_free(self->macros); -*/ - util_htrem(self->macros, (void (*)(void*))&ppmacro_delete); vec_free(self->conditions); @@ -309,7 +302,7 @@ static void ftepp_out(ftepp_t *ftepp, const char *str, bool ignore_cond) } } -static void ftepp_update_output_condition(ftepp_t *ftepp) +static GMQCC_INLINE void ftepp_update_output_condition(ftepp_t *ftepp) { size_t i; ftepp->output_on = true; @@ -317,12 +310,12 @@ static void ftepp_update_output_condition(ftepp_t *ftepp) ftepp->output_on = ftepp->output_on && ftepp->conditions[i].on; } -static ppmacro* ftepp_macro_find(ftepp_t *ftepp, const char *name) +static GMQCC_INLINE ppmacro* ftepp_macro_find(ftepp_t *ftepp, const char *name) { return util_htget(ftepp->macros, name); } -static void ftepp_macro_delete(ftepp_t *ftepp, const char *name) +static GMQCC_INLINE void ftepp_macro_delete(ftepp_t *ftepp, const char *name) { util_htrm(ftepp->macros, name, NULL); }