* src/gxvalid/gxvbsln.c: Fix compiler warnings.

* src/gxvalid/gxvcommn.c: Fix compiler warnings.
(gxv_XEntryTable_validate, gxv_compare_ranges): Remove unused
parameter.  Update all callers.
Improve tracing messages.

Some formatting.
This commit is contained in:
Werner Lemberg 2005-08-31 16:29:51 +00:00
parent 2ee0799881
commit def11c3ad6
5 changed files with 339 additions and 307 deletions

View File

@ -1,6 +1,12 @@
2005-08-30 Werner Lemberg <wl@gnu.org>
* src/gxvalid/README: Revised.
* src/gxvalid/gxvbsln.c: Fix compiler warnings.
* src/gxvalid/gxvcommn.c: Fix compiler warnings.
(gxv_XEntryTable_validate, gxv_compare_ranges): Remove unused
parameter. Update all callers.
Improve tracing messages.
Some formatting.
2005-08-29 Werner Lemberg <wl@gnu.org>

View File

@ -1,14 +1,26 @@
# FreeType 2 src/gxvalid Jamfile (c) 2005 suzuki toshiya, Masatake YAMATO and Red Hat K.K.
# FreeType 2 src/gxvalid Jamfile
#
# Copyright 2005 by
# suzuki toshiya, Masatake YAMATO and Red Hat K.K.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
SubDir FT2_TOP $(FT2_SRC_DIR) gxvalid ;
{
local _sources ;
if $(FT2_MULTI)
{
_sources = gxvcommn gxvfeat gxvbsln gxvtrak gxvopbd gxvprop gxvjust gxvmort gxvmort0 gxvmort1 gxvmort2 gxvmort4 gxvmort5 gxvmorx gxvmorx0 gxvmorx1 gxvmorx2 gxvmorx4 gxvmorx5 gxvlcar gxvkern gxvmod ;
_sources = gxvcommn gxvfeat gxvbsln gxvtrak gxvopbd gxvprop
gxvmort gxvmort0 gxvmort1 gxvmort2 gxvmort4 gxvmort5
gxvmorx gxvmorx0 gxvmorx1 gxvmorx2 gxvmorx4 gxvmorx5
gxvlcar gxvkern gxvmod gxvjust ;
}
else
{

View File

@ -16,9 +16,11 @@
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout was support of Information-technology Promotion */
/* Agency(IPA), Japan. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
@ -75,11 +77,10 @@ FT_BEGIN_HEADER
FT_Validator valid );
FT_LOCAL( void )
gxv_kern_validate_classic
( FT_Bytes table,
FT_Face face,
FT_Int dialect_flags,
FT_Validator valid );
gxv_kern_validate_classic( FT_Bytes table,
FT_Face face,
FT_Int dialect_flags,
FT_Validator valid );
FT_LOCAL( void )
gxv_opbd_validate( FT_Bytes table,

View File

@ -16,9 +16,11 @@
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout was support of Information-technology Promotion */
/* Agency(IPA), Japan. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
@ -26,7 +28,6 @@
#include "gxvcommn.h"
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@ -45,8 +46,9 @@
/*************************************************************************/
/*************************************************************************/
#define GXV_BSLN_VALUE_COUNT 32
#define GXV_BSLN_VALUE_EMPTY 0xFFFF
#define GXV_BSLN_VALUE_COUNT 32
#define GXV_BSLN_VALUE_EMPTY 0xFFFF
typedef struct GXV_bsln_DataRec_
{
@ -54,7 +56,8 @@
FT_UShort defaultBaseline;
} GXV_bsln_DataRec, *GXV_bsln_Data;
#define GXV_BSLN_DATA(field) GXV_TABLE_DATA( bsln, field )
#define GXV_BSLN_DATA( field ) GXV_TABLE_DATA( bsln, field )
/*************************************************************************/
@ -70,16 +73,17 @@
GXV_LookupValueDesc value,
GXV_Validator valid )
{
FT_UShort v = value.u;
FT_UShort v = value.u;
FT_UShort* ctlPoints;
FT_UNUSED( glyph );
GXV_NAME_ENTER( " lookup value" );
if ( v >= GXV_BSLN_VALUE_COUNT )
FT_INVALID_DATA;
ctlPoints = (FT_UShort*)GXV_BSLN_DATA( ctlPoints_p );
if ( ctlPoints && ctlPoints[v] == GXV_BSLN_VALUE_EMPTY )
FT_INVALID_DATA;
@ -126,6 +130,7 @@
FT_UShort offset;
GXV_LookupValueDesc value;
offset = base_value.u + ( relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
@ -137,6 +142,7 @@
return value;
}
static void
gxv_bsln_parts_fmt0_validate( FT_Bytes tables,
FT_Bytes limit,
@ -163,6 +169,7 @@
{
FT_Bytes p = tables;
GXV_NAME_ENTER( " parts format 1" );
/* deltas */
@ -185,13 +192,13 @@
FT_Bytes limit,
GXV_Validator valid )
{
FT_Bytes p = tables;
FT_Bytes p = tables;
FT_UShort stdGlyph;
FT_UShort ctlPoint;
FT_Int i;
FT_UShort stdGlyph;
FT_UShort ctlPoint;
FT_Int i;
FT_UShort defaultBaseline = GXV_BSLN_DATA( defaultBaseline );
FT_UShort defaultBaseline = GXV_BSLN_DATA( defaultBaseline );
GXV_NAME_ENTER( "parts format 2" );
@ -205,7 +212,7 @@
gxv_glyphid_validate( stdGlyph, valid );
/* Record the position of ctlPoints */
GXV_BSLN_DATA( ctlPoints_p) = p;
GXV_BSLN_DATA( ctlPoints_p ) = p;
/* ctlPoints */
for ( i = 0; i < GXV_BSLN_VALUE_COUNT; i++ )
@ -217,9 +224,7 @@
FT_INVALID_DATA;
}
else
{
gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, valid );
}
}
GXV_EXIT;
@ -264,13 +269,13 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_bsln_DataRec bslnrec;
GXV_bsln_Data bsln = &bslnrec;
GXV_bsln_DataRec bslnrec;
GXV_bsln_Data bsln = &bslnrec;
FT_Bytes p = table;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
@ -299,11 +304,11 @@
format = FT_NEXT_USHORT( p );
defaultBaseline = FT_NEXT_USHORT( p );
/* version 1.0 is only defined (1996) */
/* only version 1.0 is defined (1996) */
if ( version != 0x00010000UL )
FT_INVALID_FORMAT;
/* format 1, 2, 3 are only defined (1996) */
/* only format 1, 2, 3 are defined (1996) */
GXV_TRACE(( " (format = %d)\n", format ));
if ( format > 3 )
FT_INVALID_FORMAT;
@ -311,7 +316,6 @@
if ( defaultBaseline > 31 )
FT_INVALID_FORMAT;
bsln->defaultBaseline = defaultBaseline;
fmt_funcs_table[format]( p, limit, valid );
@ -319,6 +323,7 @@
FT_TRACE4(( "\n" ));
}
/* arch-tag: ebe81143-fdaa-4c68-a4d1-b57227daa3bc
(do not change this comment) */

File diff suppressed because it is too large Load Diff