1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00

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.
This commit is contained in:
wm4 2015-03-02 19:09:25 +01:00
parent 4b177bd5c2
commit 445b3fbf82
7 changed files with 8 additions and 8 deletions

View File

@ -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++;
}

View File

@ -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

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -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):