* src/otlayout/otlgpos.c (otl_gpos_subtable_validate): Add argument

to pass number of lookups.
Update all callers.
Don't call otl_lookup_list_validate but otl_lookup_validate.
(otl_gpos_validate): Call otl_lookup_list_validate instead of
otl_gpos_subtable_validate.

* src/otlayout/otlgpos.h: Updated.

* src/otlayout/otljstf.c (otl_jstf_max_validate): Add argument to
pass number of lookups.
Update all callers.


* src/cff/cffparse.c (cff_parse_real): s/exp/exponent/ to avoid
compiler warning.


* src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Renamed to...
* src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: This.
* src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
src/sfnt/sfnt.c, src/sfnt/sfobjs.c: Updated.


* builds/compiler/gcc-dev.mk (CFLAGS): Don't add `-Wnested-externs'
if compiler is g++ (v3.3.3 emits a warning otherwise).
This commit is contained in:
Werner Lemberg 2004-08-29 16:50:09 +00:00
parent e79e3d3ee3
commit 4b8397c775
13 changed files with 75 additions and 36 deletions

View File

@ -1,3 +1,32 @@
2004-08-29 Werner Lemberg <wl@gnu.org>
* src/otlayout/otlgpos.c (otl_gpos_subtable_validate): Add argument
to pass number of lookups.
Update all callers.
Don't call otl_lookup_list_validate but otl_lookup_validate.
(otl_gpos_validate): Call otl_lookup_list_validate instead of
otl_gpos_subtable_validate.
* src/otlayout/otlgpos.h: Updated.
* src/otlayout/otljstf.c (otl_jstf_max_validate): Add argument to
pass number of lookups.
Update all callers.
* src/cff/cffparse.c (cff_parse_real): s/exp/exponent/ to avoid
compiler warning.
* src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Renamed to...
* src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: This.
* src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
src/sfnt/sfnt.c, src/sfnt/sfobjs.c: Updated.
* builds/compiler/gcc-dev.mk (CFLAGS): Don't add `-Wnested-externs'
if compiler is g++ (v3.3.3 emits a warning otherwise).
2004-08-28 Werner Lemberg <wl@gnu.org> 2004-08-28 Werner Lemberg <wl@gnu.org>
* src/otlayout/otlgpos.c (otl_value_length): Return number of bytes, * src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,

View File

@ -3,7 +3,7 @@
# #
# Copyright 1996-2000, 2003 by # Copyright 1996-2000, 2003, 2004 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -63,6 +63,10 @@ T := -o$(space)
# ANSI compliance. # ANSI compliance.
# #
ifndef CFLAGS ifndef CFLAGS
ifeq ($(findstring g++,$(CC)),)
nested_externs := -Wnested-externs
endif
CFLAGS := -c -g -O0 \ CFLAGS := -c -g -O0 \
-fno-strict-aliasing \ -fno-strict-aliasing \
-Wall \ -Wall \
@ -73,8 +77,8 @@ ifndef CFLAGS
-Wwrite-strings \ -Wwrite-strings \
-Wstrict-prototypes \ -Wstrict-prototypes \
-Wredundant-decls \ -Wredundant-decls \
-Wnested-externs \ -Wno-long-long \
-Wno-long-long $(nested_externs)
endif endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.

View File

@ -143,8 +143,8 @@
FT_Int power_ten ) FT_Int power_ten )
{ {
FT_Byte* p = start; FT_Byte* p = start;
FT_Long num, divider, result, exp; FT_Long num, divider, result, exponent;
FT_Int sign = 0, exp_sign = 0; FT_Int sign = 0, exponent_sign = 0;
FT_UInt nib; FT_UInt nib;
FT_UInt phase; FT_UInt phase;
@ -212,13 +212,13 @@
/* read exponent, if any */ /* read exponent, if any */
if ( nib == 12 ) if ( nib == 12 )
{ {
exp_sign = 1; exponent_sign = 1;
nib = 11; nib = 11;
} }
if ( nib == 11 ) if ( nib == 11 )
{ {
exp = 0; exponent = 0;
for (;;) for (;;)
{ {
@ -239,13 +239,13 @@
if ( nib >= 10 ) if ( nib >= 10 )
break; break;
exp = exp * 10 + nib; exponent = exponent * 10 + nib;
} }
if ( exp_sign ) if ( exponent_sign )
exp = -exp; exponent = -exponent;
power_ten += (FT_Int)exp; power_ten += (FT_Int)exponent;
} }
/* raise to power of ten if needed */ /* raise to power of ten if needed */

View File

@ -1057,11 +1057,12 @@
OTL_LOCALDEF( void ) OTL_LOCALDEF( void )
otl_gpos_subtable_validate( OTL_Bytes table, otl_gpos_subtable_validate( OTL_Bytes table,
OTL_UInt lookup_count,
OTL_UInt glyph_count, OTL_UInt glyph_count,
OTL_Validator valid ) OTL_Validator valid )
{ {
otl_lookup_list_validate( table, 9, otl_gpos_validate_funcs, otl_lookup_validate( table, 9, otl_gpos_validate_funcs,
glyph_count, valid ); lookup_count, glyph_count, valid );
} }
@ -1091,7 +1092,8 @@
features = OTL_NEXT_USHORT( p ); features = OTL_NEXT_USHORT( p );
lookups = OTL_NEXT_USHORT( p ); lookups = OTL_NEXT_USHORT( p );
otl_gpos_subtable_validate( table + lookups, glyph_count, valid ); otl_lookup_list_validate( table + lookups, 9, otl_gpos_validate_funcs,
glyph_count, valid );
otl_feature_list_validate( table + features, table + lookups, valid ); otl_feature_list_validate( table + features, table + lookups, valid );
otl_script_list_validate( table + scripts, table + features, valid ); otl_script_list_validate( table + scripts, table + features, valid );
} }

