Fix uses of g_assert() around statements with side effects. (#115498,

Thu Jul 24 17:04:21 2003  Owen Taylor  <otaylor@redhat.com>

        * pango/opentype/pango-ot-ruleset.c (pango_ot_ruleset_shape):
        Fix uses of g_assert() around statements with side effects.
        (#115498, patch from David Cuthbert)
This commit is contained in:
Owen Taylor 2003-07-24 21:05:29 +00:00 committed by Owen Taylor
parent f91deef2c9
commit 07bad0e77c
1 changed files with 9 additions and 5 deletions

View File

@ -156,6 +156,7 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
{
int i;
int last_cluster;
int result;
TTO_GSUB gsub = NULL;
TTO_GPOS gpos = NULL;
@ -214,9 +215,11 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
if (!gsub && !gpos)
return;
g_assert (TT_GSUB_String_New (ruleset->info->face->memory,
&in_string) == FT_Err_Ok);
g_assert (TT_GSUB_String_Set_Length (in_string, glyphs->num_glyphs) == FT_Err_Ok);
result = TT_GSUB_String_New (ruleset->info->face->memory, &in_string);
g_assert (result == FT_Err_Ok);
result = TT_GSUB_String_Set_Length (in_string, glyphs->num_glyphs);
g_assert (result == FT_Err_Ok);
for (i = 0; i < glyphs->num_glyphs; i++)
{
@ -228,8 +231,9 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
if (gsub)
{
g_assert (TT_GSUB_String_New (ruleset->info->face->memory,
&out_string) == FT_Err_Ok);
result = TT_GSUB_String_New (ruleset->info->face->memory,
&out_string);
g_assert (result == FT_Err_Ok);
result_string = out_string;
TT_GSUB_Apply_String (gsub, in_string, out_string);