evas/language: #ifdef guard variable which is only used inside #ifdef

Summary:
this variable is already only changed inside an #ifdef, so declare and
free it only inside the same ifdef for clarity

CIDs 1401016, 1400807

Reviewers: cedric

Reviewed By: cedric

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10320
This commit is contained in:
Mike Blumenkrantz 2019-10-11 09:42:24 -04:00
parent dd093de23c
commit 9d9aa8b6ae
1 changed files with 6 additions and 1 deletions

View File

@ -233,7 +233,9 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
EvasBiDiCharType *char_types = NULL;
EvasBiDiLevel *embedding_levels = NULL;
const FriBidiChar *ustr;
#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
FriBidiChar *base_ustr = NULL;
#endif
EvasBiDiLevel ret_level = 0;
#if FRIBIDI_MAJOR_VERSION >= 1
EvasBiDiBracketType *bracket_types = NULL;
@ -392,8 +394,9 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
free(bidi_props->char_types);
}
bidi_props->char_types = char_types;
#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
if (base_ustr) free(base_ustr);
#endif
#if FRIBIDI_MAJOR_VERSION >= 1
/* Currently, bracket_types is not reused in other places. */
if (bracket_types) free(bracket_types);
@ -408,7 +411,9 @@ cleanup:
if (bracket_types) free(bracket_types);
#endif
if (embedding_levels) free(embedding_levels);
#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL
if (base_ustr) free(base_ustr);
#endif
if (bidi_props) evas_bidi_paragraph_props_unref(bidi_props); /* Clean up the bidi props */
return NULL;
}