* include/freetype/config/ftoption.h, src/autofit/afcjk.c,
src/base/ftobjs.c, src/base/ftutil.c, src/cff/cffobjs.c, src/psaux/afmparse.c, src/sfnt/ttbdf.c, src/tools/apinames.c, src/truetype/ttdriver.c: solved compiler warnings as well as C++ compilation problems
This commit is contained in:
parent
d7e6b76739
commit
6c71c6b968
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2006-02-25 David Turner <david@freetype.org>
|
||||||
|
|
||||||
|
* include/freetype/config/ftoption.h, src/autofit/afcjk.c,
|
||||||
|
src/base/ftobjs.c, src/base/ftutil.c, src/cff/cffobjs.c,
|
||||||
|
src/psaux/afmparse.c, src/sfnt/ttbdf.c, src/tools/apinames.c,
|
||||||
|
src/truetype/ttdriver.c:
|
||||||
|
|
||||||
|
solved compiler warnings as well as C++ compilation problems
|
||||||
|
|
||||||
|
|
||||||
2006-02-24 Chia-I Wu <b90201047@ntu.edu.tw>
|
2006-02-24 Chia-I Wu <b90201047@ntu.edu.tw>
|
||||||
|
|
||||||
* src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
|
* src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
|
||||||
|
|
|
@ -586,8 +586,13 @@ FT_BEGIN_HEADER
|
||||||
* certain functions like ft_mem_alloc in a way that prevents recent GCC
|
* certain functions like ft_mem_alloc in a way that prevents recent GCC
|
||||||
* releases from emitting zillions of `strict aliasing' warning messages
|
* releases from emitting zillions of `strict aliasing' warning messages
|
||||||
* each time a memory-management function is called.
|
* each time a memory-management function is called.
|
||||||
|
*
|
||||||
|
* note that it shouldn't be activated when compiling the library
|
||||||
|
* as C++
|
||||||
*/
|
*/
|
||||||
|
#ifndef __cplusplus
|
||||||
#define FT_STRICT_ALIASING
|
#define FT_STRICT_ALIASING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -595,6 +600,11 @@ FT_BEGIN_HEADER
|
||||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||||
* a few obsolete functions to avoid linking problems on typical Unix
|
* a few obsolete functions to avoid linking problems on typical Unix
|
||||||
* distributions.
|
* distributions.
|
||||||
|
*
|
||||||
|
* if you're on an embedded system, or if you're building a new
|
||||||
|
* distribution from scratch, it is recommended to disable the macro
|
||||||
|
* since it will reduce the library's code size and activate a few
|
||||||
|
* memory-saving optimizations as well.
|
||||||
*/
|
*/
|
||||||
#define FT_CONFIG_OPTION_OLD_INTERNALS
|
#define FT_CONFIG_OPTION_OLD_INTERNALS
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
{
|
{
|
||||||
AF_Point pt = seg->first;
|
AF_Point pt = seg->first;
|
||||||
AF_Point last = seg->last;
|
AF_Point last = seg->last;
|
||||||
AF_Flags f0 = pt->flags & AF_FLAG_CONTROL;
|
AF_Flags f0 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||||
AF_Flags f1;
|
AF_Flags f1;
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
for ( ; pt != last; f0 = f1 )
|
for ( ; pt != last; f0 = f1 )
|
||||||
{
|
{
|
||||||
pt = pt->next;
|
pt = pt->next;
|
||||||
f1 = pt->flags & AF_FLAG_CONTROL;
|
f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||||
|
|
||||||
if ( !f0 && !f1 )
|
if ( !f0 && !f1 )
|
||||||
break;
|
break;
|
||||||
|
@ -921,7 +921,9 @@
|
||||||
|
|
||||||
org_len = edge2->opos - edge->opos;
|
org_len = edge2->opos - edge->opos;
|
||||||
cur_len = af_cjk_compute_stem_width( hints, dim, org_len,
|
cur_len = af_cjk_compute_stem_width( hints, dim, org_len,
|
||||||
edge->flags, edge2->flags );
|
(AF_Edge_Flags)edge->flags,
|
||||||
|
(AF_Edge_Flags)edge2->flags );
|
||||||
|
|
||||||
org_center = ( edge->opos + edge2->opos ) / 2 + anchor;
|
org_center = ( edge->opos + edge2->opos ) / 2 + anchor;
|
||||||
cur_pos1 = org_center - cur_len / 2;
|
cur_pos1 = org_center - cur_len / 2;
|
||||||
cur_pos2 = cur_pos1 + cur_len;
|
cur_pos2 = cur_pos1 + cur_len;
|
||||||
|
@ -1123,7 +1125,8 @@
|
||||||
|
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
delta = af_hint_normal_stem( hints, edge, edge2, 0, 0 );
|
delta = af_hint_normal_stem( hints, edge, edge2, 0,
|
||||||
|
AF_DIMENSION_HORZ );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
af_hint_normal_stem( hints, edge, edge2, delta, dim );
|
af_hint_normal_stem( hints, edge, edge2, delta, dim );
|
||||||
|
|
|
@ -2125,7 +2125,7 @@
|
||||||
|
|
||||||
if ( FT_IS_SCALABLE( face ) )
|
if ( FT_IS_SCALABLE( face ) )
|
||||||
{
|
{
|
||||||
FT_Long w, h, scaled_w, scaled_h;
|
FT_Long w, h, scaled_w = 0, scaled_h = 0;
|
||||||
|
|
||||||
|
|
||||||
switch ( req->type )
|
switch ( req->type )
|
||||||
|
@ -3688,7 +3688,8 @@
|
||||||
FT_Service_TrueTypeEngine service;
|
FT_Service_TrueTypeEngine service;
|
||||||
|
|
||||||
|
|
||||||
service = ft_module_get_service( module,
|
service = (FT_Service_TrueTypeEngine)
|
||||||
|
ft_module_get_service( module,
|
||||||
FT_SERVICE_ID_TRUETYPE_ENGINE );
|
FT_SERVICE_ID_TRUETYPE_ENGINE );
|
||||||
if ( service )
|
if ( service )
|
||||||
result = service->engine_type;
|
result = service->engine_type;
|
||||||
|
|
|
@ -337,13 +337,12 @@
|
||||||
void* *P )
|
void* *P )
|
||||||
{
|
{
|
||||||
FT_TRACE7(( "ft_mem_free:" ));
|
FT_TRACE7(( "ft_mem_free:" ));
|
||||||
FT_TRACE7(( " Freeing block 0x%08p, ref 0x%08p\n",
|
FT_TRACE7(( " Freeing block 0x%08p ref 0x%08p\n", P, *P ));
|
||||||
P, P ? *P : (void*)0 ));
|
|
||||||
|
|
||||||
if ( P && *P )
|
if ( P && *P )
|
||||||
{
|
{
|
||||||
memory->free( memory, *P );
|
memory->free( memory, *P );
|
||||||
*P = 0;
|
*P = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,10 +622,7 @@
|
||||||
void* *P )
|
void* *P )
|
||||||
{
|
{
|
||||||
if ( *P )
|
if ( *P )
|
||||||
{
|
FT_MEM_FREE( *P );
|
||||||
ft_mem_free( memory, *P );
|
|
||||||
*P = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
if ( FT_HAS_FIXED_SIZES( size->face ) )
|
if ( FT_HAS_FIXED_SIZES( size->face ) )
|
||||||
{
|
{
|
||||||
CFF_Face cffface = (CFF_Face)size->face;
|
CFF_Face cffface = (CFF_Face)size->face;
|
||||||
SFNT_Service sfnt = cffface->sfnt;
|
SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
|
||||||
FT_ULong index;
|
FT_ULong index;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -513,7 +513,7 @@
|
||||||
return AFM_TOKEN_UNKNOWN;
|
return AFM_TOKEN_UNKNOWN;
|
||||||
|
|
||||||
if ( ft_strncmp( afm_key_table[n], key, len ) == 0 )
|
if ( ft_strncmp( afm_key_table[n], key, len ) == 0 )
|
||||||
return n;
|
return (AFM_Token) n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,11 +92,7 @@
|
||||||
( strings - 8 ) / 4 < num_strikes ||
|
( strings - 8 ) / 4 < num_strikes ||
|
||||||
strings + 1 > length )
|
strings + 1 > length )
|
||||||
{
|
{
|
||||||
BadTable:
|
goto BadTable;
|
||||||
FT_FRAME_RELEASE( bdf->table );
|
|
||||||
FT_ZERO( bdf );
|
|
||||||
error = FT_Err_Invalid_Table;
|
|
||||||
goto Exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bdf->num_strikes = num_strikes;
|
bdf->num_strikes = num_strikes;
|
||||||
|
@ -132,6 +128,12 @@
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
BadTable:
|
||||||
|
FT_FRAME_RELEASE( bdf->table );
|
||||||
|
FT_ZERO( bdf );
|
||||||
|
error = FT_Err_Invalid_Table;
|
||||||
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,14 +86,14 @@ names_add( const char* name,
|
||||||
if ( num_names >= max_names )
|
if ( num_names >= max_names )
|
||||||
{
|
{
|
||||||
max_names += (max_names >> 1) + 4;
|
max_names += (max_names >> 1) + 4;
|
||||||
the_names = realloc( the_names, sizeof(the_names[0])*max_names );
|
the_names = (NameRec*)realloc( the_names, sizeof(the_names[0])*max_names );
|
||||||
if ( the_names == NULL )
|
if ( the_names == NULL )
|
||||||
panic( "not enough memory" );
|
panic( "not enough memory" );
|
||||||
}
|
}
|
||||||
nm = &the_names[num_names++];
|
nm = &the_names[num_names++];
|
||||||
|
|
||||||
nm->hash = h;
|
nm->hash = h;
|
||||||
nm->name = malloc( len+1 );
|
nm->name = (char*)malloc( len+1 );
|
||||||
if ( nm->name == NULL )
|
if ( nm->name == NULL )
|
||||||
panic( "not enough memory" );
|
panic( "not enough memory" );
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ read_header_file( FILE* file, int verbose )
|
||||||
static void
|
static void
|
||||||
usage( void )
|
usage( void )
|
||||||
{
|
{
|
||||||
fprintf( stderr,
|
static const char* const format =
|
||||||
"%s %s: extract FreeType API names from header files\n\n"
|
"%s %s: extract FreeType API names from header files\n\n"
|
||||||
"this program is used to extract the list of public FreeType API\n"
|
"this program is used to extract the list of public FreeType API\n"
|
||||||
"functions. It receives the list of header files as argument and\n"
|
"functions. It receives the list of header files as argument and\n"
|
||||||
|
@ -298,14 +298,16 @@ usage( void )
|
||||||
"usage: %s header1 [options] [header2 ...]\n\n"
|
"usage: %s header1 [options] [header2 ...]\n\n"
|
||||||
|
|
||||||
"options: - : parse the content of stdin, ignore arguments\n"
|
"options: - : parse the content of stdin, ignore arguments\n"
|
||||||
" -v : verbose mode, output sent to standard error\n",
|
" -v : verbose mode, output sent to standard error\n"
|
||||||
" -oFILE : write output to FILE instead of standard output\n"
|
" -oFILE : write output to FILE instead of standard output\n"
|
||||||
" -dNAME : indicate DLL file name, 'freetype.dll' by default\n"
|
" -dNAME : indicate DLL file name, 'freetype.dll' by default\n"
|
||||||
" -w : output .DEF file for Visual C++ and Mingw\n"
|
" -w : output .DEF file for Visual C++ and Mingw\n"
|
||||||
" -wB : output .DEF file for Borland C++\n"
|
" -wB : output .DEF file for Borland C++\n"
|
||||||
" -wW : output Watcom Linker Response File\n"
|
" -wW : output Watcom Linker Response File\n"
|
||||||
"\n"
|
"\n";
|
||||||
,
|
|
||||||
|
fprintf( stderr,
|
||||||
|
format,
|
||||||
PROGRAM_NAME,
|
PROGRAM_NAME,
|
||||||
PROGRAM_VERSION,
|
PROGRAM_VERSION,
|
||||||
PROGRAM_NAME
|
PROGRAM_NAME
|
||||||
|
|
|
@ -158,7 +158,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SFNT_Service sfnt = ttface->sfnt;
|
SFNT_Service sfnt = (SFNT_Service) ttface->sfnt;
|
||||||
FT_Size_Metrics* metrics = &size->metrics;
|
FT_Size_Metrics* metrics = &size->metrics;
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@
|
||||||
if ( FT_HAS_FIXED_SIZES( size->face ) )
|
if ( FT_HAS_FIXED_SIZES( size->face ) )
|
||||||
{
|
{
|
||||||
TT_Face ttface = (TT_Face)size->face;
|
TT_Face ttface = (TT_Face)size->face;
|
||||||
SFNT_Service sfnt = ttface->sfnt;
|
SFNT_Service sfnt = (SFNT_Service) ttface->sfnt;
|
||||||
FT_ULong index;
|
FT_ULong index;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue