Fix minor windows pedantic warnings.
This commit is contained in:
@@ -40,17 +40,25 @@ static const char *itoa(unsigned n)
|
||||
static intptr_t xtoi( const char *hex )
|
||||
{
|
||||
intptr_t ret = 0;
|
||||
while( 1 )
|
||||
for(;;)
|
||||
{
|
||||
int val = -1;
|
||||
if( *hex >= '0' && *hex <= '9' )
|
||||
{
|
||||
val = *hex - '0';
|
||||
}
|
||||
else if( *hex >= 'A' && *hex <= 'F' )
|
||||
{
|
||||
val = *hex - 'A' + 10;
|
||||
}
|
||||
else if( *hex >= 'a' && *hex <= 'f' )
|
||||
{
|
||||
val = *hex - 'a' + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
hex++;
|
||||
|
||||
ret *= 16;
|
||||
|
||||
@@ -31,17 +31,21 @@ static void safe_print( int fd, ... )
|
||||
va_list ap;
|
||||
va_start( ap, fd );
|
||||
|
||||
while( true )
|
||||
for(;;)
|
||||
{
|
||||
const char *p = va_arg( ap, const char * );
|
||||
if( p == NULL )
|
||||
{
|
||||
break;
|
||||
}
|
||||
size_t len = strlen( p );
|
||||
while( len )
|
||||
{
|
||||
ssize_t result = write( fd, p, strlen(p) );
|
||||
if( result == -1 )
|
||||
{
|
||||
_exit( 1 );
|
||||
}
|
||||
len -= result;
|
||||
p += result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user