discoverer: add casts to avoid warnings in osx builds
authorJosep Torra <jtorra@oblong.com>
Thu, 21 Mar 2019 16:21:30 +0000 (17:21 +0100)
committerJosep Torra <jtorra@oblong.com>
Thu, 21 Mar 2019 16:21:30 +0000 (17:21 +0100)
Fix the following warnings by adding casts.

gstdiscoverer.c:1801:17: error: format specifies type 'unsigned long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
      location, file_status.st_size, file_status.st_mtime);
                ^~~~~~~~~~~~~~~~~~~
gstdiscoverer.c:1801:38: error: format specifies type 'long long' but the argument has type '__darwin_time_t' (aka 'long') [-Werror,-Wformat]
      location, file_status.st_size, file_status.st_mtime);

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/570

gst-libs/gst/pbutils/gstdiscoverer.c

index 1bf5b8d..633aebe 100644 (file)
@@ -1798,7 +1798,7 @@ _serialized_info_get_path (GstDiscoverer * dc, gchar * uri)
   }
 
   tmp = g_strdup_printf ("%s-%" G_GSIZE_FORMAT "-%" G_GINT64_FORMAT,
-      location, file_status.st_size, file_status.st_mtime);
+      location, (gsize) file_status.st_size, (gint64) file_status.st_mtime);
   cs = g_checksum_new (G_CHECKSUM_SHA1);
   g_checksum_update (cs, (const guchar *) tmp, strlen (tmp));
   checksum = g_checksum_get_string (cs);