for (i = 0; i < TGSI_FILE_COUNT; i++) {
const char *cur = *pcur;
- if (str_match_nocase_whole( &cur, tgsi_file_names[i] )) {
+ if (str_match_nocase_whole( &cur, tgsi_file_name(i) )) {
*pcur = cur;
*file = i;
return TRUE;
cur2 = cur;
cur2++;
eat_opt_white( &cur2 );
- if (str_match_nocase_whole( &cur2, "ARRAY(" )) {
+ if (str_match_nocase_whole( &cur2, "ARRAY" )) {
int arrayid;
+ if (*cur2 != '(') {
+ report_error( ctx, "Expected `('" );
+ return FALSE;
+ }
+ cur2++;
eat_opt_white( &cur2 );
if (!parse_int( &cur2, &arrayid )) {
report_error( ctx, "Expected `,'" );
}
eat_opt_white( &cur2 );
if (*cur2 != ')') {
- report_error( ctx, "Expected `,'" );
+ report_error( ctx, "Expected `)'" );
return FALSE;
}
+ cur2++;
decl.Declaration.Array = 1;
decl.Array.ArrayID = arrayid;
- cur = cur2;
+ ctx->cur = cur = cur2;
}
}
struct tgsi_token *tokens,
uint num_tokens )
{
- struct translate_ctx ctx;
+ struct translate_ctx ctx = {0};
ctx.text = text;
ctx.cur = text;