Commit 231171fc3ae2ef023aac33ee43c98de6a0d2bff8

Werner Lemberg 2014-06-17T09:14:32

Partially revert commit from 2014-06-13. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Move declaration of `p_first' and `p_last' out of the loop.

diff --git a/ChangeLog b/ChangeLog
index 0961650..54607b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2014-06-17  Werner Lemberg  <wl@gnu.org>
 
+	Partially revert commit from 2014-06-13.
+
+	* src/autofit/aflatin.c (af_latin_metrics_init_blues): Move
+	declaration of `p_first' and `p_last' out of the loop.
+
+2014-06-17  Werner Lemberg  <wl@gnu.org>
+
 	* builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/.
 
 	This simplifies cross-compiling.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 17f8844..a1f2b33 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -536,6 +536,13 @@
               FT_Int   last;
               FT_Bool  hit;
 
+              /* we intentionally declare these two variables        */
+              /* outside of the loop since various compilers emit    */
+              /* incorrect warning messages otherwise, talking about */
+              /* `possibly uninitialized variables'                  */
+              FT_Int  p_first = 0;            /* make compiler happy */
+              FT_Int  p_last  = 0;
+
               FT_Bool  left2right;
 
 
@@ -568,8 +575,6 @@
               {
                 FT_Bool  l2r;
                 FT_Pos   d;
-                FT_Int   p_first = 0; /* make compiler happy */
-                FT_Int   p_last  = 0;
 
 
                 if ( !hit )