Commit ec7afb6f authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

Correct all relevant warnings found by the sparse semantic code analyzer. This...

Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...

Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
parent f61c20f1
2008-03-03 Sebastian Dröge <slomo@circular-chaos.org>
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-02 Tim-Philipp Müller <tim at centricular dot net>
 
Patch by: José Alburquerque <jaalburqu svn gnome org>
......@@ -47,7 +47,7 @@ gst_alsa_mixer_track_get_type (void)
sizeof (GstAlsaMixerTrack),
0,
(GInstanceInitFunc) gst_alsa_mixer_track_init,
0
NULL
};
track_type =
......
......@@ -371,7 +371,7 @@ retry:
no_channels);
/* set the stream rate */
rrate = alsa->rate;
CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, 0),
CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, NULL),
no_rate);
if (rrate != alsa->rate)
goto rate_match;
......
......@@ -363,7 +363,7 @@ set_hwparams (GstAlsaSrc * alsa)
no_channels);
/* set the stream rate */
rrate = alsa->rate;
CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, 0),
CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, NULL),
no_rate);
if (rrate != alsa->rate)
goto rate_match;
......
......@@ -127,7 +127,7 @@ gst_gio_uri_handler_get_uri (GstURIHandler * handler)
GstElement *element = GST_ELEMENT (handler);
const gchar *uri;
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_object_get (G_OBJECT (element), "location", &uri, NULL);
......
......@@ -122,6 +122,8 @@ struct _GstOggMuxClass
GstElementClass parent_class;
};
GType gst_ogg_mux_get_type (void);
G_END_DECLS
#endif /* __GST_OGG_MUX_H__ */
......@@ -231,7 +231,7 @@ gst_ogm_audio_parse_get_type (void)
return ogm_audio_parse_type;
}
GType
static GType
gst_ogm_video_parse_get_type (void)
{
static GType ogm_video_parse_type = 0;
......@@ -257,7 +257,7 @@ gst_ogm_video_parse_get_type (void)
return ogm_video_parse_type;
}
GType
static GType
gst_ogm_text_parse_get_type (void)
{
static GType ogm_text_parse_type = 0;
......
......@@ -239,6 +239,7 @@ typedef enum
GST_AUDIO_FIELD_SIGNED = (1 << 5),
} GstAudioFieldFlag;
#endif /* GST_DISABLE_DEPRECATED */
void
gst_audio_structure_set_int (GstStructure * structure, GstAudioFieldFlag flag)
{
......
......@@ -344,6 +344,8 @@ kiss_fft_f64_cfg
kiss_fft_f64_alloc (int nfft, int inverse_fft, void *mem, size_t * lenmem)
{
kiss_fft_f64_cfg st = NULL;
const double pi =
3.141592653589793238462643383279502884197169399375105820974944;
size_t memneeded = sizeof (struct kiss_fft_f64_state)
+ sizeof (kiss_fft_f64_cpx) * (nfft - 1); /* twiddle factors */
......@@ -361,8 +363,6 @@ kiss_fft_f64_alloc (int nfft, int inverse_fft, void *mem, size_t * lenmem)
st->inverse = inverse_fft;
for (i = 0; i < nfft; ++i) {
const double pi =
3.141592653589793238462643383279502884197169399375105820974944;
double phase = -2 * pi * i / nfft;
if (st->inverse)
......
......@@ -202,9 +202,9 @@ gst_missing_uri_sink_message_new (GstElement * element, const gchar * protocol)
GstStructure *s;
gchar *description;
g_return_val_if_fail (element != NULL, FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (protocol != NULL, FALSE);
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (protocol != NULL, NULL);
description = gst_pb_utils_get_sink_description (protocol);
......@@ -235,9 +235,9 @@ gst_missing_element_message_new (GstElement * element,
GstStructure *s;
gchar *description;
g_return_val_if_fail (element != NULL, FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (factory_name != NULL, FALSE);
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (factory_name != NULL, NULL);
description = gst_pb_utils_get_element_description (factory_name);
......@@ -268,13 +268,13 @@ gst_missing_decoder_message_new (GstElement * element,
GstCaps *caps;
gchar *description;
g_return_val_if_fail (element != NULL, FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (decode_caps != NULL, FALSE);
g_return_val_if_fail (GST_IS_CAPS (decode_caps), FALSE);
g_return_val_if_fail (!gst_caps_is_any (decode_caps), FALSE);
g_return_val_if_fail (!gst_caps_is_empty (decode_caps), FALSE);
g_return_val_if_fail (gst_caps_is_fixed (decode_caps), FALSE);
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (decode_caps != NULL, NULL);
g_return_val_if_fail (GST_IS_CAPS (decode_caps), NULL);
g_return_val_if_fail (!gst_caps_is_any (decode_caps), NULL);
g_return_val_if_fail (!gst_caps_is_empty (decode_caps), NULL);
g_return_val_if_fail (gst_caps_is_fixed (decode_caps), NULL);
description = gst_pb_utils_get_decoder_description (decode_caps);
caps = copy_and_clean_caps (decode_caps);
......@@ -308,13 +308,13 @@ gst_missing_encoder_message_new (GstElement * element,
GstCaps *caps;
gchar *description;
g_return_val_if_fail (element != NULL, FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (encode_caps != NULL, FALSE);
g_return_val_if_fail (GST_IS_CAPS (encode_caps), FALSE);
g_return_val_if_fail (!gst_caps_is_any (encode_caps), FALSE);
g_return_val_if_fail (!gst_caps_is_empty (encode_caps), FALSE);
g_return_val_if_fail (gst_caps_is_fixed (encode_caps), FALSE);
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (encode_caps != NULL, NULL);
g_return_val_if_fail (GST_IS_CAPS (encode_caps), NULL);
g_return_val_if_fail (!gst_caps_is_any (encode_caps), NULL);
g_return_val_if_fail (!gst_caps_is_empty (encode_caps), NULL);
g_return_val_if_fail (gst_caps_is_fixed (encode_caps), NULL);
description = gst_pb_utils_get_encoder_description (encode_caps);
caps = copy_and_clean_caps (encode_caps);
......
......@@ -438,7 +438,7 @@ gst_basertppayload_set_options (GstBaseRTPPayload * payload,
payload->clock_rate = clock_rate;
}
gboolean
static gboolean
copy_fixed (GQuark field_id, const GValue * value, GstStructure * dest)
{
if (gst_value_is_fixed (value)) {
......
......@@ -1533,7 +1533,7 @@ gst_rtcp_packet_bye_get_reason (GstRTCPPacket * packet)
guint8 len;
g_return_val_if_fail (packet != NULL, NULL);
g_return_val_if_fail (packet->type == GST_RTCP_TYPE_BYE, 0);
g_return_val_if_fail (packet->type == GST_RTCP_TYPE_BYE, NULL);
g_return_val_if_fail (GST_IS_BUFFER (packet->buffer), NULL);
roffset = get_reason_offset (packet);
......
......@@ -723,7 +723,7 @@ static const GstAudioChannelPosition default_positions[8][8] = {
}
};
const GValue *
static const GValue *
find_suitable_channel_layout (const GValue * val, guint chans)
{
/* if output layout is fixed already and looks sane, we're done */
......
......@@ -50,7 +50,7 @@
#include <gst/audio/audio.h>
#include <gst/base/gstbasetransform.h>
GST_DEBUG_CATEGORY (audioresample_debug);
GST_DEBUG_CATEGORY_STATIC (audioresample_debug);
#define GST_CAT_DEFAULT audioresample_debug
/* elementfactory information */
......
......@@ -439,7 +439,8 @@ avcodec_get_pix_fmt (const char *name)
return pix_fmt_info[i].format;
}
int
#if 0
static int
avpicture_layout (const AVPicture * src, int pix_fmt, int width, int height,
unsigned char *dest, int dest_size)
{
......@@ -490,6 +491,7 @@ avpicture_layout (const AVPicture * src, int pix_fmt, int width, int height,
return size;
}
#endif
int
avpicture_get_size (int pix_fmt, int width, int height)
......@@ -670,7 +672,7 @@ img_copy_plane (uint8_t * dst, int dst_wrap,
/**
* Copy image 'src' to 'dst'.
*/
void
static void
img_copy (AVPicture * dst, const AVPicture * src,
int pix_fmt, int width, int height)
{
......@@ -2198,7 +2200,7 @@ get_convert_table_entry (int src_pix_fmt, int dst_pix_fmt)
return NULL;
}
int
static int
avpicture_alloc (AVPicture * picture, int pix_fmt, int width, int height)
{
unsigned int size;
......@@ -2215,7 +2217,7 @@ fail:
return -1;
}
void
static void
avpicture_free (AVPicture * picture)
{
av_free (picture->data[0]);
......@@ -2593,6 +2595,7 @@ img_get_alpha_info (const AVPicture * src, int pix_fmt, int width, int height)
#endif
/* filter parameters: [-1 4 2 4 -1] // 8 */
#if 0
static void
deinterlace_line (uint8_t * dst,
const uint8_t * lum_m4, const uint8_t * lum_m3,
......@@ -2684,10 +2687,12 @@ deinterlace_line_inplace (uint8_t * lum_m4, uint8_t * lum_m3, uint8_t * lum_m2,
}
#endif
}
#endif
/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
top field is copied as is, but the bottom field is deinterlaced
against the top field. */
#if 0
static void
deinterlace_bottom_field (uint8_t * dst, int dst_wrap,
const uint8_t * src1, int src_wrap, int width, int height)
......@@ -2743,10 +2748,11 @@ deinterlace_bottom_field_inplace (uint8_t * src1, int src_wrap,
deinterlace_line_inplace (buf, src_m1, src_0, src_0, src_0, width);
av_free (buf);
}
#endif
/* deinterlace - if not supported return -1 */
int
#if 0
static int
avpicture_deinterlace (AVPicture * dst, const AVPicture * src,
int pix_fmt, int width, int height)
{
......@@ -2789,5 +2795,6 @@ avpicture_deinterlace (AVPicture * dst, const AVPicture * src,
#endif
return 0;
}
#endif
#undef FIX
......@@ -27,7 +27,7 @@
static GMainLoop *loop;
static GstElement *
gen_video_element ()
gen_video_element (void)
{
GstElement *element;
GstElement *conv;
......@@ -50,7 +50,7 @@ gen_video_element ()
}
static GstElement *
gen_audio_element ()
gen_audio_element (void)
{
GstElement *element;
GstElement *conv;
......
......@@ -1421,7 +1421,7 @@ static GstStaticCaps mpegts_caps = GST_STATIC_CAPS ("video/mpegts, "
/* Helper function to search ahead at intervals of packet_size for mpegts
* headers */
gint
static gint
mpeg_ts_probe_headers (GstTypeFind * tf, guint64 offset, gint packet_size)
{
/* We always enter this function having found at least one header already */
......
......@@ -28,6 +28,8 @@
#include "vs_image.h"
#include "vs_scanline.h"
#include "vs_4tap.h"
#include <liboil/liboil.h>
#include <math.h>
......@@ -45,9 +47,9 @@
#define rint(x) (floor((x)+0.5))
#endif
int16_t vs_4tap_taps[256][4];
static int16_t vs_4tap_taps[256][4];
double
static double
vs_4tap_func (double x)
{
#if 0
......
......@@ -34,7 +34,7 @@
void vs_4tap_init (void);
void vs_scanline_resample_4tap_Y (uint8_t *dest, uint8_t *src,
int n, int *xacc, int increment);
int n, int src_width, int *xacc, int increment);
void vs_scanline_merge_4tap_Y (uint8_t *dest, uint8_t *src1, uint8_t *src2,
uint8_t *src3, uint8_t *src4, int n, int acc);
void vs_image_scale_4tap_Y (const VSImage * dest, const VSImage * src,
......
......@@ -245,7 +245,7 @@ gst_v4l_property_probe_interface_init (GstPropertyProbeInterface * iface)
}
#define GST_TYPE_V4L_DEVICE_FLAGS (gst_v4l_device_get_type ())
GType
static GType
gst_v4l_device_get_type (void)
{
static GType v4l_device_type = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment