fix some clang warnings
This commit is contained in:
parent
5fce021c17
commit
54dcea8c3d
@ -635,7 +635,7 @@ vips_icc_export_build( VipsObject *object )
|
||||
if( !vips_object_argument_isset( object, "pcs" ) &&
|
||||
code->in &&
|
||||
code->in->Type == VIPS_INTERPRETATION_XYZ )
|
||||
icc->pcs = VIPS_INTERPRETATION_XYZ;
|
||||
icc->pcs = VIPS_PCS_XYZ;
|
||||
|
||||
if( icc->pcs == VIPS_PCS_LAB ) {
|
||||
#ifdef HAVE_LCMS2
|
||||
|
@ -48,7 +48,8 @@
|
||||
static VipsFormatFlags
|
||||
analyze_flags( const char *filename )
|
||||
{
|
||||
return( vips_foreign_flags( "analyzeload", filename ) );
|
||||
return( (VipsFormatFlags)
|
||||
vips_foreign_flags( "analyzeload", filename ) );
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -74,7 +74,8 @@ exr_flags( const char *name )
|
||||
|
||||
im_filename_split( name, filename, mode );
|
||||
|
||||
return( vips_foreign_flags( "openexrload", filename ) );
|
||||
return( (VipsFormatFlags)
|
||||
vips_foreign_flags( "openexrload", filename ) );
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -110,7 +110,8 @@ openslide_flags( const char *name )
|
||||
|
||||
im_filename_split( name, filename, mode );
|
||||
|
||||
return( vips_foreign_flags( "openslideload", filename ) );
|
||||
return( (VipsFormatFlags)
|
||||
vips_foreign_flags( "openslideload", filename ) );
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -63,7 +63,8 @@ isppm( const char *filename )
|
||||
static VipsFormatFlags
|
||||
ppm_flags( const char *filename )
|
||||
{
|
||||
return( vips_foreign_flags( "ppmload", filename ) );
|
||||
return( (VipsFormatFlags)
|
||||
vips_foreign_flags( "ppmload", filename ) );
|
||||
}
|
||||
|
||||
static const char *ppm_suffs[] = { ".ppm", ".pgm", ".pbm", ".pfm", NULL };
|
||||
|
@ -132,7 +132,8 @@ tiff_flags( const char *name )
|
||||
|
||||
im_filename_split( name, filename, mode );
|
||||
|
||||
return( vips_foreign_flags( "tiffload", filename ) );
|
||||
return( (VipsFormatFlags)
|
||||
vips_foreign_flags( "tiffload", filename ) );
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -67,7 +67,7 @@ G_DEFINE_TYPE( VipsForeignLoadPpm, vips_foreign_load_ppm,
|
||||
static VipsForeignFlags
|
||||
vips_foreign_load_ppm_get_flags_filename( const char *filename )
|
||||
{
|
||||
return( vips__ppm_flags( filename ) );
|
||||
return( (VipsForeignFlags) vips__ppm_flags( filename ) );
|
||||
}
|
||||
|
||||
static VipsForeignFlags
|
||||
|
@ -186,7 +186,7 @@ read_image( Read *read, VipsImage *out )
|
||||
{
|
||||
VipsImage **t = (VipsImage **)
|
||||
vips_object_local_array( VIPS_OBJECT( out ), 3 );
|
||||
guint64 length;
|
||||
gint64 length;
|
||||
void *data;
|
||||
int fd;
|
||||
webp_decoder decoder;
|
||||
|
@ -86,12 +86,15 @@ void *vips_foreign_map( const char *base,
|
||||
VipsSListMap2Fn fn, void *a, void *b );
|
||||
|
||||
/* Image file load properties.
|
||||
*
|
||||
* Keep in sync with the deprecated VipsFormatFlags, we need to be able to
|
||||
* cast between them.
|
||||
*/
|
||||
typedef enum /*< flags >*/ {
|
||||
VIPS_FOREIGN_NONE = 0, /* No flags set */
|
||||
VIPS_FOREIGN_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */
|
||||
VIPS_FOREIGN_SEQUENTIAL = 2, /* Top-to-bottom lazy read OK */
|
||||
VIPS_FOREIGN_BIGENDIAN = 4, /* Most-significant byte first */
|
||||
VIPS_FOREIGN_BIGENDIAN = 2, /* Most-significant byte first */
|
||||
VIPS_FOREIGN_SEQUENTIAL = 4, /* Top-to-bottom lazy read OK */
|
||||
VIPS_FOREIGN_ALL = 7 /* All flags set */
|
||||
} VipsForeignFlags;
|
||||
|
||||
|
@ -235,7 +235,7 @@ typedef struct _VipsImage {
|
||||
* file start. Usually VIPS_SIZEOF_HEADER, but can be something else
|
||||
* for binary file read.
|
||||
*
|
||||
* gint64 so that we can guarantee to work even on systems with
|
||||
* guint64 so that we can guarantee to work even on systems with
|
||||
* strange ideas about large files.
|
||||
*/
|
||||
guint64 sizeof_header;
|
||||
|
@ -14,8 +14,8 @@ vips_foreign_flags_get_type( void )
|
||||
static const GFlagsValue values[] = {
|
||||
{VIPS_FOREIGN_NONE, "VIPS_FOREIGN_NONE", "none"},
|
||||
{VIPS_FOREIGN_PARTIAL, "VIPS_FOREIGN_PARTIAL", "partial"},
|
||||
{VIPS_FOREIGN_SEQUENTIAL, "VIPS_FOREIGN_SEQUENTIAL", "sequential"},
|
||||
{VIPS_FOREIGN_BIGENDIAN, "VIPS_FOREIGN_BIGENDIAN", "bigendian"},
|
||||
{VIPS_FOREIGN_SEQUENTIAL, "VIPS_FOREIGN_SEQUENTIAL", "sequential"},
|
||||
{VIPS_FOREIGN_ALL, "VIPS_FOREIGN_ALL", "all"},
|
||||
{0, NULL, NULL}
|
||||
};
|
||||
|
@ -879,9 +879,9 @@ vips_image_build( VipsObject *object )
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
/* Check parameters.
|
||||
/* Ban crazy numbers.
|
||||
*/
|
||||
if( image->sizeof_header < 0 ) {
|
||||
if( image->sizeof_header > 1000000 ) {
|
||||
vips_error( "VipsImage", "%s", _( "bad parameters" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user