summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-02 19:09:25 +0100
committerwm4 <wm4@nowhere>2015-03-02 19:09:25 +0100
commit445b3fbf826dd074b1f2a34cddcd3f126462f0d1 (patch)
tree29b51fb3eaa7a2f23d120a265c4f1cc0a1afef1c
parent4b177bd5c22fbeeba9ddae77503ab9938f2503c3 (diff)
downloadmpv-445b3fbf826dd074b1f2a34cddcd3f126462f0d1.tar.bz2
mpv-445b3fbf826dd074b1f2a34cddcd3f126462f0d1.tar.xz
buid: readd -Wparentheses
This warning wasn't overly helpful in the past, and warned against perfectly fine code. But at least with recent gcc versions, this is the warning that complains about assignments in if expressions (why???), so we want to enable it. Also change all the code this warning complains about for no reason.
-rw-r--r--demux/demux_mkv.c4
-rwxr-xr-xold-configure2
-rw-r--r--video/out/bitmap_packer.c2
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/wayland_common.c2
-rw-r--r--waftools/detections/compiler.py2
7 files changed, 8 insertions, 8 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index df7de3ef5e..d19d50aab1 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1990,8 +1990,8 @@ static bool handle_realaudio(demuxer_t *demuxer, mkv_track_t *track,
uint8_t ov = track->audio_buf[o / 2];
int x = (i & 1) ? iv >> 4 : iv & 0x0F;
int y = (o & 1) ? ov >> 4 : ov & 0x0F;
- track->audio_buf[o / 2] = ov & 0x0F | (o & 1 ? x << 4 : x);
- track->audio_buf[i / 2] = iv & 0x0F | (i & 1 ? y << 4 : y);
+ track->audio_buf[o / 2] = (ov & 0x0F) | (o & 1 ? x << 4 : x);
+ track->audio_buf[i / 2] = (iv & 0x0F) | (i & 1 ? y << 4 : y);
i++;
o++;
}
diff --git a/old-configure b/old-configure
index 6bdfc4413b..e7fae165b2 100755
--- a/old-configure
+++ b/old-configure
@@ -379,7 +379,7 @@ addcflags() { cflag_check "$@" && OURCFLAGS="$OURCFLAGS $@" ; }
OURCFLAGS="-std=c99 -Wall $_opt"
addcflags -g -g3 -ggdb
-addcflags -Wundef -Wmissing-prototypes -Wshadow -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Werror=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-function
+addcflags -Wundef -Wmissing-prototypes -Wshadow -Wno-switch -Wparentheses -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Werror=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-function
# clang
addcflags -Wno-logical-op-parentheses -fcolor-diagnostics -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
# extra
diff --git a/video/out/bitmap_packer.c b/video/out/bitmap_packer.c
index 78af8e648c..747693b089 100644
--- a/video/out/bitmap_packer.c
+++ b/video/out/bitmap_packer.c
@@ -57,7 +57,7 @@ static int size_index(int s)
{
int n = av_log2_16bit(s);
return (n << HEIGHT_SORT_BITS)
- + (- 1 - (s << HEIGHT_SORT_BITS >> n) & (1 << HEIGHT_SORT_BITS) - 1);
+ + ((- 1 - (s << HEIGHT_SORT_BITS >> n)) & ((1 << HEIGHT_SORT_BITS) - 1));
}
/* Pack the given rectangles into an area of size w * h.
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 9a06f2e3c4..8bde820b38 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -575,7 +575,7 @@ static int wait_events(struct vo *vo, int64_t until_time_us)
if (sdl_mod & (KMOD_LCTRL | KMOD_RCTRL))
mpv_mod |= MP_KEY_MODIFIER_CTRL;
if ((sdl_mod & KMOD_LALT) ||
- (sdl_mod & KMOD_RALT) && !mp_input_use_alt_gr(vo->input_ctx))
+ ((sdl_mod & KMOD_RALT) && !mp_input_use_alt_gr(vo->input_ctx)))
mpv_mod |= MP_KEY_MODIFIER_ALT;
if (sdl_mod & (KMOD_LGUI | KMOD_RGUI))
mpv_mod |= MP_KEY_MODIFIER_META;
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 4c08786b0b..89bbb142a3 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -778,7 +778,7 @@ static int flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
if (pts < vsync + vc->vsync_interval / 4
&& (vsync - PREV_VSYNC(vc->last_queue_time)
> pts - vc->last_ideal_time + vc->vsync_interval / 2
- || vc->dropped_frame && vsync > vc->dropped_time))
+ || (vc->dropped_frame && vsync > vc->dropped_time)))
pts -= vc->vsync_interval / 2;
vc->dropped_time = ideal_pts;
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 2d09ad12b0..224a60d1e0 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -418,7 +418,7 @@ static void pointer_handle_button(void *data,
{
struct vo_wayland_state *wl = data;
- mp_input_put_key(wl->vo->input_ctx, MP_MOUSE_BTN0 + (button - BTN_LEFT) |
+ mp_input_put_key(wl->vo->input_ctx, (MP_MOUSE_BTN0 + (button - BTN_LEFT)) |
((state == WL_POINTER_BUTTON_STATE_PRESSED)
? MP_KEY_STATE_DOWN : MP_KEY_STATE_UP));
diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py
index 7c25c3dadc..fa7986683f 100644
--- a/waftools/detections/compiler.py
+++ b/waftools/detections/compiler.py
@@ -39,7 +39,7 @@ def __add_generic_flags__(ctx):
def __add_gcc_flags__(ctx):
ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow",
- "-Wno-switch", "-Wno-parentheses", "-Wpointer-arith",
+ "-Wno-switch", "-Wparentheses", "-Wpointer-arith",
"-Wredundant-decls", "-Wno-pointer-sign"]
def __add_clang_flags__(ctx):