X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Fscan.c;h=0ecf31ada2393ff94d5d058cef7f75dfa07f563b;hb=0cf5cdb61dae0e9ce894115ef69b79d8b2507d54;hp=6910aef66f3b60586f16a164d395128a8615960e;hpb=6a0967a533b77ae2113da317450ca48e8569a12b;p=pdclib diff --git a/functions/_PDCLIB/scan.c b/functions/_PDCLIB/scan.c index 6910aef..0ecf31a 100644 --- a/functions/_PDCLIB/scan.c +++ b/functions/_PDCLIB/scan.c @@ -16,6 +16,8 @@ #include #include +#ifndef REGTEST + /* Using an integer's bits as flags for both the conversion flags and length modifiers. */ @@ -160,7 +162,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) status->width = (int)strtol( spec, (char**)&spec, 10 ); if ( spec == prev_spec ) { - status->width = SIZE_MAX; + status->width = UINT_MAX; } /* Optional length modifier @@ -588,7 +590,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) /* TODO: Floats. */ return NULL; } - +#endif #ifdef TEST #define _PDCLIB_FILEID "_PDCLIB/scan.c" @@ -596,6 +598,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status ) #include <_PDCLIB_test.h> +#ifndef REGTEST static int testscanf( char const * s, char const * format, ... ) { struct _PDCLIB_status_t status; @@ -612,13 +615,16 @@ static int testscanf( char const * s, char const * format, ... ) va_end( status.arg ); return status.n; } +#endif #define TEST_CONVERSION_ONLY int main( void ) { +#ifndef REGTEST char source[100]; #include "scanf_testcases.h" +#endif return TEST_RESULTS; }