misc: Fix various compiler warnings on MinGW
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 5 Feb 2019 12:48:48 +0000 (18:18 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Tue, 5 Feb 2019 13:15:54 +0000 (18:45 +0530)
gstharness.c: Use G_GSIZE_FORMAT instead of hard-coding %zu
error: unknown conversion type character 'z' in format [-Werror=format]

gst-inspect.c: GPid is void* on non-UNIX, and we only use it on UNIX
error: initialization makes pointer from integer without a cast [-Werror]

gstmeta.c: Use and then discard value
error: value computed is not used [-Werror=unused-value]

With this, gstreamer builds with -Werror on MinGW

libs/gst/check/gstharness.c
tests/check/gst/gstmeta.c
tools/gst-inspect.c

index e7a78e6..b276100 100644 (file)
@@ -1555,7 +1555,8 @@ gst_harness_create_buffer (GstHarness * h, gsize size)
     g_assert_cmpint (flow, ==, GST_FLOW_OK);
     if (gst_buffer_get_size (ret) != size) {
       GST_DEBUG_OBJECT (h,
-          "use fallback, pool is configured with a different size (%zu != %zu)",
+          "use fallback, pool is configured with a different size (%"
+          G_GSIZE_FORMAT " != %" G_GSIZE_FORMAT ")",
           size, gst_buffer_get_size (ret));
       gst_buffer_unref (ret);
       ret = NULL;
index e5ad47d..9e96bf7 100644 (file)
@@ -182,7 +182,7 @@ foo_transform_func (GstBuffer * transbuf, GstMeta * meta,
       g_quark_to_string (type), buffer, transbuf, meta);
 
   if (GST_META_TRANSFORM_IS_COPY (type)) {
-    GST_META_FOO_ADD (transbuf);
+    G_GNUC_UNUSED GstMetaFoo *unused = GST_META_FOO_ADD (transbuf);
   } else {
     /* return FALSE, if transform type is not supported */
     return FALSE;
index 527d87f..823e82b 100644 (file)
@@ -51,7 +51,9 @@
 
 gboolean colored_output = TRUE;
 
+#ifdef G_OS_UNIX
 GPid child_pid = -1;
+#endif
 GMainLoop *loop = NULL;
 
 /* Console colors */