#include <stddef.h>
#include <limits.h>
+#ifndef REGTEST
+
/* Using an integer's bits as flags for both the conversion flags and length
modifiers.
*/
*/
static int GET( struct _PDCLIB_status_t * status )
{
- int rc;
+ int rc = EOF;
if ( status->stream != NULL )
{
rc = getc( status->stream );
status->width = (int)strtol( spec, (char**)&spec, 10 );
if ( spec == prev_spec )
{
- status->width = SIZE_MAX;
+ status->width = UINT_MAX;
}
/* Optional length modifier
}
case 'p':
status->base = 16;
- status->flags |= E_unsigned;
+ // TODO: Like _PDCLIB_print, E_pointer(?)
+ status->flags |= E_unsigned | E_long;
break;
case 'n':
{
/* TODO: Floats. */
return NULL;
}
-
+#endif
#ifdef TEST
#define _PDCLIB_FILEID "_PDCLIB/scan.c"
#include <_PDCLIB_test.h>
+#ifndef REGTEST
static int testscanf( char const * s, char const * format, ... )
{
struct _PDCLIB_status_t status;
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;
}