-/* $Id$ */
-
/* _PDCLIB_print( const char *, struct _PDCLIB_status_t * )
This file is part of the Public Domain C Library (PDCLib).
#include <limits.h>
#ifndef REGTEST
-#include <_PDCLIB_io.h>
+#include "_PDCLIB_io.h"
/* Using an integer's bits as flags for both the conversion flags and length
modifiers.
/* TODO: Check for invalid flag combinations. */
if ( status->flags & E_unsigned )
{
- uintmax_t value;
+ /* TODO: Marking the default case _PDCLIB_UNREACHABLE breaks %ju test driver? */
+ uintmax_t value = 0;
switch ( status->flags & E_TYPES )
{
case E_char:
}
else
{
- intmax_t value;
+ intmax_t value = 0;
switch ( status->flags & E_TYPES )
{
case E_char:
case E_intmax:
value = va_arg( status->arg, intmax_t );
break;
+ default:
+ _PDCLIB_UNREACHABLE;
}
if (!int2base( value, status ) )
#define _PDCLIB_FILEID "_PDCLIB/print.c"
#define _PDCLIB_STRINGIO
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
#ifndef REGTEST
static size_t testcb( void *p, const char *buf, size_t size )
status.write = testcb;
va_start( status.arg, format );
memset( buffer, '\0', 100 );
- if ( _PDCLIB_print( format, &status ) != strlen( format ) )
+ if ( _PDCLIB_print( format, &status ) != (int)strlen( format ) )
{
printf( "_PDCLIB_print() did not return end-of-specifier on '%s'.\n", format );
++TEST_RESULTS;