summaryrefslogtreecommitdiffstats
path: root/src/glsl/pp/sl_pp_process.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2009-09-17 12:12:34 +0200
committerMichal Krol <[email protected]>2009-09-17 12:12:34 +0200
commitce8f486156f5c4b28b51954ea862675275c38f6d (patch)
tree246d6a675c01d4350de0f8cd8d8622ea60311713 /src/glsl/pp/sl_pp_process.c
parent0ddf41d34d511b339e0bb5a59673765f1bf0b3a5 (diff)
slang/pp: Use a dictionary for the remaining string literals.
Diffstat (limited to 'src/glsl/pp/sl_pp_process.c')
-rw-r--r--src/glsl/pp/sl_pp_process.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c
index 03a3051838f..ab2f2d8eb45 100644
--- a/src/glsl/pp/sl_pp_process.c
+++ b/src/glsl/pp/sl_pp_process.c
@@ -100,14 +100,14 @@ sl_pp_process(struct sl_pp_context *context,
switch (input[i].token) {
case SL_PP_IDENTIFIER:
{
- const char *name;
+ int name;
int found_eol = 0;
unsigned int first;
unsigned int last;
struct sl_pp_token_info endof;
/* Directive name. */
- name = sl_pp_context_cstr(context, input[i].data.identifier);
+ name = input[i].data.identifier;
i++;
skip_whitespace(input, &i);
@@ -136,51 +136,51 @@ sl_pp_process(struct sl_pp_context *context,
last = i - 1;
- if (!strcmp(name, "if")) {
+ if (name == context->dict._if) {
if (sl_pp_process_if(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "ifdef")) {
+ } else if (name == context->dict.ifdef) {
if (sl_pp_process_ifdef(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "ifndef")) {
+ } else if (name == context->dict.ifndef) {
if (sl_pp_process_ifndef(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "elif")) {
+ } else if (name == context->dict.elif) {
if (sl_pp_process_elif(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "else")) {
+ } else if (name == context->dict._else) {
if (sl_pp_process_else(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "endif")) {
+ } else if (name == context->dict.endif) {
if (sl_pp_process_endif(context, input, first, last)) {
return -1;
}
} else if (context->if_value) {
- if (!strcmp(name, "define")) {
+ if (name == context->dict.define) {
if (sl_pp_process_define(context, input, first, last)) {
return -1;
}
- } else if (!strcmp(name, "error")) {
+ } else if (name == context->dict.error) {
sl_pp_process_error(context, input, first, last);
return -1;
- } else if (!strcmp(name, "extension")) {
+ } else if (name == context->dict.extension) {
if (sl_pp_process_extension(context, input, first, last, &state)) {
return -1;
}
- } else if (!strcmp(name, "line")) {
+ } else if (name == context->dict.line) {
if (sl_pp_process_line(context, input, first, last, &state)) {
return -1;
}
- } else if (!strcmp(name, "pragma")) {
+ } else if (name == context->dict.pragma) {
if (sl_pp_process_pragma(context, input, first, last, &state)) {
return -1;
}
- } else if (!strcmp(name, "undef")) {
+ } else if (name == context->dict.undef) {
if (sl_pp_process_undef(context, input, first, last)) {
return -1;
}