summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_macro.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-09-17 12:12:34 +0200
committerMichal Krol <michal@vmware.com>2009-09-17 12:12:34 +0200
commitce8f486156f5c4b28b51954ea862675275c38f6d (patch)
tree246d6a675c01d4350de0f8cd8d8622ea60311713 /src/glsl/pp/sl_pp_macro.c
parent0ddf41d34d511b339e0bb5a59673765f1bf0b3a5 (diff)
slang/pp: Use a dictionary for the remaining string literals.
Diffstat (limited to 'src/glsl/pp/sl_pp_macro.c')
-rw-r--r--src/glsl/pp/sl_pp_macro.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c
index 7793562781..6772100847 100644
--- a/src/glsl/pp/sl_pp_macro.c
+++ b/src/glsl/pp/sl_pp_macro.c
@@ -124,7 +124,6 @@ sl_pp_macro_expand(struct sl_pp_context *context,
int mute)
{
int macro_name;
- const char *macro_str;
struct sl_pp_macro *macro = NULL;
struct sl_pp_macro *actual_arg = NULL;
unsigned int j;
@@ -135,23 +134,22 @@ sl_pp_macro_expand(struct sl_pp_context *context,
}
macro_name = input[*pi].data.identifier;
- macro_str = sl_pp_context_cstr(context, macro_name);
- if (!strcmp(macro_str, "__LINE__")) {
+ if (macro_name == context->dict.___LINE__) {
if (!mute && _out_number(context, state, context->line)) {
return -1;
}
(*pi)++;
return 0;
}
- if (!strcmp(macro_str, "__FILE__")) {
+ if (macro_name == context->dict.___FILE__) {
if (!mute && _out_number(context, state, context->file)) {
return -1;
}
(*pi)++;
return 0;
}
- if (!strcmp(macro_str, "__VERSION__")) {
+ if (macro_name == context->dict.__VERSION__) {
if (!mute && _out_number(context, state, 110)) {
return -1;
}