freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 840ce58: * src/sfnt/tt{colr, cpal}.c: Fix signedness


From: Alexei Podtelezhnikov
Subject: [freetype2] master 840ce58: * src/sfnt/tt{colr, cpal}.c: Fix signedness warnings from VC++.
Date: Sun, 18 Oct 2020 07:37:47 -0400 (EDT)

branch: master
commit 840ce58f94bafdd24a138a9f7920becb5a30695f
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++.
---
 ChangeLog         |  4 ++++
 src/sfnt/ttcolr.c |  6 +++---
 src/sfnt/ttcpal.c | 12 ++++++------
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79d899b..e89f4c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
+       * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++.
+
+2020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
        * src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++.
 
 2020-10-10  Werner Lemberg  <wl@gnu.org>
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index 7476c42..9025e35 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -39,9 +39,9 @@
 
 
   /* NOTE: These are the table sizes calculated through the specs. */
-#define BASE_GLYPH_SIZE            6
-#define LAYER_SIZE                 4
-#define COLR_HEADER_SIZE          14
+#define BASE_GLYPH_SIZE            6U
+#define LAYER_SIZE                 4U
+#define COLR_HEADER_SIZE          14U
 
 
   typedef struct BaseGlyphRecord_
diff --git a/src/sfnt/ttcpal.c b/src/sfnt/ttcpal.c
index bdf7bfa..9c514ba 100644
--- a/src/sfnt/ttcpal.c
+++ b/src/sfnt/ttcpal.c
@@ -39,8 +39,8 @@
 
 
   /* NOTE: These are the table sizes calculated through the specs. */
-#define CPAL_V0_HEADER_BASE_SIZE  12
-#define COLOR_SIZE                 4
+#define CPAL_V0_HEADER_BASE_SIZE  12U
+#define COLOR_SIZE                 4U
 
 
   /* all data from `CPAL' not covered in FT_Palette_Data */
@@ -139,7 +139,7 @@
            3U * 4                               > table_size )
         goto InvalidTable;
 
-      p += face->palette_data.num_palettes * 2;
+      p += face->palette_data.num_palettes * 2U;
 
       type_offset        = FT_NEXT_ULONG( p );
       label_offset       = FT_NEXT_ULONG( p );
@@ -149,7 +149,7 @@
       {
         if ( type_offset >= table_size )
           goto InvalidTable;
-        if ( face->palette_data.num_palettes * 2 >
+        if ( face->palette_data.num_palettes * 2U >
                table_size - type_offset )
           goto InvalidTable;
 
@@ -170,7 +170,7 @@
       {
         if ( label_offset >= table_size )
           goto InvalidTable;
-        if ( face->palette_data.num_palettes * 2 >
+        if ( face->palette_data.num_palettes * 2U >
                table_size - label_offset )
           goto InvalidTable;
 
@@ -191,7 +191,7 @@
       {
         if ( entry_label_offset >= table_size )
           goto InvalidTable;
-        if ( face->palette_data.num_palette_entries * 2 >
+        if ( face->palette_data.num_palette_entries * 2U >
                table_size - entry_label_offset )
           goto InvalidTable;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]