herdsman pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d79a1ade6c005b778b18b5b065cec5ad3885098b

commit d79a1ade6c005b778b18b5b065cec5ad3885098b
Author: Daniel Hirt <daniel.h...@samsung.com>
Date:   Sun Feb 14 14:20:34 2016 +0200

    Evas textblock: ifdef unused 'hyphens' code
    
    The usage of the 'hyphens' array is only relevant when
    "--enable-hyphen" is used.
    This fixes the dead code addressed in
    5b083ace84ca91496810cd1826c9469a6c741700.
---
 src/lib/evas/canvas/evas_object_textblock.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 841918b..79e6754 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -4537,13 +4537,14 @@ _layout_get_hyphenationwrap(Ctxt *c, 
Evas_Object_Textblock_Format *fmt,
 
                   if (word_len >= 4)
                     {
-                       char *hyphens = NULL;
                        size_t hyphen_off;
                        size_t i = 0;
                        size_t pos = 0;
 
 #ifdef HAVE_HYPHEN
-                       hyphens = _layout_wrap_hyphens_get(str, 
it->format->font.fdesc->lang, word_start, word_len);
+                       char *hyphens = _layout_wrap_hyphens_get(
+                             str, it->format->font.fdesc->lang,
+                             word_start, word_len);
 #endif
 
                        /* This only happens one time, if the cutoff is in
@@ -4563,18 +4564,23 @@ _layout_get_hyphenationwrap(Ctxt *c, 
Evas_Object_Textblock_Format *fmt,
 
                        for (i = hyphen_off, pos = word_end ; pos > word_start 
; i--, pos--)
                          {
-                            if ((hyphens && (hyphens[i] & 1)) || str[pos] == 
SHY_HYPHEN)
+                            if (
+#ifdef HAVE_HYPHEN
+                                  (hyphens && (hyphens[i] & 1)) ||
+#endif
+                                  (str[pos] == SHY_HYPHEN))
                               {
                                  found_hyphen = EINA_TRUE;
                                  break;
                               }
                          }
 
+#ifdef HAVE_HYPHEN
                        if (hyphens)
                          {
                             free(hyphens);
-                            hyphens = NULL;
                          }
+#endif
 
                        /* Rejecting sequences smaller than 2 characters.
                         * This also works with 'i' initialized to 0 */

-- 


Reply via email to