Skip to content

Commit

Permalink
trap: cleanup par trap code
Browse files Browse the repository at this point in the history
improve handling of errors
source code formatting changes
  • Loading branch information
jmalak committed Sep 10, 2024
1 parent 260026b commit 0313638
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions bld/trap/par/c/parlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ const char *RemoteLinkSet( const char *parms )
port <<= 4;
port += ch;
}
if( port == 0 ) {
return( InvalidPort );
}
} else {
return( InvalidPort );
}
Expand Down
9 changes: 4 additions & 5 deletions bld/trap/par/c/parproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ static int DataGetByte( hw_data *hwd, unsigned long wait )

static unsigned DataGet( hw_data *hwd, char *data, unsigned len )
{
unsigned get_len;
unsigned i;
unsigned get_len;
unsigned i;
char c;

get_len = DataGetByte( hwd, RELINQUISH );
Expand Down Expand Up @@ -528,7 +528,7 @@ static int DataPutByte( hw_data *hwd, unsigned char data, unsigned long wait )

static unsigned DataPut( hw_data *hwd, char *data, unsigned len )
{
unsigned count;
unsigned count;

if( len >= 0x80 ) {
DataPutByte( hwd, (len >> 8) | 0x80, RELINQUISH );
Expand Down Expand Up @@ -580,7 +580,7 @@ static bool CountTwidle( hw_data *hwd )
char buf[10];

itoa( type, buf, 16 );
cputs( " Type " ); cputs( buf );
dbgrtn( " Type " ); dbgrtn( buf );
}
#endif
#endif
Expand Down Expand Up @@ -766,4 +766,3 @@ static void DataDisconnect( hw_data *hwd )
{ /* delay while other side catches up */ }
DataReset( hwd, true );
}

0 comments on commit 0313638

Please sign in to comment.