fix a few more function casts

see

https://github.com/libvips/libvips/pull/1697#issuecomment-657602404
This commit is contained in:
John Cupitt 2020-07-14 10:25:35 +01:00
parent ad16b87a75
commit 5739ba12eb
2 changed files with 14 additions and 7 deletions

View File

@ -218,13 +218,20 @@ typedef struct _VipsGsfDirectory {
} VipsGsfDirectory; } VipsGsfDirectory;
static void *vips_gsf_tree_close( VipsGsfDirectory *tree );
static void *
vips_gsf_tree_close_cb( VipsGsfDirectory *tree, void *a, void *b )
{
return( vips_gsf_tree_close( tree ) );
}
/* Close all dirs, non-NULL on error. /* Close all dirs, non-NULL on error.
*/ */
static void * static void *
vips_gsf_tree_close( VipsGsfDirectory *tree ) vips_gsf_tree_close( VipsGsfDirectory *tree )
{ {
vips_slist_map2( tree->children, vips_slist_map2( tree->children, vips_gsf_tree_close_cb, NULL, NULL );
(VipsSListMap2Fn) vips_gsf_tree_close, NULL, NULL );
if( tree->out ) { if( tree->out ) {
if( !gsf_output_is_closed( tree->out ) && if( !gsf_output_is_closed( tree->out ) &&

View File

@ -109,7 +109,7 @@ static char *main_option_plugin = NULL;
static gboolean main_option_version; static gboolean main_option_version;
static void * static void *
list_class( GType type ) list_class( GType type, void *user_data )
{ {
VipsObjectClass *class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) ); VipsObjectClass *class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) );
int depth = vips_type_depth( type ); int depth = vips_type_depth( type );
@ -156,7 +156,7 @@ parse_main_option_list( const gchar *option_name, const gchar *value,
g_type_from_name( "VipsObject" ), g_type_from_name( "VipsObject" ),
test_nickname, (void *) value )) ) { test_nickname, (void *) value )) ) {
vips_type_map_all( G_TYPE_FROM_CLASS( class ), vips_type_map_all( G_TYPE_FROM_CLASS( class ),
(VipsTypeMapFn) list_class, NULL ); list_class, NULL );
} }
else if( value ) { else if( value ) {
vips_error( g_get_prgname(), vips_error( g_get_prgname(),
@ -167,7 +167,7 @@ parse_main_option_list( const gchar *option_name, const gchar *value,
} }
else { else {
vips_type_map_all( g_type_from_name( "VipsOperation" ), vips_type_map_all( g_type_from_name( "VipsOperation" ),
(VipsTypeMapFn) list_class, NULL ); list_class, NULL );
} }
exit( 0 ); exit( 0 );
@ -261,11 +261,11 @@ print_list( int argc, char **argv )
if( !argv[0] || strcmp( argv[0], "classes" ) == 0 ) if( !argv[0] || strcmp( argv[0], "classes" ) == 0 )
#endif #endif
vips_type_map_all( g_type_from_name( "VipsObject" ), vips_type_map_all( g_type_from_name( "VipsObject" ),
(VipsTypeMapFn) list_class, NULL ); list_class, NULL );
else if( g_type_from_name( argv[0] ) && else if( g_type_from_name( argv[0] ) &&
g_type_is_a( g_type_from_name( argv[0] ), VIPS_TYPE_OBJECT ) ) { g_type_is_a( g_type_from_name( argv[0] ), VIPS_TYPE_OBJECT ) ) {
vips_type_map_all( g_type_from_name( argv[0] ), vips_type_map_all( g_type_from_name( argv[0] ),
(VipsTypeMapFn) list_class, NULL ); list_class, NULL );
} }
else { else {
#if ENABLE_DEPRECATED #if ENABLE_DEPRECATED