sr/*.c: Various minor fixes.

* src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after
variable declarations.

* src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate
unused variable.

* src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++
compiler.

* src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid
compiler warning.

* src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
This commit is contained in:
Werner Lemberg 2023-01-16 16:38:56 +01:00
parent 2692b3215b
commit 6a179ff7d5
5 changed files with 8 additions and 5 deletions

View File

@ -38,12 +38,13 @@
static hb_blob_t * static hb_blob_t *
_hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data) _hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
{ {
FT_UNUSED (face);
FT_Face ft_face = (FT_Face) user_data; FT_Face ft_face = (FT_Face) user_data;
FT_Byte *buffer; FT_Byte *buffer;
FT_ULong length = 0; FT_ULong length = 0;
FT_Error error; FT_Error error;
FT_UNUSED (face);
/* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */ /* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */
error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length); error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length);

View File

@ -156,7 +156,6 @@
{ {
FT_Bytes p = table; FT_Bytes p = table;
FT_Bytes wdc_end = table + GXV_JUST_DATA( wdc_offset_max ); FT_Bytes wdc_end = table + GXV_JUST_DATA( wdc_offset_max );
FT_UInt i;
GXV_NAME_ENTER( "just justDeltaClusters" ); GXV_NAME_ENTER( "just justDeltaClusters" );
@ -164,7 +163,7 @@
if ( limit <= wdc_end ) if ( limit <= wdc_end )
FT_INVALID_OFFSET; FT_INVALID_OFFSET;
for ( i = 0; p <= wdc_end; i++ ) while ( p <= wdc_end )
{ {
gxv_just_wdc_entry_validate( p, limit, gxvalid ); gxv_just_wdc_entry_validate( p, limit, gxvalid );
p += gxvalid->subtable_length; p += gxvalid->subtable_length;

View File

@ -90,7 +90,9 @@
#if defined( __GNUC__ ) #if defined( __GNUC__ )
#pragma GCC diagnostic push #pragma GCC diagnostic push
#ifndef __cplusplus
#pragma GCC diagnostic ignored "-Wstrict-prototypes" #pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma GCC diagnostic ignored "-Wredundant-decls" #pragma GCC diagnostic ignored "-Wredundant-decls"
#endif #endif

View File

@ -61,7 +61,7 @@
#define ENSURE_READ_BYTES( byte_size ) \ #define ENSURE_READ_BYTES( byte_size ) \
if ( p < colr->paints_start_v1 || \ if ( p < colr->paints_start_v1 || \
p > (FT_Byte*)colr->table + colr->table_size - byte_size ) \ p > (FT_Byte*)colr->table + colr->table_size - byte_size ) \
return 0; return 0
typedef enum FT_PaintFormat_Internal_ typedef enum FT_PaintFormat_Internal_

View File

@ -310,7 +310,8 @@
if ( error != FT_Err_Ok ) if ( error != FT_Err_Ok )
goto Exit; goto Exit;
doc_limit = svg->table_size - ( doc_list - (FT_Byte*)svg->table ); doc_limit = svg->table_size -
(FT_ULong)( doc_list - (FT_Byte*)svg->table );
if ( doc_offset > doc_limit || if ( doc_offset > doc_limit ||
doc_length > doc_limit - doc_offset ) doc_length > doc_limit - doc_offset )
{ {