Commit 7b3dc7bb61a786b08e6ac2e12b4a5fa3a312c055

Werner Lemberg 2002-04-28T02:48:20

* src/cache/ftccache.c (ftc_cache_lookup), src/cache/ftccmap.c (ftc_cmap_family_init), src/cache/ftcmanag.c (ftc_family_table_alloc), src/cache/ftcsbits.c (FTC_SBit_Cache_Lookup): Use FTC_Err_*. src/cache/ftcimage.c (FTC_Image_Cache_Lookup): Use FTC_Err_*. (FTC_ImageCache_Lookup): Fix handling of invalid arguments.

diff --git a/ChangeLog b/ChangeLog
index 3efb044..a161679 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-04-28  Werner Lemberg  <wl@gnu.org>
+
+	* src/cache/ftccache.c (ftc_cache_lookup),
+	src/cache/ftccmap.c (ftc_cmap_family_init),
+	src/cache/ftcmanag.c (ftc_family_table_alloc),
+	src/cache/ftcsbits.c (FTC_SBit_Cache_Lookup): Use FTC_Err_*.
+	src/cache/ftcimage.c (FTC_Image_Cache_Lookup): Use FTC_Err_*.
+	(FTC_ImageCache_Lookup): Fix handling of invalid arguments.
+
 2002-04-22  Werner Lemberg  <wl@gnu.org>
 
 	* builds/unix/configure.ac: Set `version_info' to 9:1:3 (FT2
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index e55dcb7..3a3ef5b 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -512,7 +512,6 @@
     FT_LruNode  lru;
 
 
-    /* some argument checks are delayed to ftc_glyph_cache_lookup */
     if ( !cache || !query || !anode )
       return FTC_Err_Invalid_Argument;
 
@@ -534,7 +533,7 @@
       {
         FT_ERROR((
           "ftc_cache_lookup: invalid query (bad 'family' field)\n" ));
-        return FT_Err_Invalid_Argument;
+        return FTC_Err_Invalid_Argument;
       }
 
       if ( *bucket )
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 7dfabc2..6b774ad 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -32,7 +32,7 @@
   /* codes to equivalent glyph indices.                                    */
   /*                                                                       */
   /* For now, the implementation is very basic: Each node maps a range of  */
-  /* 128 consecutive character codes to their correspondingglyph indices.  */
+  /* 128 consecutive character codes to their corresponding glyph indices. */
   /*                                                                       */
   /* We could do more complex things, but I don't think it is really very  */
   /* useful.                                                               */
@@ -228,7 +228,7 @@
 
   Bad_Descriptor:
     FT_ERROR(( "ftp_cmap_family_init: invalid charmap descriptor\n" ));
-    return FT_Err_Invalid_Argument;
+    return FTC_Err_Invalid_Argument;
   }
 
 
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index 86ecd09..101db85 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -324,11 +324,9 @@
     FT_Error           error;
 
 
-    /* some argument checks are delayed to ftc_glyph_cache_lookup */
-    if ( aglyph )
-      *aglyph = NULL;
-
-    *aglyph = NULL;
+    /* some argument checks are delayed to ftc_cache_lookup */
+    if ( !aglyph )
+      return FTC_Err_Invalid_Argument;
 
     if ( anode )
       *anode  = NULL;
@@ -374,7 +372,7 @@
 
 
     if ( !desc )
-      return FT_Err_Invalid_Argument;
+      return FTC_Err_Invalid_Argument;
 
     desc0.font = desc->font;
     desc0.type = (FT_UInt32)desc->image_type;
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index 2711540..7cdb8f9 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -400,7 +400,7 @@
     else
     {
       FT_ERROR(( "ftc_family_table_alloc: internal bug!" ));
-      return FT_Err_Invalid_Argument;
+      return FTC_Err_Invalid_Argument;
     }
 
     entry->link = FTC_FAMILY_ENTRY_NONE;
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 82ab84c..5b03c20 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -516,7 +516,7 @@
     
 
     if ( !desc )
-      return FT_Err_Invalid_Argument;
+      return FTC_Err_Invalid_Argument;
       
     desc0.font = desc->font;
     desc0.type = (FT_UInt32)desc->image_type;