Mercurial > mplayer.hg
comparison libvo/vo_png.c @ 30123:0f5f75b4a015
Simplify range-checking functions for subopt parsing.
author | reimar |
---|---|
date | Fri, 01 Jan 2010 13:23:16 +0000 |
parents | 1772a5171ac7 |
children | 0a92a14ced38 |
comparison
equal
deleted
inserted
replaced
30122:1772a5171ac7 | 30123:0f5f75b4a015 |
---|---|
284 static void check_events(void){} | 284 static void check_events(void){} |
285 | 285 |
286 static int int_zero_to_nine(void *value) | 286 static int int_zero_to_nine(void *value) |
287 { | 287 { |
288 int *sh = value; | 288 int *sh = value; |
289 if ( (*sh < 0) || (*sh > 9) ) | 289 return *sh >= 0 && *sh <= 9; |
290 return 0; | |
291 return 1; | |
292 } | 290 } |
293 | 291 |
294 static const opt_t subopts[] = { | 292 static const opt_t subopts[] = { |
295 {"alpha", OPT_ARG_BOOL, &use_alpha, NULL}, | 293 {"alpha", OPT_ARG_BOOL, &use_alpha, NULL}, |
296 {"z", OPT_ARG_INT, &z_compression, int_zero_to_nine}, | 294 {"z", OPT_ARG_INT, &z_compression, int_zero_to_nine}, |