mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-17 15:18:21 +02:00
glsl/pp: Add 0' and 1' to dictionary.
This commit is contained in:
parent
32966991c6
commit
2f89e1a5a1
3 changed files with 7 additions and 8 deletions
|
|
@ -79,5 +79,8 @@ sl_pp_dict_init(struct sl_pp_context *context)
|
|||
|
||||
ADD_NAME(context, version);
|
||||
|
||||
ADD_NAME_STR(context, _0, "0");
|
||||
ADD_NAME_STR(context, _1, "1");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ struct sl_pp_dict {
|
|||
int undef;
|
||||
|
||||
int version;
|
||||
|
||||
int _0;
|
||||
int _1;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,7 @@ _parse_defined(struct sl_pp_context *context,
|
|||
}
|
||||
|
||||
result.token = SL_PP_UINT;
|
||||
if (defined) {
|
||||
result.data._uint = sl_pp_context_add_unique_str(context, "1");
|
||||
} else {
|
||||
result.data._uint = sl_pp_context_add_unique_str(context, "0");
|
||||
}
|
||||
if (result.data._uint == -1) {
|
||||
return -1;
|
||||
}
|
||||
result.data._uint = (defined ? context->dict._1 : context->dict._0);
|
||||
|
||||
if (sl_pp_process_out(state, &result)) {
|
||||
strcpy(context->error_msg, "out of memory");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue