Skip to content

Commit

Permalink
fix msft prefast warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidly committed Sep 3, 2023
1 parent eba2916 commit c1b8410
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion djltrace.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CDJLTrace
if ( !quiet )
fprintf( fp, "PID %6u -- ",
#ifdef _MSC_VER
_getpid() );
(unsigned) _getpid() );
#else
getpid() );
#endif
Expand Down
11 changes: 7 additions & 4 deletions ntvcm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ void output_character( uint8_t c )
else
{
uint8_t col = c - 31;
printf( "\x1b[%d;%dH", s_row, col );
printf( "\x1b[%u;%uH", s_row, col );
tracer.Trace( " moved cursor to %d %d\n", s_row, col );
s_escapedY = false;
s_row = 0xff;
Expand Down Expand Up @@ -665,7 +665,7 @@ void output_character( uint8_t c )
else
{
uint8_t col = c - 31;
printf( "\x1b[%d;%dH", s_row, col );
printf( "\x1b[%u;%uH", s_row, col );
tracer.Trace( " moved cursor to %d %d\n", s_row, col );
s_escapedChar = 0;
s_row = 0xff;
Expand Down Expand Up @@ -1991,8 +1991,8 @@ uint8_t x80_invoke_hook()
}
default:
{
tracer.Trace( "UNIMPLEMENTED BDOS FUNCTION!!!!!!!!!!!!!!!: %d = %#x\n", reg.c, reg.c );
printf( "UNIMPLEMENTED BDOS FUNCTION!!!!!!!!!!!!!!!: %d = %#x\n", reg.c, reg.c );
tracer.Trace( "UNIMPLEMENTED BDOS FUNCTION!!!!!!!!!!!!!!!: %u = %#x\n", reg.c, reg.c );
printf( "UNIMPLEMENTED BDOS FUNCTION!!!!!!!!!!!!!!!: %u = %#x\n", reg.c, reg.c );

x80_trace_state();
reg.a = 0xff;
Expand Down Expand Up @@ -2245,7 +2245,10 @@ int main( int argc, char * argv[] )
set_process_affinity( processAffinityMask );

if ( 0 == pcCOM )
{
usage( "no CP/M command specified" );
assume_false;
}

* pCommandTailLen = (char) strlen( pCommandTail );

Expand Down
14 changes: 7 additions & 7 deletions x80.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ void z80_render( char * ac, uint8_t op, uint16_t address )
else if ( 0x35 == op2 )
sprintf( ac, "dec (%s%s%d)\n", i, op3int >= 0 ? "+" : "", op3int );
else if ( 0x36 == op2 )
sprintf( ac, "ld (%s+%d), %#xh", i, op3, op4 );
sprintf( ac, "ld (%s%s%d), %#xh", i, op3int >= 0 ? "+" : "", op3int, op4 );
else if ( ( op2 >= 0x40 && op2 <= 0x6f ) || ( op2 >= 0x78 && op2 <= 0x7f ) )
{
char acto[ 4 ] = {0};
Expand Down Expand Up @@ -1489,11 +1489,11 @@ void z80_render( char * ac, uint8_t op, uint16_t address )
uint8_t top2bits = mod & 0xc0;

if ( 0x40 == top2bits ) // bit
sprintf( ac, "bit %d, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
sprintf( ac, "bit %u, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
else if ( 0x80 == top2bits ) // reset
sprintf( ac, "res %d, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
sprintf( ac, "res %u, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
else if ( 0xc0 == top2bits ) // set
sprintf( ac, "set %d, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
sprintf( ac, "set %u, ( %s%s%d )", bit, i, index32 >= 0 ? "+" : "", index32 );
else if ( 0x26 == op4 ) // sla
sprintf( ac, "sla (%s%s%d)", i, index32 >= 0 ? "+" : "", index32 );
else if ( 0x2e == op4 ) // sra
Expand Down Expand Up @@ -1614,19 +1614,19 @@ void z80_render( char * ac, uint8_t op, uint16_t address )
{
uint8_t rm = op2 & 0x7;
uint8_t bit = ( op2 >> 3 ) & 0x7;
sprintf( ac, "bit %d, %s", bit, reg_strings[ rm ] );
sprintf( ac, "bit %u, %s", bit, reg_strings[ rm ] );
}
else if ( op2 >= 0x80 && op2 <= 0xbf ) // res bit #, rm
{
uint8_t rm = op2 & 0x7;
uint8_t bit = ( op2 >> 3 ) & 0x7;
sprintf( ac, "res %d, %s", bit, reg_strings[ rm ] );
sprintf( ac, "res %u, %s", bit, reg_strings[ rm ] );
}
else if ( op2 >= 0xc0 && op2 <= 0xff ) // set bit #, rm
{
uint8_t rm = op2 & 0x7;
uint8_t bit = ( op2 >> 3 ) & 0x7;
sprintf( ac, "set %d, %s", bit, reg_strings[ rm ] );
sprintf( ac, "set %u, %s", bit, reg_strings[ rm ] );
}
}
else if ( 0x08 == op )
Expand Down

0 comments on commit c1b8410

Please sign in to comment.