]> code.ossystems Code Review - openembedded-core.git/blob
8ccaaa0598d7b828554676d2ab5143f6df8e1069
[openembedded-core.git] /
1 From 3164f23cd6ae338d0e423fccb4e11539cd220e2f Mon Sep 17 00:00:00 2001
2 From: Andre McCurdy <armccurdy@gmail.com>
3 Date: Tue, 9 Feb 2016 14:00:00 -0800
4 Subject: [PATCH] ensure valid sentinals for gst_structure_get() etc
5
6 For GStreamer functions declared with G_GNUC_NULL_TERMINATED,
7 ie __attribute__((__sentinel__)), gcc will generate a warning if the
8 last parameter passed to the function is not NULL (where a valid NULL
9 in this context is defined as zero with any pointer type).
10
11 The C callers to such functions within gst-plugins-bad use the C NULL
12 definition (ie ((void*)0)), which is a valid sentinel.
13
14 However the C++ NULL definition (ie 0L), is not a valid sentinel
15 without an explicit cast to a pointer type.
16
17 Upstream-Status: Pending
18
19 Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
20 ---
21  sys/decklink/gstdecklink.cpp          | 2 +-
22  sys/decklink/gstdecklinkaudiosrc.cpp  | 2 +-
23  sys/decklink/gstdecklinkvideosink.cpp | 2 +-
24  3 files changed, 3 insertions(+), 3 deletions(-)
25
26 diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp
27 index c0d1128..6f2ef75 100644
28 --- a/sys/decklink/gstdecklink.cpp
29 +++ b/sys/decklink/gstdecklink.cpp
30 @@ -328,7 +328,7 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e)
31        "interlace-mode", G_TYPE_STRING,
32        mode->interlaced ? "interleaved" : "progressive", "pixel-aspect-ratio",
33        GST_TYPE_FRACTION, mode->par_n, mode->par_d, "colorimetry", G_TYPE_STRING,
34 -      mode->colorimetry, "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
35 +      mode->colorimetry, "chroma-site", G_TYPE_STRING, "mpeg2", (void *) NULL);
36  }
37  
38  GstCaps *
39 diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
40 index e5ac8ae..a153851 100644
41 --- a/sys/decklink/gstdecklinkaudiosrc.cpp
42 +++ b/sys/decklink/gstdecklinkaudiosrc.cpp
43 @@ -312,7 +312,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
44        g_mutex_unlock (&self->input->lock);
45  
46        if (videosrc) {
47 -        g_object_get (videosrc, "connection", &vconn, NULL);
48 +        g_object_get (videosrc, "connection", &vconn, (void *) NULL);
49          gst_object_unref (videosrc);
50  
51          switch (vconn) {
52 diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
53 index 7111cb1..b958fda 100644
54 --- a/sys/decklink/gstdecklinkvideosink.cpp
55 +++ b/sys/decklink/gstdecklinkvideosink.cpp
56 @@ -158,7 +158,7 @@ reset_framerate (GstCapsFeatures * features, GstStructure * structure,
57      gpointer user_data)
58  {
59    gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
60 -      G_MAXINT, 1, NULL);
61 +      G_MAXINT, 1, (void *) NULL);
62  
63    return TRUE;
64  }
65 -- 
66 1.9.1
67