Commit 38dc768a42abc5884fc3fa1c530950ab4ebc3dc5

Werner Lemberg 2022-07-29T21:17:06

Fix clang14 compiler warnings. * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE): Fix type. * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean value. (tt_face_get_colorline_stops): Fix type of `var_index_base`.

diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index a12e41a..1f2858e 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -314,8 +314,8 @@ FT_BEGIN_HEADER
 #define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
 #define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
 
-#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Int32 )
-#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UInt32 )
+#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Int16 )
+#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UInt16 )
 #define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Int32 )
 #define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_UInt32 )
 #endif
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index af649dc..1c3dfc1 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -557,8 +557,6 @@
                                   FT_UInt           num_deltas,
                                   FT_ItemVarDelta*  deltas )
   {
-    FT_Error  error = FT_Err_Ok;
-
     FT_UInt   outer_index    = 0;
     FT_UInt   inner_index    = 0;
     FT_ULong  loop_var_index = var_index_base;
@@ -597,8 +595,7 @@
       {
         /* TODO: Direct lookup case not implemented or tested yet. */
         FT_ASSERT( 0 );
-        error = FT_THROW( Unimplemented_Feature );
-        return error;
+        return 0;
       }
 
       deltas[i] = mm->get_item_delta( FT_FACE( face ), &colr->var_store,
@@ -1517,7 +1514,7 @@
     Colr*  colr = (Colr*)face->colr;
 
     FT_Byte*  p;
-    FT_Long   var_index_base;
+    FT_ULong  var_index_base;
     FT_Int    item_deltas[2];