Commit a7d2f5e1c0b8e3636a93d9e9e0b1a22457b98faa

Werner Lemberg 2002-02-19T01:12:23

* src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused variables. * src/autohint/ahhint.c (ah_align_serif_edge): Use FT_UNUSED instead of UNUSED. * src/autohint/ahmodule.c (ft_autohinter_reset): Ditto. * src/pshinter/pshrec.c (ps_mask_table_merge): Fix typo in variable swapping code. * src/pshinter/pshglob.h (PSH_Blue_Align): Add PSH_BLUE_ALIGN_NONE. * src/pshinter/pshglob.c (psh_blues_snap_stem): Use it. * src/pshinter/pshalgo1.c (psh1_hint_table_optimize): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_align): Ditto. * include/freetype/internal/ftobjs.h (UNUSED): Removed.

diff --git a/ChangeLog b/ChangeLog
index 8132b99..403c5ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-02-18  Werner Lemberg  <wl@gnu.org>
+
+	* src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused
+	variables.
+	* src/autohint/ahhint.c (ah_align_serif_edge): Use FT_UNUSED instead
+	of UNUSED.
+	* src/autohint/ahmodule.c (ft_autohinter_reset): Ditto.
+	* src/pshinter/pshrec.c (ps_mask_table_merge): Fix typo in variable
+	swapping code.
+	* src/pshinter/pshglob.h (PSH_Blue_Align): Add PSH_BLUE_ALIGN_NONE.
+	* src/pshinter/pshglob.c (psh_blues_snap_stem): Use it.
+	* src/pshinter/pshalgo1.c (psh1_hint_table_optimize): Ditto.
+	* src/pshinter/pshalgo2.c (psh2_hint_align): Ditto.
+	* include/freetype/internal/ftobjs.h (UNUSED): Removed.
+
 2002-02-10  Roberto Alameda  <ojancano@geekmail.de>
 
 	Add support for ISOLatin1 PS encoding.
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index 4fa7e8b..ce20cf6 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -71,8 +71,8 @@ FT_BEGIN_HEADER
 #define FT_ALIGNMENT  8
 
 
-  /* UNUSED is a macro used to indicate that a given parameter is not used */
-  /* -- this is only used to get rid of unpleasant compiler warnings       */
+  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
+  /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
 #define FT_UNUSED( arg )  ( (arg) = (arg) )
 #endif
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 8b7525c..f5e5e64 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -71,8 +71,8 @@ FT_BEGIN_HEADER
 #define FT_ALIGNMENT  8
 
 
-  /* UNUSED is a macro used to indicate that a given parameter is not used */
-  /* -- this is only used to get rid of unpleasant compiler warnings       */
+  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
+  /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
 #define FT_UNUSED( arg )  ( (arg) = (arg) )
 #endif
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index f990c90..9d6d8fb 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -86,8 +86,8 @@ FT_BEGIN_HEADER
 #define FT_ALIGNMENT  8
 
 
-  /* UNUSED is a macro used to indicate that a given parameter is not used */
-  /* -- this is only used to get rid of unpleasant compiler warnings       */
+  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
+  /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
 #define FT_UNUSED( arg )  ( (arg) = (arg) )
 #endif
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 31b79c0..755faf8 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -54,10 +54,6 @@ FT_BEGIN_HEADER
 #define NULL  (void*)0
 #endif
 
-#ifndef UNUSED
-#define UNUSED( arg )  ( (arg)=(arg) )
-#endif
-
 
   /*************************************************************************/
   /*                                                                       */
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 756db65..49da901 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -976,12 +976,8 @@
               FT_Pos  min = seg1->min_coord;
               FT_Pos  max = seg1->max_coord;
               FT_Pos  len, dist, score;
-              FT_Pos  size1, size2;
 
 
-              size1 = max - min;
-              size2 = seg2->max_coord - seg2->min_coord;
-
               if ( min < seg2->min_coord )
                 min = seg2->min_coord;
 
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 1c212a0..5c02589 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -158,7 +158,7 @@
     FT_Pos  dist;
     FT_Pos  sign = 1;
 
-    UNUSED( hinter );
+    FT_UNUSED( hinter );
 
 
     dist = serif->opos - base->opos;
diff --git a/src/autohint/ahmodule.c b/src/autohint/ahmodule.c
index 1b9b188..f8d54b9 100644
--- a/src/autohint/ahmodule.c
+++ b/src/autohint/ahmodule.c
@@ -79,7 +79,7 @@
   ft_autohinter_reset( FT_AutoHinter  module,
                        FT_Face        face )
   {
-    UNUSED( module );
+    FT_UNUSED( module );
 
     if ( face->autohint.data )
       ah_hinter_done_face_globals( (AH_Face_Globals*)(face->autohint.data) );
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 54d06ab..bd334aa 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -360,8 +360,8 @@
 
       for ( i = 0; i < cache->size; i++ )
       {
-        FTC_Node   node, next, *pnode;
-        FT_UFast   hash;
+        FTC_Node  node, next, *pnode;
+        FT_UFast  hash;
 
 
         node = cache->buckets[i];
diff --git a/src/pshinter/pshalgo1.c b/src/pshinter/pshalgo1.c
index b8e8e1f..a31d829 100644
--- a/src/pshinter/pshalgo1.c
+++ b/src/pshinter/pshalgo1.c
@@ -415,7 +415,7 @@
           hint->cur_len = fit_len;
 
           /* check blue zones for horizontal stems */
-          align.align     = 0;
+          align.align     = PSH_BLUE_ALIGN_NONE;
           align.align_bot = align.align_top = 0;
           if ( !vertical )
           {
diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c
index af30cdd..27ee5c1 100644
--- a/src/pshinter/pshalgo2.c
+++ b/src/pshinter/pshalgo2.c
@@ -387,7 +387,7 @@
       hint->cur_len = fit_len;
 
       /* check blue zones for horizontal stems */
-      align.align = 0;
+      align.align = PSH_BLUE_ALIGN_NONE;
       align.align_bot = align.align_top = 0;
 
       if ( dimension == 1 )
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index db89890..49fb843 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -493,7 +493,7 @@
     FT_Int          no_shoots;
 
 
-    alignment->align = 0;
+    alignment->align = PSH_BLUE_ALIGN_NONE;
 
     no_shoots = blues->no_overshoots;
 
diff --git a/src/pshinter/pshglob.h b/src/pshinter/pshglob.h
index 1058fb1..157cb23 100644
--- a/src/pshinter/pshglob.h
+++ b/src/pshinter/pshglob.h
@@ -143,6 +143,7 @@ FT_BEGIN_HEADER
 
   typedef enum
   {
+    PSH_BLUE_ALIGN_NONE = 0,
     PSH_BLUE_ALIGN_TOP = 1,
     PSH_BLUE_ALIGN_BOT = 2
 
diff --git a/src/pshinter/pshrec.c b/src/pshinter/pshrec.c
index 7839505..c54ed06 100644
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -414,7 +414,7 @@
     {
       temp   = index1;
       index1 = index2;
-      index2 = index1;
+      index2 = temp;
     }
 
     if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks )
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 8157a68..7b2a0f6 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1087,7 +1087,7 @@
 
         if ( num_subglyphs > 0               &&
              loader->exec                    &&
-             ins_pos         > 0             &&
+             ins_pos > 0                     &&
              subglyph->flags & WE_HAVE_INSTR )
         {
           FT_UShort       n_ins;