Commit a07029ef5f2faf13dd030b4af3f1ae6d0b02ac0e

Werner Lemberg 2015-03-02T06:54:08

Simplify `TYPEOF' macro. No need for two arguments. * include/config/ftconfig.h, builds/unix/ftconfig.in, builds/vms/ftconfig.h (TYPEOF): Updated. * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated.

diff --git a/ChangeLog b/ChangeLog
index 76d2168..e84215e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,16 @@
-2015-02-25  Werner Lemberg  <wl@gnu.org>
+2015-03-02  Werner Lemberg  <wl@gnu.org>
+
+	Simplify `TYPEOF' macro.
+
+	No need for two arguments.
+
+	* include/config/ftconfig.h, builds/unix/ftconfig.in,
+	builds/vms/ftconfig.h (TYPEOF): Updated.
+
+	* include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR),
+	src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated.
+
+2015-03-01  Werner Lemberg  <wl@gnu.org>
 
 	Various compiler warning fixes for `make multi'.
 
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index 47ca2da..b037ab4 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -366,9 +366,9 @@ FT_BEGIN_HEADER
 #if ( __GNUC__ >= 2                         || \
       defined( __IBM__TYPEOF__ )            || \
       ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
-#define TYPEOF( type, x )  (__typeof__ (type))(x)
+#define TYPEOF( type )  (__typeof__ (type))
 #else
-#define TYPEOF( type, x )  (x)
+#define TYPEOF( type )  /* empty */
 #endif
 
 
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 571c3e5..c809be6 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -309,9 +309,9 @@ FT_BEGIN_HEADER
 #if ( __GNUC__ >= 2                         || \
       defined( __IBM__TYPEOF__ )            || \
       ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
-#define TYPEOF( type, x )  (__typeof__ (type))(x)
+#define TYPEOF( type )  (__typeof__ (type))
 #else
-#define TYPEOF( type, x )  (x)
+#define TYPEOF( type )  /* empty */
 #endif
 
 
diff --git a/include/config/ftconfig.h b/include/config/ftconfig.h
index b9fbfe2..c89f709 100644
--- a/include/config/ftconfig.h
+++ b/include/config/ftconfig.h
@@ -336,9 +336,9 @@ FT_BEGIN_HEADER
 #if ( __GNUC__ >= 2                         || \
       defined( __IBM__TYPEOF__ )            || \
       ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
-#define TYPEOF( type, x )  (__typeof__ (type))(x)
+#define TYPEOF( type )  (__typeof__ (type))
 #else
-#define TYPEOF( type, x )  (x)
+#define TYPEOF( type )  /* empty */
 #endif
 
 
diff --git a/include/internal/ftobjs.h b/include/internal/ftobjs.h
index ad65884..37317a4 100644
--- a/include/internal/ftobjs.h
+++ b/include/internal/ftobjs.h
@@ -84,11 +84,11 @@ FT_BEGIN_HEADER
                   : y + ( 3 * x >> 3 ) )
 
   /* we use the TYPEOF macro to suppress signedness compilation warnings */
-#define FT_PAD_FLOOR( x, n )  ( (x) & ~TYPEOF( x, (n)-1 ) )
+#define FT_PAD_FLOOR( x, n )  ( (x) & ~TYPEOF( x )( (n)-1 ) )
 #define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )
 #define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )
 
-#define FT_PIX_FLOOR( x )     ( (x) & ~TYPEOF( x, 63 ) )
+#define FT_PIX_FLOOR( x )     ( (x) & ~TYPEOF( x )63 )
 #define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )
 #define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )
 
diff --git a/src/autofit/afwarp.h b/src/autofit/afwarp.h
index a2c5f77..5a6208a 100644
--- a/src/autofit/afwarp.h
+++ b/src/autofit/afwarp.h
@@ -25,7 +25,7 @@ FT_BEGIN_HEADER
 
 #define AF_WARPER_SCALE
 
-#define AF_WARPER_FLOOR( x )  ( (x) & ~TYPEOF( x, 63 ) )
+#define AF_WARPER_FLOOR( x )  ( (x) & ~TYPEOF( x )63 )
 #define AF_WARPER_CEIL( x )   AF_WARPER_FLOOR( (x) + 63 )