Commit 87628724a9a5d4e1caf5574a2a32f0c205445770

Sean McBride 2014-03-18T08:39:35

Fix clang warnings. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize some variables. * src/base/ftcalc.c (FT_MulFix): Only use code if `FT_MULFIX_INLINED' is not defined. * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c (ftc_basic_image_family_class, ftc_basic_image_cache_class, ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class), src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make function static. * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant code.

diff --git a/ChangeLog b/ChangeLog
index 56b77d7..e19d2db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2014-03-18  Sean McBride  <sean@rogue-research.com>
+	    Werner Lemberg  <wl@gnu.org>
+
+	Fix clang warnings.
+
+	* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
+	some variables.
+
+	* src/base/ftcalc.c (FT_MulFix): Only use code if
+	`FT_MULFIX_INLINED' is not defined.
+
+	* src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c
+	(ftc_basic_image_family_class, ftc_basic_image_cache_class,
+	ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class),
+	src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c
+	(ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c
+	(pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make
+	function static.
+
+	* src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant
+	code.
+
 2014-03-17  Werner Lemberg  <wl@gnu.org>
 
 	Fix Savannah bug #41869.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index e3a7742..678b7c9 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -552,7 +552,8 @@
               {
                 FT_Bool  l2r;
                 FT_Pos   d;
-                FT_Int   p_first, p_last;
+                FT_Int   p_first = 0; /* pacify clang compiler */
+                FT_Int   p_last  = 0;
 
 
                 if ( !hit )
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 6e65583..654bef2 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -39,9 +39,6 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
-#ifdef FT_MULFIX_INLINED
-#undef FT_MulFix
-#endif
 
 /* we need to emulate a 64-bit data type if a real one isn't available */
 
@@ -203,6 +200,8 @@
 
   /* documentation is in freetype.h */
 
+#ifndef FT_MULFIX_INLINED
+
   FT_EXPORT_DEF( FT_Long )
   FT_MulFix( FT_Long  a,
              FT_Long  b )
@@ -236,6 +235,8 @@
 #endif /* FT_MULFIX_ASSEMBLER */
   }
 
+#endif /* FT_MULFIX_INLINED */
+
 
   /* documentation is in freetype.h */
 
@@ -447,6 +448,8 @@
 
   /* documentation is in freetype.h */
 
+#ifndef FT_MULFIX_INLINED
+
   FT_EXPORT_DEF( FT_Long )
   FT_MulFix( FT_Long  a,
              FT_Long  b )
@@ -545,6 +548,8 @@
 
   }
 
+#endif /* FT_MULFIX_INLINED */
+
 
   /* documentation is in freetype.h */
 
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 5a1c296..d7649ab 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -182,7 +182,7 @@ THE SOFTWARE.
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_CMap_ClassRec  bdf_cmap_class =
   {
     sizeof ( BDF_CMapRec ),
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index 84d336d..01be88c 100644
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType basic cache interface (body).                           */
 /*                                                                         */
-/*  Copyright 2003-2007, 2009-2011, 2013 by                                */
+/*  Copyright 2003-2007, 2009-2011, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -229,7 +229,7 @@
   *
   */
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_IFamilyClassRec  ftc_basic_image_family_class =
   {
     {
@@ -243,7 +243,7 @@
   };
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_GCacheClassRec  ftc_basic_image_cache_class =
   {
     {
@@ -415,7 +415,7 @@
    *
    */
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_SFamilyClassRec  ftc_basic_sbit_family_class =
   {
     {
@@ -430,7 +430,7 @@
   };
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_GCacheClassRec  ftc_basic_sbit_cache_class =
   {
     {
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 848349b..b2e9609 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
-/*  Copyright 2000-2013 by                                                 */
+/*  Copyright 2000-2014 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -202,7 +202,7 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_CacheClassRec  ftc_cmap_cache_class =
   {
     ftc_cmap_node_new,
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index 4eb2c5b..a65f94d 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2006, 2008-2010, 2013 by                                */
+/*  Copyright 2000-2006, 2008-2010, 2013, 2014 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -151,7 +151,7 @@
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_MruListClassRec  ftc_size_list_class =
   {
     sizeof ( FTC_SizeNodeRec ),
@@ -290,7 +290,7 @@
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FTC_MruListClassRec  ftc_face_list_class =
   {
     sizeof ( FTC_FaceNodeRec),
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index 748cbca..5183f6f 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf files
 
-    Copyright (C) 2000-2004, 2006-2011, 2013 by
+    Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -189,7 +189,7 @@ THE SOFTWARE.
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_CMap_ClassRec  pcf_cmap_class =
   {
     sizeof ( PCF_CMapRec ),
diff --git a/src/pfr/pfrdrivr.c b/src/pfr/pfrdrivr.c
index 4c43947..188aa0d 100644
--- a/src/pfr/pfrdrivr.c
+++ b/src/pfr/pfrdrivr.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
-/*  Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013 by                   */
+/*  Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013, 2014 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -134,7 +134,7 @@
   }
 
 
-  FT_CALLBACK_TABLE_DEF
+  static
   const FT_Service_PfrMetricsRec  pfr_metrics_service_rec =
   {
     pfr_get_metrics,
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index 697288d..2602bdb 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 driver interface (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013 by                   */
+/*  Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013, 2014 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -557,9 +557,6 @@
       if ( value && value_len >= retval )
         *((FT_Long *)value) = type1->font_info.italic_angle;
       break;
-
-    default:
-      break;
     }
 
     return retval;