From ce8f486156f5c4b28b51954ea862675275c38f6d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 12:12:34 +0200 Subject: slang/pp: Use a dictionary for the remaining string literals. --- src/glsl/pp/sl_pp_if.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/glsl/pp/sl_pp_if.c') diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index 44bbefa357..cf1c746d5f 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -136,20 +136,16 @@ _parse_if(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - { - const char *id = sl_pp_context_cstr(context, input[i].data.identifier); - - if (!strcmp(id, "defined")) { - i++; - if (_parse_defined(context, input, &i, &state)) { - free(state.out); - return -1; - } - } else { - if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { - free(state.out); - return -1; - } + if (input[i].data.identifier == context->dict.defined) { + i++; + if (_parse_defined(context, input, &i, &state)) { + free(state.out); + return -1; + } + } else { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + free(state.out); + return -1; } } break; -- cgit v1.2.3