diff options
author | Benjamin Otte <otte@redhat.com> | 2010-03-25 19:24:27 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-03-25 19:24:27 +0100 |
commit | 38d3390e0057e19db13eddc8d1dffa9966573d96 (patch) | |
tree | 2e46af7ddba1be82f3d9d67101968098d963dde9 | |
parent | f30ef6fd439ecf8afaa2262e91398a255efa886f (diff) |
Add swfdec's warning flags
And fix all warnings
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | ext/pango/gstpangotimeoverlay.c | 12 | ||||
-rw-r--r-- | ext/xlib/gstcairoglxsink.c | 10 | ||||
-rw-r--r-- | ext/xlib/gstcairoxsink.c | 4 | ||||
-rw-r--r-- | gst-libs/gst/cairo/gstcairoformat.c | 1 | ||||
-rw-r--r-- | gst/cairo/gstcairomixer.c | 14 | ||||
-rw-r--r-- | gst/cairo/gstcairomixerpad.c | 26 | ||||
-rw-r--r-- | gst/cairo/gstcairopuzzle.c | 7 | ||||
-rw-r--r-- | gst/cairo/gstcairotestsrc.c | 16 |
9 files changed, 52 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac index c316f97..2b0194c 100644 --- a/configure.ac +++ b/configure.ac @@ -186,7 +186,7 @@ dnl set location of plugin directory AG_GST_SET_PLUGINDIR dnl define an ERROR_CFLAGS Makefile variable -AG_GST_SET_ERROR_CFLAGS($GST_CVS) +AG_GST_SET_ERROR_CFLAGS($GST_CVS, [-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs -Wunsafe-loop-optimizations -Wpacked -Winvalid-pch -Wsync-nand]) AG_GST_SET_ERROR_CXXFLAGS($GST_CVS) dnl define correct level for debugging messages @@ -245,8 +245,8 @@ fi AC_SUBST(DEPRECATED_CFLAGS) dnl every flag in GST_OPTION_CFLAGS can be overridden at make time -GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" -GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" +GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" +GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" AC_SUBST(GST_OPTION_CFLAGS) AC_SUBST(GST_OPTION_CXXFLAGS) diff --git a/ext/pango/gstpangotimeoverlay.c b/ext/pango/gstpangotimeoverlay.c index a3177c8..50b8739 100644 --- a/ext/pango/gstpangotimeoverlay.c +++ b/ext/pango/gstpangotimeoverlay.c @@ -71,17 +71,17 @@ gst_pango_time_overlay_get_unit_size (GstBaseTransform * btrans, GstCaps * caps, } static gchar * -gst_pango_time_overlay_format_time (GstClockTime time) +gst_pango_time_overlay_format_time (GstClockTime clocktime) { guint hours, mins, secs, msecs; - if (!GST_CLOCK_TIME_IS_VALID (time)) + if (!GST_CLOCK_TIME_IS_VALID (clocktime)) return g_strdup (""); - hours = (guint) (time / (GST_SECOND * 60 * 60)); - mins = (guint) ((time / (GST_SECOND * 60)) % 60); - secs = (guint) ((time / GST_SECOND) % 60); - msecs = (guint) ((time % GST_SECOND) / (1000 * 1000)); + hours = (guint) (clocktime / (GST_SECOND * 60 * 60)); + mins = (guint) ((clocktime / (GST_SECOND * 60)) % 60); + secs = (guint) ((clocktime / GST_SECOND) % 60); + msecs = (guint) ((clocktime % GST_SECOND) / (1000 * 1000)); return g_strdup_printf ("%u:%02u:%02u.%03u", hours, mins, secs, msecs); } diff --git a/ext/xlib/gstcairoglxsink.c b/ext/xlib/gstcairoglxsink.c index 9d8638e..f08c921 100644 --- a/ext/xlib/gstcairoglxsink.c +++ b/ext/xlib/gstcairoglxsink.c @@ -36,6 +36,12 @@ #include "gstcairoglxsink.h" +/* Behdad... */ +#include <cairo-features.h> +#ifndef CAIRO_HAS_EGL_FUNCTIONS +#define CAIRO_HAS_EGL_FUNCTIONS 0 +#endif + #include <cairo-gl.h> #include <gst/interfaces/navigation.h> @@ -160,10 +166,10 @@ gst_cairo_glx_sink_handle_event (XEvent * event, gpointer sink) case KeyPress: case KeyRelease: { - KeySym keysym = XKeycodeToKeysym (xsink->display, + const KeySym keysym = XKeycodeToKeysym (xsink->display, event->xkey.keycode, 0); if (keysym != NoSymbol) { - char *key = NULL; + const char *key = NULL; key = XKeysymToString (keysym); if (key == NULL) diff --git a/ext/xlib/gstcairoxsink.c b/ext/xlib/gstcairoxsink.c index b3558c4..d01047e 100644 --- a/ext/xlib/gstcairoxsink.c +++ b/ext/xlib/gstcairoxsink.c @@ -159,10 +159,10 @@ gst_cairo_x_sink_handle_event (XEvent * event, gpointer sink) case KeyPress: case KeyRelease: { - KeySym keysym = XKeycodeToKeysym (xsink->display, + const KeySym keysym = XKeycodeToKeysym (xsink->display, event->xkey.keycode, 0); if (keysym != NoSymbol) { - char *key = NULL; + const char *key = NULL; key = XKeysymToString (keysym); if (key == NULL) diff --git a/gst-libs/gst/cairo/gstcairoformat.c b/gst-libs/gst/cairo/gstcairoformat.c index becc79e..940476e 100644 --- a/gst-libs/gst/cairo/gstcairoformat.c +++ b/gst-libs/gst/cairo/gstcairoformat.c @@ -379,6 +379,7 @@ gst_cairo_format_get_offset (const GstCairoFormat * format, guint plane) case CAIRO_FORMAT_PLANAR_420: return gst_video_format_get_component_offset (format->video_format, plane, format->width, format->height); + case CAIRO_FORMAT_INVALID: default: g_assert_not_reached (); return 0; diff --git a/gst/cairo/gstcairomixer.c b/gst/cairo/gstcairomixer.c index 3aaf0e0..148354b 100644 --- a/gst/cairo/gstcairomixer.c +++ b/gst/cairo/gstcairomixer.c @@ -69,13 +69,13 @@ GST_DEBUG_CATEGORY (gst_cairo_mixer_debug); static GstObject * gst_cairo_mixer_child_proxy_get_child_by_index (GstChildProxy * child_proxy, - guint index) + guint id) { GstCairoMixer *mixer = GST_CAIRO_MIXER (child_proxy); GstObject *obj; GST_CAIRO_MIXER_STATE_LOCK (mixer); - if ((obj = g_slist_nth_data (mixer->sinkpads, index))) + if ((obj = g_slist_nth_data (mixer->sinkpads, id))) gst_object_ref (obj); GST_CAIRO_MIXER_STATE_UNLOCK (mixer); @@ -140,7 +140,7 @@ gst_cairo_mixer_sink_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (pad, "Got %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event), GST_DEBUG_PAD_NAME (pad)); - switch (GST_EVENT_TYPE (event)) { + switch ((guint) GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_STOP: /* mark a pending new segment. This event is synchronized * with the streaming thread so we can safely update the @@ -279,7 +279,7 @@ gst_cairo_mixer_change_state (GstElement * element, GstStateChange transition) GstCairoMixer *mixer = GST_CAIRO_MIXER (element); GstStateChangeReturn ret; - switch (transition) { + switch ((guint) transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: GST_LOG_OBJECT (mixer, "starting collectpads"); gst_collect_pads_start (mixer->collect); @@ -294,7 +294,7 @@ gst_cairo_mixer_change_state (GstElement * element, GstStateChange transition) ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - switch (transition) { + switch ((guint) transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: gst_cairo_mixer_reset (mixer); break; @@ -363,9 +363,9 @@ gst_cairo_mixer_fixatecaps (GstPad * pad, GstCaps * caps) w = h = 0; for (walk = mixer->sinkpads; walk; walk = walk->next) { - GstCairoMixerPad *pad = GST_CAIRO_MIXER_PAD (walk->data); + GstCairoMixerPad *mixerpad = GST_CAIRO_MIXER_PAD (walk->data); - gst_cairo_mixer_pad_get_size (pad, &px, &py, &pw, &ph); + gst_cairo_mixer_pad_get_size (mixerpad, &px, &py, &pw, &ph); w = MAX (w, px + pw); h = MAX (h, py + ph); } diff --git a/gst/cairo/gstcairomixerpad.c b/gst/cairo/gstcairomixerpad.c index 1f5838a..e322772 100644 --- a/gst/cairo/gstcairomixerpad.c +++ b/gst/cairo/gstcairomixerpad.c @@ -286,7 +286,7 @@ void gst_cairo_mixer_pad_get_size (GstCairoMixerPad * pad, int *x, int *y, int *width, int *height) { - double x1, x2, y1, y2; + double xmin, xmax, ymin, ymax; g_return_if_fail (GST_IS_CAIRO_MIXER_PAD (pad)); @@ -295,19 +295,19 @@ gst_cairo_mixer_pad_get_size (GstCairoMixerPad * pad, return; } - x1 = G_MAXDOUBLE; - x2 = -G_MAXDOUBLE; - y1 = G_MAXDOUBLE; - y2 = -G_MAXDOUBLE; + xmin = G_MAXDOUBLE; + xmax = -G_MAXDOUBLE; + ymin = G_MAXDOUBLE; + ymax = -G_MAXDOUBLE; #define ADD_POINT(tx,ty) G_STMT_START{ \ double _tx = (tx); \ double _ty = (ty); \ cairo_matrix_transform_point (&pad->matrix, &_tx, &_ty); \ - x1 = MIN (x1, _tx); \ - x2 = MAX (x2, _tx); \ - y1 = MIN (y1, _ty); \ - y2 = MAX (y2, _ty); \ + xmin = MIN (xmin, _tx); \ + xmax = MAX (xmax, _tx); \ + ymin = MIN (ymin, _ty); \ + ymax = MAX (ymax, _ty); \ }G_STMT_END ADD_POINT (0, 0); @@ -318,8 +318,8 @@ gst_cairo_mixer_pad_get_size (GstCairoMixerPad * pad, #undef ADD_POINT - *x = floor (x1); - *y = floor (y1); - *width = ceil (x2) - floor (x1); - *height = ceil (y2) - floor (y1); + *x = floor (xmin); + *y = floor (ymin); + *width = ceil (xmax) - floor (xmin); + *height = ceil (ymax) - floor (ymin); } diff --git a/gst/cairo/gstcairopuzzle.c b/gst/cairo/gstcairopuzzle.c index 88e69c4..3a1ea82 100644 --- a/gst/cairo/gstcairopuzzle.c +++ b/gst/cairo/gstcairopuzzle.c @@ -276,7 +276,8 @@ gst_cairo_puzzle_translate_event (GstCairoPuzzle * puzzle, GstEvent * event) xold = (int) x / tile_width; yold = (int) y / tile_height; - if (xold >= 0 && xold < puzzle->columns && yold >= 0 && yold < puzzle->rows) { + if (xold >= 0 && (guint) xold < puzzle->columns && + yold >= 0 && (guint) yold < puzzle->rows) { GstEvent *copy; guint lookup; guint xnew, ynew; @@ -288,7 +289,7 @@ gst_cairo_puzzle_translate_event (GstCairoPuzzle * puzzle, GstEvent * event) xold, yold, x, y, xnew, ynew, x + (xnew - xold) * tile_width, y + (ynew - yold) * tile_height); - if (xnew != xold || ynew != yold) { + if (xnew != (guint) xold || ynew != (guint) yold) { x += (xnew - xold) * tile_width; y += (ynew - yold) * tile_height; copy = gst_event_copy (event); @@ -311,7 +312,7 @@ gst_cairo_puzzle_src_event (GstBaseTransform * btrans, GstEvent * event) gboolean result = FALSE; const GstStructure *structure; - switch (GST_EVENT_TYPE (event)) { + switch ((guint) GST_EVENT_TYPE (event)) { case GST_EVENT_NAVIGATION: event = gst_cairo_puzzle_translate_event (puzzle, event); structure = gst_event_get_structure (event); diff --git a/gst/cairo/gstcairotestsrc.c b/gst/cairo/gstcairotestsrc.c index ed98b01..4e0d84a 100644 --- a/gst/cairo/gstcairotestsrc.c +++ b/gst/cairo/gstcairotestsrc.c @@ -699,7 +699,7 @@ gst_cairo_test_src_query (GstBaseSrc * bsrc, GstQuery * query) guint rate_num, rate_denom; gboolean res; - switch (GST_QUERY_TYPE (query)) { + switch ((guint) GST_QUERY_TYPE (query)) { case GST_QUERY_CONVERT: { GstFormat src_fmt, dest_fmt; @@ -713,9 +713,9 @@ gst_cairo_test_src_query (GstBaseSrc * bsrc, GstQuery * query) gst_cairo_format_get_framerate (src->format, &rate_num, &rate_denom); - switch (src_fmt) { + switch ((guint) src_fmt) { case GST_FORMAT_DEFAULT: - switch (dest_fmt) { + switch ((guint) dest_fmt) { case GST_FORMAT_TIME: /* frames to time */ if (rate_num) { @@ -730,7 +730,7 @@ gst_cairo_test_src_query (GstBaseSrc * bsrc, GstQuery * query) } break; case GST_FORMAT_TIME: - switch (dest_fmt) { + switch ((guint) dest_fmt) { case GST_FORMAT_DEFAULT: /* time to frames */ if (rate_num) { @@ -791,20 +791,20 @@ gst_cairo_test_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer, static gboolean gst_cairo_test_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) { - GstClockTime time; + GstClockTime lasttime; GstCairoTestSrc *src; guint rate_num, rate_denom; src = GST_CAIRO_TEST_SRC (bsrc); segment->time = segment->start; - time = segment->last_stop; + lasttime = segment->last_stop; gst_cairo_format_get_framerate (src->format, &rate_num, &rate_denom); /* now move to the time indicated */ if (rate_num) { - src->n_frames = gst_util_uint64_scale (time, + src->n_frames = gst_util_uint64_scale (lasttime, rate_num, rate_denom * GST_SECOND); } else { src->n_frames = 0; @@ -817,7 +817,7 @@ gst_cairo_test_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) src->running_time = 0; } - g_assert (src->running_time <= time); + g_assert (src->running_time <= lasttime); return TRUE; } |