changeset 14736:2ef20aa3623b

Move generic tests to a common place.
author al
date Sat, 19 Feb 2005 20:14:00 +0000
parents 44810b387934
children b1cb4d26a278
files libvo/vo_gl.c libvo/vo_pnm.c subopt-helper.c subopt-helper.h
diffstat 4 files changed, 22 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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},
--- 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
--- 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;
+}
--- 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