]> pd.if.org Git - pdclib/blobdiff - functions/_PDCLIB/stdarg.c
REGTEST wrapping.
[pdclib] / functions / _PDCLIB / stdarg.c
old mode 100644 (file)
new mode 100755 (executable)
index defd5fe..7ad1087
@@ -1,21 +1,16 @@
-/* $Id$ */
-
-/* Release $Name$ */
-
 /* stdarg
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#ifdef TEST
-
-#include <_PDCLIB_test.h>
 #include <stdarg.h>
 #include <limits.h>
 #include <float.h>
 
-unsigned int rc = 0;
+#ifdef TEST
+
+#include "_PDCLIB_test.h"
 
 typedef int (*intfunc_t)( void );
 
@@ -32,6 +27,11 @@ enum tag_t
     TAG_FUNCPTR
 };
 
+static int dummy( void )
+{
+    return INT_MAX;
+}
+
 static int test( enum tag_t s, ... )
 {
     enum tag_t tag = s;
@@ -85,7 +85,9 @@ static int test( enum tag_t s, ... )
             }
             case TAG_FUNCPTR:
             {
-                TESTCASE( (va_arg( ap, intfunc_t ))() == INT_MAX );
+                intfunc_t function;
+                TESTCASE( ( function = va_arg( ap, intfunc_t ) ) == dummy );
+                TESTCASE( function() == INT_MAX );
                 tag = va_arg( ap, enum tag_t );
                 break;
             }
@@ -98,12 +100,7 @@ static int test( enum tag_t s, ... )
     }
 }
 
-int dummy()
-{
-    return INT_MAX;
-}
-
-int main()
+int main( void )
 {
     int x = INT_MAX;
     long double d = LDBL_MAX;