Fix shaper_list manipulation, aaaaaaaaaaaaargh

This commit is contained in:
Behdad Esfahbod 2011-08-07 03:43:46 -04:00
parent 206e329345
commit ff199ba356
1 changed files with 9 additions and 7 deletions

View File

@ -78,7 +78,7 @@ static struct static_shaper_list_t
} }
unsigned int count = 3; /* initial, fallback, null */ unsigned int count = 3; /* initial, fallback, null */
for (const char *p = env; (p == strchr (p, ',')) && p++; ) for (const char *p = env; (p = strchr (p, ',')) && p++; )
count++; count++;
unsigned int len = strlen (env); unsigned int len = strlen (env);
@ -95,7 +95,7 @@ static struct static_shaper_list_t
count = 0; count = 0;
shaper_list[count++] = buffer; shaper_list[count++] = buffer;
for (char *p = buffer; (p == strchr (p, ',')) && (*p = '\0', TRUE) && p++; ) for (char *p = buffer; (p = strchr (p, ',')) && (*p = '\0', TRUE) && p++; )
shaper_list[count++] = p; shaper_list[count++] = p;
shaper_list[count++] = "fallback"; shaper_list[count++] = "fallback";
shaper_list[count] = NULL; shaper_list[count] = NULL;
@ -136,11 +136,13 @@ hb_shape_full (hb_font_t *font,
} else { } else {
while (*shaper_list) { while (*shaper_list) {
for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++) for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++)
if (0 == strcmp (*shaper_list, shapers[i].name) && if (0 == strcmp (*shaper_list, shapers[i].name)) {
likely (shapers[i].func (font, buffer, if (likely (shapers[i].func (font, buffer,
features, num_features, features, num_features,
shaper_options))) shaper_options)))
return TRUE; return TRUE;
break;
}
shaper_list++; shaper_list++;
} }
} }