diff --git a/include/freetype/ftbbox.h b/include/freetype/ftbbox.h index 54a05b926..ffdd42386 100644 --- a/include/freetype/ftbbox.h +++ b/include/freetype/ftbbox.h @@ -56,10 +56,10 @@ /* bbox :: The outline's exact bounding box. */ /* */ /* */ - /* Error code. 0 means success. */ + /* FreeType error code. 0 means success. */ /* */ - FT_EXPORT_DEF(FT_Error) FT_Outline_Get_BBox( FT_Outline* outline, - FT_BBox *abbox ); + FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, + FT_BBox* bbox ); #ifdef __cplusplus diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h index 24402035d..6dc50f5ca 100644 --- a/include/freetype/internal/tttypes.h +++ b/include/freetype/internal/tttypes.h @@ -1399,7 +1399,7 @@ FT_Bool vertical_info; TT_VertHeader vertical; /* TT Vertical header, if present */ - FT_Int num_names; /* number of name records */ + FT_UShort num_names; /* number of name records */ TT_NameTable name_table; /* name table */ TT_OS2 os2; /* TrueType OS/2 table */ @@ -1437,7 +1437,7 @@ TT_Gasp gasp; /* the `gasp' table */ /* PCL 5 table */ - TT_PCLT pclt; + TT_PCLT pclt; /* embedded bitmaps support */ FT_Int num_sbit_strikes; diff --git a/src/base/ftbbox.c b/src/base/ftbbox.c index 484ea4a9b..f53432a88 100644 --- a/src/base/ftbbox.c +++ b/src/base/ftbbox.c @@ -15,14 +15,12 @@ /* */ /***************************************************************************/ + /*************************************************************************/ /* */ /* This component has a _single_ role: to compute exact outline bounding */ /* boxes. */ /* */ - /* It is separated from the rest of the engine for various technical */ - /* reasons. It may well be integrated in `ftoutln' later. */ - /* */ /*************************************************************************/ @@ -30,6 +28,7 @@ #include #include + typedef struct TBBox_Rec_ { FT_Vector last; @@ -45,8 +44,8 @@ /* */ /* */ /* This function is used as a `move_to' and `line_to' emitter during */ - /* FT_Outline_Decompose. It simply records the destination point in */ - /* `user->last'. */ + /* FT_Outline_Decompose(). It simply records the destination point */ + /* in `user->last'. */ /* */ /* */ /* to :: A pointer to the destination vector. */ @@ -55,7 +54,7 @@ /* user :: A pointer to the current walk context. */ /* */ /* */ - /* Error code. 0 means success. */ + /* Always 0. Needed for the interface only. */ /* */ static int BBox_Move_To( FT_Vector* to, @@ -151,7 +150,7 @@ /* user :: The address of the current walk context. */ /* */ /* */ - /* Error code. 0 means success. */ + /* Always 0. Needed for the interface only. */ /* */ /* */ /* In the case of a non-monotonous arc, we compute directly the */ @@ -273,7 +272,7 @@ Suite: ; - } while (arc >= stack); + } while ( arc >= stack ); } @@ -297,7 +296,7 @@ /* user :: The address of the current walk context. */ /* */ /* */ - /* Error code. 0 means success. */ + /* Always 0. Needed for the interface only. */ /* */ /* */ /* In the case of a non-monotonous arc, we don't compute directly */ @@ -354,21 +353,24 @@ /* abbox :: A pointer to the outline's exact bounding box. */ /* */ /* */ - /* Error code. 0 means success. */ + /* FreeType error code. 0 means success. */ /* */ FT_EXPORT_FUNC( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, FT_BBox* abbox ) { - FT_BBox cbox; - FT_BBox bbox; - FT_Vector* vec; - FT_UShort n; + FT_BBox cbox; + FT_BBox bbox; + FT_Vector* vec; + FT_UShort n; - /* if outline is empty, return (0,0,0,0) */ + if ( !abbox ) + return FT_Err_Invalid_Argument; + if ( !outline ) return FT_Err_Invalid_Outline; + /* if outline is empty, return (0,0,0,0) */ if ( outline->n_points == 0 || outline->n_contours <= 0 ) { abbox->xMin = abbox->xMax = 0; diff --git a/src/base/rules.mk b/src/base/rules.mk index af62ec2b0..7698c411c 100644 --- a/src/base/rules.mk +++ b/src/base/rules.mk @@ -48,7 +48,7 @@ BASE_SRC := $(BASE_)ftcalc.c \ # BASE_EXT_SRC := $(BASE_)ftglyph.c \ $(BASE_)ftmm.c \ - $(BASE_)ftbbox.c + $(BASE_)ftbbox.c # Default extensions objects # diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c index 19d33b868..9f7f52c45 100644 --- a/src/cache/ftcimage.c +++ b/src/cache/ftcimage.c @@ -24,6 +24,8 @@ #include +#include + /*************************************************************************/ /*************************************************************************/ diff --git a/src/psaux/psauxmod.c b/src/psaux/psauxmod.c index efe4165fe..c425960b6 100644 --- a/src/psaux/psauxmod.c +++ b/src/psaux/psauxmod.c @@ -68,7 +68,7 @@ }; - LOCAL_FUNC + static const PSAux_Interface psaux_interface = { &ps_table_funcs, diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 7bd5349e2..8fac327fd 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -269,7 +269,8 @@ } - static const PSNames_Interface psnames_interface = + static + const PSNames_Interface psnames_interface = { #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c index 48c07c028..c9b8e7e83 100644 --- a/src/sfnt/ttpost.c +++ b/src/sfnt/ttpost.c @@ -169,7 +169,7 @@ FT_Error error; FT_Int num_glyphs; - FT_Int num_names; + FT_UShort num_names; FT_UShort* glyph_indices = 0; FT_Char** name_strings = 0; @@ -229,7 +229,7 @@ /* now load the name strings */ { - FT_Int n; + FT_UShort n; if ( ALLOC_ARRAY( name_strings, num_names, FT_Char* ) ) @@ -264,7 +264,7 @@ Fail1: { - FT_Int n; + FT_UShort n; for ( n = 0; n < num_names; n++ ) @@ -401,7 +401,7 @@ case 0x00020000L: { TT_Post_20* table = &names->names.format_20; - FT_UInt n; + FT_UShort n; FREE( table->glyph_indices ); diff --git a/src/type1/type1.c b/src/type1/type1.c index 17e89ac15..07d9145e6 100644 --- a/src/type1/type1.c +++ b/src/type1/type1.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* type1z.c */ +/* type1.c */ /* */ /* FreeType experimental Type 1 driver component (body only). */ /* */ @@ -33,14 +33,14 @@ #else /* FT_FLAT_COMPILE */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifndef Z1_CONFIG_OPTION_NO_AFM -#include +#include #endif #endif /* FT_FLAT_COMPILE */ diff --git a/src/type1/z1afm.c b/src/type1/z1afm.c index e47349c49..f7d0282f1 100644 --- a/src/type1/z1afm.c +++ b/src/type1/z1afm.c @@ -22,7 +22,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1afm.h b/src/type1/z1afm.h index bfacce713..5e25e7efb 100644 --- a/src/type1/z1afm.h +++ b/src/type1/z1afm.h @@ -26,7 +26,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1driver.c b/src/type1/z1driver.c index 11990d870..c3aacb3f0 100644 --- a/src/type1/z1driver.c +++ b/src/type1/z1driver.c @@ -25,10 +25,10 @@ #else -#include -#include -#include -#include +#include +#include +#include +#include #endif diff --git a/src/type1/z1gload.c b/src/type1/z1gload.c index d9a552c61..57e44a0f1 100644 --- a/src/type1/z1gload.c +++ b/src/type1/z1gload.c @@ -22,7 +22,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1gload.h b/src/type1/z1gload.h index c9a913b13..da4560aec 100644 --- a/src/type1/z1gload.h +++ b/src/type1/z1gload.h @@ -26,7 +26,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1load.c b/src/type1/z1load.c index 37fb99e6f..b36711527 100644 --- a/src/type1/z1load.c +++ b/src/type1/z1load.c @@ -75,7 +75,7 @@ #else -#include +#include #endif @@ -1388,7 +1388,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1load.h b/src/type1/z1load.h index ca94f8ab9..0a20d9311 100644 --- a/src/type1/z1load.h +++ b/src/type1/z1load.h @@ -30,7 +30,7 @@ #else -#include +#include #endif diff --git a/src/type1/z1objs.c b/src/type1/z1objs.c index 8772692d4..6ec21b3d1 100644 --- a/src/type1/z1objs.c +++ b/src/type1/z1objs.c @@ -28,9 +28,9 @@ #else -#include -#include -#include +#include +#include +#include #endif diff --git a/src/type1/z1parse.c b/src/type1/z1parse.c index 07e7a1503..64e0f8443 100644 --- a/src/type1/z1parse.c +++ b/src/type1/z1parse.c @@ -46,7 +46,7 @@ #else -#include +#include #endif