Commit b34741c1cca65443de6ff7d46ef6ea8fd21a1e4d

Alexei Podtelezhnikov 2022-01-27T22:55:34

Minor clean-ups. * src/base/ftrfork.c (raccess_make_file_name): Do not set error. * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto. * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error. * src/psaux/psobjs.c (ps_table_done): Ditto. * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto.

diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index 954df1a..7fe4146 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -868,9 +868,7 @@
     const char*  tmp;
     const char*  slash;
     size_t       new_length;
-    FT_Error     error = FT_Err_Ok;
-
-    FT_UNUSED( error );
+    FT_Error     error;
 
 
     new_length = ft_strlen( original_name ) + ft_strlen( insertion );
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 6ced6cd..fa42acc 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -411,9 +411,7 @@
     FT_String*  result;
 
 
-    (void)FT_STRDUP( result, source );
-
-    FT_UNUSED( error );
+    FT_MEM_STRDUP( result, source );
 
     return result;
   }
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 323c43b..4ee5287 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -258,8 +258,6 @@
 
     table->capacity = table->cursor;
     FT_FREE( old_base );
-
-    FT_UNUSED( error );
   }
 
 
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 9115b6d..cc121e5 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -495,15 +495,13 @@
                   char_type_func  char_type,
                   FT_Bool         report_invalid_characters )
   {
-    FT_Error  error = FT_Err_Ok;
+    FT_Error  error;
 
     char*       result = NULL;
     FT_String*  r;
     FT_Char*    p;
     FT_UInt     len;
 
-    FT_UNUSED( error );
-
 
     if ( FT_QALLOC( result, entry->stringLength / 2 + 1 ) )
       return NULL;
@@ -554,15 +552,13 @@
                     char_type_func  char_type,
                     FT_Bool         report_invalid_characters )
   {
-    FT_Error  error = FT_Err_Ok;
+    FT_Error  error;
 
     char*       result = NULL;
     FT_String*  r;
     FT_Char*    p;
     FT_UInt     len;
 
-    FT_UNUSED( error );
-
 
     if ( FT_QALLOC( result, entry->stringLength + 1 ) )
       return NULL;
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 1d4fb28..2a7f917 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -151,9 +151,7 @@
     FT_UInt    i, j;
     FT_UShort  first;
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = FT_Err_Ok;
-
-    FT_UNUSED( error );
+    FT_Error   error;
 
 
     *point_cnt = 0;
@@ -266,9 +264,7 @@
     FT_UInt    i, j;
     FT_UInt    bytes_used;
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = FT_Err_Ok;
-
-    FT_UNUSED( error );
+    FT_Error   error;
 
 
     if ( FT_QNEW_ARRAY( deltas, delta_cnt ) )
@@ -361,14 +357,12 @@
     FT_Memory       memory = stream->memory;
     GX_Blend        blend  = face->blend;
     GX_AVarSegment  segment;
-    FT_Error        error = FT_Err_Ok;
+    FT_Error        error;
     FT_Long         version;
     FT_Long         axisCount;
     FT_Int          i, j;
     FT_ULong        table_len;
 
-    FT_UNUSED( error );
-
 
     FT_TRACE2(( "AVAR " ));