View File

@ -26,6 +26,7 @@ OTL_BEGIN_HEADER
OTL_LOCAL( void ) OTL_LOCAL( void )
otl_gpos_subtable_validate( OTL_Bytes table, otl_gpos_subtable_validate( OTL_Bytes table,
OTL_UInt lookup_count,
OTL_UInt glyph_count, OTL_UInt glyph_count,
OTL_Validator valid ); OTL_Validator valid );

View File

@ -66,6 +66,7 @@
static void static void
otl_jstf_max_validate( OTL_Bytes table, otl_jstf_max_validate( OTL_Bytes table,
OTL_UInt lookup_count,
OTL_UInt glyph_count, OTL_UInt glyph_count,
OTL_Validator valid ) OTL_Validator valid )
{ {
@ -80,8 +81,8 @@
/* scan subtable records */ /* scan subtable records */
for ( ; num_lookups > 0; num_lookups-- ) for ( ; num_lookups > 0; num_lookups-- )
/* XXX: check lookup types? */ /* XXX: check lookup types? */
otl_gpos_subtable_validate( table + OTL_NEXT_USHORT( p ), glyph_count, otl_gpos_subtable_validate( table + OTL_NEXT_USHORT( p ),
valid ); lookup_count, glyph_count, valid );
} }
@ -123,7 +124,8 @@
/* shrinkage JSTF max */ /* shrinkage JSTF max */
val = OTL_NEXT_USHORT( p ); val = OTL_NEXT_USHORT( p );
if ( val ) if ( val )
otl_jstf_max_validate( table + val, glyph_count, valid ); otl_jstf_max_validate( table + val, gpos_lookup_count, glyph_count,
valid );
/* extension GSUB enable/disable */ /* extension GSUB enable/disable */
val = OTL_NEXT_USHORT( p ); val = OTL_NEXT_USHORT( p );
@ -150,7 +152,8 @@
/* extension JSTF max */ /* extension JSTF max */
val = OTL_NEXT_USHORT( p ); val = OTL_NEXT_USHORT( p );
if ( val ) if ( val )
otl_jstf_max_validate( table + val, glyph_count, valid ); otl_jstf_max_validate( table + val, gpos_lookup_count, glyph_count,
valid );
} }

View File

@ -8,7 +8,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ;
if $(FT2_MULTI) if $(FT2_MULTI)
{ {
_sources = sfobjs sfdriver ttcmap0 ttpost ttload ttsbit ; _sources = sfobjs sfdriver ttcmap ttpost ttload ttsbit ;
} }
else else
{ {

View File

@ -3,7 +3,7 @@
# #
# Copyright 1996-2000, 2002, 2003 by # Copyright 1996-2000, 2002, 2003, 2004 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -26,7 +26,7 @@ SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))
# SFNT driver sources (i.e., C files) # SFNT driver sources (i.e., C files)
# #
SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \
$(SFNT_DIR)/ttcmap0.c \ $(SFNT_DIR)/ttcmap.c \
$(SFNT_DIR)/ttsbit.c \ $(SFNT_DIR)/ttsbit.c \
$(SFNT_DIR)/ttpost.c \ $(SFNT_DIR)/ttpost.c \
$(SFNT_DIR)/sfobjs.c \ $(SFNT_DIR)/sfobjs.c \

View File

@ -34,7 +34,7 @@
#include "ttpost.h" #include "ttpost.h"
#endif #endif
#include "ttcmap0.h" #include "ttcmap.h"
#include FT_SERVICE_GLYPH_DICT_H #include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_POSTSCRIPT_NAME_H #include FT_SERVICE_POSTSCRIPT_NAME_H

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Single object library component. */ /* Single object library component. */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003 by */ /* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -20,7 +20,7 @@
#include <ft2build.h> #include <ft2build.h>
#include "ttload.c" #include "ttload.c"
#include "ttcmap0.c" #include "ttcmap.c"
#include "sfobjs.c" #include "sfobjs.c"
#include "sfdriver.c" #include "sfdriver.c"

View File

@ -19,7 +19,7 @@
#include <ft2build.h> #include <ft2build.h>
#include "sfobjs.h" #include "sfobjs.h"
#include "ttload.h" #include "ttload.h"
#include "ttcmap0.h" #include "ttcmap.h"
#include FT_INTERNAL_SFNT_H #include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TAGS_H #include FT_TRUETYPE_TAGS_H

View File

@ -1,10 +1,10 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ttcmap0.c */ /* ttcmap.c */
/* */ /* */
/* TrueType new character mapping table (cmap) support (body). */ /* TrueType character mapping table (cmap) support (body). */
/* */ /* */
/* Copyright 2002, 2003 by */ /* Copyright 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -21,7 +21,7 @@
#include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_STREAM_H #include FT_INTERNAL_STREAM_H
#include "ttload.h" #include "ttload.h"
#include "ttcmap0.h" #include "ttcmap.h"
#include "sferrors.h" #include "sferrors.h"

View File

@ -1,10 +1,10 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ttcmap0.h */ /* ttcmap.h */
/* */ /* */
/* TrueType new character mapping table (cmap) support (specification). */ /* TrueType character mapping table (cmap) support (specification). */
/* */ /* */
/* Copyright 2002, 2003 by */ /* Copyright 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/ /***************************************************************************/
#ifndef __TTCMAP0_H__ #ifndef __TTCMAP_H__
#define __TTCMAP0_H__ #define __TTCMAP_H__
#include <ft2build.h> #include <ft2build.h>
@ -74,7 +74,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __TTCMAP0_H__ */ #endif /* __TTCMAP_H__ */
/* END */ /* END */