# HG changeset patch # User al # Date 1108844040 0 # Node ID 2ef20aa3623b5ef609c6e1c6ff70c00156c57362 # Parent 44810b387934e025f4a2d352b14b4d12d6c6b741 Move generic tests to a common place. diff -r 44810b387934 -r 2ef20aa3623b libvo/vo_gl.c --- a/libvo/vo_gl.c Sat Feb 19 14:58:39 2005 +0000 +++ b/libvo/vo_gl.c Sat Feb 19 20:14:00 2005 +0000 @@ -472,13 +472,6 @@ vo_x11_uninit(); } -static int int_non_neg(int *sh) -{ - if ( *sh < 0 ) - return 0; - return 1; -} - static opt_t subopts[] = { {"manyfmts", OPT_ARG_BOOL, &many_fmts, NULL}, {"osd", OPT_ARG_BOOL, &use_osd, NULL}, diff -r 44810b387934 -r 2ef20aa3623b libvo/vo_pnm.c --- a/libvo/vo_pnm.c Sat Feb 19 14:58:39 2005 +0000 +++ b/libvo/vo_pnm.c Sat Feb 19 20:14:00 2005 +0000 @@ -103,16 +103,6 @@ /* ------------------------------------------------------------------------- */ -/** \brief Validation function for maxfiles - */ - -static int int_pos(int *mf) -{ - if ( *mf > 0 ) - return 1; - return 0; -} - /** \brief Pre-initialisation. * * This function is called before initialising the video output driver. It diff -r 44810b387934 -r 2ef20aa3623b subopt-helper.c --- a/subopt-helper.c Sat Feb 19 14:58:39 2005 +0000 +++ b/subopt-helper.c Sat Feb 19 20:14:00 2005 +0000 @@ -263,3 +263,21 @@ return match; } + + +/*** common test functions ***/ + +/** \brief Test if i is not negative */ +int int_non_neg( int * i ) +{ + if ( *i < 0 ) { return 0; } + + return 1; +} +/** \brief Test if i is positive. */ +int int_pos( int * i ) +{ + if ( *i > 0 ) { return 1; } + + return 0; +} diff -r 44810b387934 -r 2ef20aa3623b subopt-helper.h --- a/subopt-helper.h Sat Feb 19 14:58:39 2005 +0000 +++ b/subopt-helper.h Sat Feb 19 20:14:00 2005 +0000 @@ -39,4 +39,8 @@ char const * str; ///< pointer to position inside the parse string } strarg_t; + +int int_non_neg( int * i ); +int int_pos( int * i ); + #endif