diff --git a/ChangeLog b/ChangeLog index 617f8ec8e..a85224ece 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ +2008-08-23 Werner Lemberg + + * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c + (afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug + #24119. + 2008-08-19 suzuki toshiya - * src/base/ftobjs.c (FT_Stream_New): Initialize *astream - always, even if passed library or arguments are invalid. - This fixes a bug that uninitialized stream is freed when - an invalid library handle is passed. Originally proposed - by Mike Fabian, 2008/08/18 on freetype-devel. + * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always, + even if passed library or arguments are invalid. This fixes a bug + that an uninitialized stream is freed when an invalid library handle + is passed. Originally proposed by Mike Fabian, 2008/08/18 on + freetype-devel. (FT_Open_Face): Ditto (stream). (load_face_in_embedded_rfork): Ditto (stream2). diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c index 82fd6b3a6..46fc123fe 100644 --- a/src/gxvalid/gxvcommn.c +++ b/src/gxvalid/gxvcommn.c @@ -50,11 +50,11 @@ FT_UShort* b ) { if ( *a < *b ) - return ( -1 ); + return -1; else if ( *a > *b ) - return ( 1 ); + return 1; else - return ( 0 ); + return 0; } @@ -115,11 +115,11 @@ FT_ULong* b ) { if ( *a < *b ) - return ( -1 ); + return -1; else if ( *a > *b ) - return ( 1 ); + return 1; else - return ( 0 ); + return 0; } diff --git a/src/psaux/afmparse.c b/src/psaux/afmparse.c index 0528fe6ff..63a786e88 100644 --- a/src/psaux/afmparse.c +++ b/src/psaux/afmparse.c @@ -4,7 +4,7 @@ /* */ /* AFM parser (body). */ /* */ -/* Copyright 2006, 2007 by */ +/* Copyright 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -672,7 +672,12 @@ FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 ); - return (int)( index1 - index2 ); + if ( index1 > index2 ) + return 1; + else if ( index1 < index2 ) + return -1; + else + return 0; } diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 40a61b995..41942a9b4 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -174,9 +174,23 @@ /* sort base glyphs before glyph variants */ if ( unicode1 == unicode2 ) - return map1->unicode - map2->unicode; + { + if ( map1->unicode > map2->unicode ) + return 1; + else if ( map1->unicode < map2->unicode ) + return -1; + else + return 0; + } else - return unicode1 - unicode2; + { + if ( unicode1 > unicode2 ) + return 1; + else if ( unicode1 < unicode2 ) + return -1; + else + return 0; + } } diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c index b81a8df83..5aea58820 100644 --- a/src/type1/t1afm.c +++ b/src/type1/t1afm.c @@ -4,7 +4,7 @@ /* */ /* AFM support for Type 1 fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -88,7 +88,12 @@ FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 ); - return (int)( index1 - index2 ); + if ( index1 > index2 ) + return 1; + else if ( index1 < index2 ) + return -1; + else + return 0; }