diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-01 13:23:16 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-01 13:23:16 +0000 |
commit | 92cd6dc3e916ae4275ff05d2b238fc778cfbfc6b (patch) | |
tree | 199e6ca232ebd36a119a088869329875e175d086 /libvo | |
parent | f102ac7a8c62491761b7b3d32baa87dcb665f9ed (diff) | |
download | mpv-92cd6dc3e916ae4275ff05d2b238fc778cfbfc6b.tar.bz2 mpv-92cd6dc3e916ae4275ff05d2b238fc778cfbfc6b.tar.xz |
Simplify range-checking functions for subopt parsing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30165 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_jpeg.c | 4 | ||||
-rw-r--r-- | libvo/vo_png.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/libvo/vo_jpeg.c b/libvo/vo_jpeg.c index 5f9a5d1f6d..1be11014b0 100644 --- a/libvo/vo_jpeg.c +++ b/libvo/vo_jpeg.c @@ -333,9 +333,7 @@ static void check_events(void) static int int_zero_hundred(void *valp) { int *val = valp; - if ( (*val >=0) && (*val<=100) ) - return 1; - return 0; + return *val >= 0 && *val <= 100; } static int preinit(const char *arg) diff --git a/libvo/vo_png.c b/libvo/vo_png.c index e404785736..94fbdcaf8f 100644 --- a/libvo/vo_png.c +++ b/libvo/vo_png.c @@ -286,9 +286,7 @@ static void check_events(void){} static int int_zero_to_nine(void *value) { int *sh = value; - if ( (*sh < 0) || (*sh > 9) ) - return 0; - return 1; + return *sh >= 0 && *sh <= 9; } static const opt_t subopts[] = { |