Commit d6bc524bdc54320c78ef791e285ac64621049296

Werner Lemberg 2013-03-11T09:50:53

Always use module related error codes. * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use `FT_ERROR_BASE'. * src/type1/t1load.c (parse_encoding): Use T1_Err_Unknown_File_Format.

diff --git a/ChangeLog b/ChangeLog
index aa98b6a..5d3af72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-03-11  Werner Lemberg  <wl@gnu.org>
+
+	Always use module related error codes.
+
+	* src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c
+	(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use
+	`FT_ERROR_BASE'.
+
+	* src/type1/t1load.c (parse_encoding): Use
+	T1_Err_Unknown_File_Format.
+
 2013-03-08  Werner Lemberg  <wl@gnu.org>
 
 	[cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also.
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index e3958ba..1443aa7 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index b4dddb7..7725477 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -959,7 +959,8 @@
 
         error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
                              &cmaprec, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                                  &&
+             FT_ERROR_BASE( error ) != FT_Err_No_Unicode_Glyph_Name )
           goto Exit;
         error = FT_Err_Ok;
 
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 388f1fc..202873a 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
-/*  Copyright 1996-2012 by                                                 */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -1312,7 +1312,7 @@
             /* specification (it might be an encoding for a CID type1  */
             /* font, however), so we conclude that this font is NOT a  */
             /* type1 font.                                             */
-            parser->root.error = FT_Err_Unknown_File_Format;
+            parser->root.error = T1_Err_Unknown_File_Format;
             return;
           }
         }
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index b685f2f..1a7eb4b 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 objects manager (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2009, 2011 by                                           */
+/*  Copyright 1996-2009, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -517,7 +517,8 @@
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                                  &&
+             FT_ERROR_BASE( error ) != FT_Err_No_Unicode_Glyph_Name )
           goto Exit;
         error = FT_Err_Ok;
 
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index c6053af..5b53502 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
-/*  Copyright 2002-2009, 2011                                              */
+/*  Copyright 2002-2009, 2011, 2013                                        */
 /*  by Roberto Alameda.                                                    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -347,7 +347,8 @@
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                                 &&
+             FT_ERROR_BASE( error) != FT_Err_No_Unicode_Glyph_Name )
           goto Exit;
         error = FT_Err_Ok;