Skip to content

tracker-extract-raw.c: Fix compile warning

Sam Thursfield requested to merge sam/raw-warning-fix into master

There is some witchcraft in GLib's definition of g_clear_pointer(). The function definition is overridden by a macro in glib/gmem.h, and the macro generates this warning if we cast the 'destroy' parameter to the expected type:

[101/264] Compiling C object 'src/tracker-extract/ec38c81@@extract-raw@sha/tracker-extract-raw.c.o'.
In file included from /usr/include/glib-2.0/glib/glist.h:32,
                 from /usr/include/glib-2.0/glib/ghash.h:33,
                 from /usr/include/glib-2.0/glib.h:50,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/gexiv2/gexiv2-metadata.h:14,
                 from /usr/include/gexiv2/gexiv2.h:13,
                 from ../src/tracker-extract/tracker-extract-raw.c:24:
../src/tracker-extract/tracker-extract-raw.c: In function ‘tracker_extract_get_metadata’:
../src/tracker-extract/tracker-extract-raw.c:462:24: warning: function called through a non-compatible type
  g_clear_pointer (&ed, (GDestroyNotify) raw_exif_data_free);
                        ^

Removing the cast prevents the warning from appearing.

Merge request reports