From febfabb39f3eacee28021d8b216e4c5d2db08064 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 5 Feb 2019 18:18:48 +0530 Subject: [PATCH] misc: Fix various compiler warnings on MinGW 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 | 3 ++- tests/check/gst/gstmeta.c | 2 +- tools/gst-inspect.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c index e7a78e63ac..b2761004a1 100644 --- a/libs/gst/check/gstharness.c +++ b/libs/gst/check/gstharness.c @@ -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; diff --git a/tests/check/gst/gstmeta.c b/tests/check/gst/gstmeta.c index e5ad47d2df..9e96bf767f 100644 --- a/tests/check/gst/gstmeta.c +++ b/tests/check/gst/gstmeta.c @@ -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; diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 527d87f4e9..823e82b617 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -51,7 +51,9 @@ gboolean colored_output = TRUE; +#ifdef G_OS_UNIX GPid child_pid = -1; +#endif GMainLoop *loop = NULL; /* Console colors */