@@ -254,34 +254,32 @@ vips_get_prgname( void )
254
254
255
255
#ifdef ENABLE_MODULES
256
256
/* Load all plugins in a directory ... look for '.<G_MODULE_SUFFIX>' or
257
- * '.plg' (deprecated) suffix. Error if we had any probs.
257
+ * '.plg' (deprecated) suffix.
258
258
*/
259
- static int
259
+ static void
260
260
vips_load_plugins ( const char * fmt , ... )
261
261
{
262
262
va_list ap ;
263
263
char dir_name [VIPS_PATH_MAX ];
264
264
GDir * dir ;
265
265
const char * name ;
266
- int result ;
267
266
268
- /* Silently succeed if we can 't do modules .
267
+ /* Do nothing if modules aren 't supported .
269
268
*/
270
269
if ( !g_module_supported () )
271
- return ( 0 ) ;
270
+ return ;
272
271
273
272
va_start ( ap , fmt );
274
273
(void ) vips_vsnprintf ( dir_name , VIPS_PATH_MAX - 1 , fmt , ap );
275
274
va_end ( ap );
276
275
277
276
g_info ( "searching \"%s\"" , dir_name );
278
277
279
- if ( !( dir = g_dir_open ( dir_name , 0 , NULL )) )
280
- /* Silent success for dir not there.
281
- */
282
- return ( 0 ) ;
278
+ /* Do nothing if directory is not present.
279
+ */
280
+ if ( !( dir = g_dir_open ( dir_name , 0 , NULL )) )
281
+ return ;
283
282
284
- result = 0 ;
285
283
while ( (name = g_dir_read_name ( dir )) )
286
284
if ( vips_ispostfix ( name , "." G_MODULE_SUFFIX )
287
285
#if ENABLE_DEPRECATED
@@ -297,20 +295,17 @@ vips_load_plugins( const char *fmt, ... )
297
295
g_info ( "loading \"%s\"" , path );
298
296
299
297
module = g_module_open ( path , G_MODULE_BIND_LAZY );
300
- if ( !module ) {
298
+ if ( module )
299
+ /* Modules will almost certainly create new
300
+ * types, so they can't be unloaded.
301
+ */
302
+ g_module_make_resident ( module );
303
+ else
301
304
g_warning ( _ ( "unable to load \"%s\" -- %s" ),
302
305
path , g_module_error () );
303
- result = -1 ;
304
- }
305
306
306
- /* Modules will almost certainly create new types, so
307
- * they can't be unloaded.
308
- */
309
- g_module_make_resident ( module );
310
307
}
311
308
g_dir_close ( dir );
312
-
313
- return ( result );
314
309
}
315
310
#endif /*ENABLE_MODULES*/
316
311
@@ -611,13 +606,13 @@ vips_init( const char *argv0 )
611
606
* modules, or we might try loading an operation into a library that
612
607
* already has that operation built in.
613
608
*/
614
- ( void ) vips_load_plugins ( "%s/vips-modules-%d.%d" ,
609
+ vips_load_plugins ( "%s/vips-modules-%d.%d" ,
615
610
libdir , VIPS_MAJOR_VERSION , VIPS_MINOR_VERSION );
616
611
617
612
#if ENABLE_DEPRECATED
618
613
/* Load any vips8 plugins from the vips libdir.
619
614
*/
620
- ( void ) vips_load_plugins ( "%s/vips-plugins-%d.%d" ,
615
+ vips_load_plugins ( "%s/vips-plugins-%d.%d" ,
621
616
libdir , VIPS_MAJOR_VERSION , VIPS_MINOR_VERSION );
622
617
623
618
/* Load up any vips7 plugins in the vips libdir. We don't error on
0 commit comments