diff options
author | Michal Krol <[email protected]> | 2009-09-17 12:12:34 +0200 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-09-17 12:12:34 +0200 |
commit | ce8f486156f5c4b28b51954ea862675275c38f6d (patch) | |
tree | 246d6a675c01d4350de0f8cd8d8622ea60311713 /src/glsl/pp/sl_pp_if.c | |
parent | 0ddf41d34d511b339e0bb5a59673765f1bf0b3a5 (diff) |
slang/pp: Use a dictionary for the remaining string literals.
Diffstat (limited to 'src/glsl/pp/sl_pp_if.c')
-rw-r--r-- | src/glsl/pp/sl_pp_if.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index 44bbefa3577..cf1c746d5f6 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; |