diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-04-26 11:12:07 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-04-29 17:46:34 +0100 |
commit | c975e024efe3ce4811c167d66a8cb4e1627adcc0 (patch) | |
tree | 1784459995661336b3656f6d5a4025db2555ee33 | |
parent | 946d5e71cb0bfad95164210f85328e803a56c962 (diff) | |
download | gdk-pixbuf-c975e024efe3ce4811c167d66a8cb4e1627adcc0.tar.gz |
Avoid a compiler warning
If there are no built-in modules, the `builtin_module` variable is not
used, and the compiler will warn about it.
Since we're already using the variable inside a macro, we can just
declare it inside the macro block and save us the trouble altogether.
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 75fa26ae4..0c8e7d6ef 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -399,20 +399,14 @@ gdk_pixbuf_io_init (void) GdkPixbufModulePattern *pattern; GError *error = NULL; #endif - GdkPixbufModule *builtin_module ; - /* initialize on separate line to avoid compiler warnings in the - * common case of no compiled-in modules. - */ - builtin_module = NULL; - -#define load_one_builtin_module(format) \ - builtin_module = g_new0 (GdkPixbufModule, 1); \ - builtin_module->module_name = #format; \ - if (gdk_pixbuf_load_module_unlocked (builtin_module, NULL)) \ - file_formats = g_slist_prepend (file_formats, builtin_module);\ - else \ - g_free (builtin_module) +#define load_one_builtin_module(format) G_STMT_START { \ + GdkPixbufModule *__builtin_module = g_new0 (GdkPixbufModule, 1); \ + __builtin_module->module_name = #format; \ + if (gdk_pixbuf_load_module_unlocked (__builtin_module, NULL)) \ + file_formats = g_slist_prepend (file_formats, __builtin_module); \ + else \ + g_free (__builtin_module); } G_STMT_END #ifdef INCLUDE_ani load_one_builtin_module (ani); |