2012-07-20 07:50 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/dispc.c
  * contrib/hbnf/fttext.c
  * contrib/hbnf/peek.c
  * contrib/hbnf/poke.c
    % removed excessive parentheses
This commit is contained in:
Viktor Szakats
2012-07-20 05:50:46 +00:00
parent 100eb2bd16
commit 4fe096dc29
5 changed files with 22 additions and 19 deletions

View File

@@ -16,6 +16,13 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-07-20 07:50 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/dispc.c
* contrib/hbnf/fttext.c
* contrib/hbnf/peek.c
* contrib/hbnf/poke.c
% removed excessive parentheses
2012-07-20 07:33 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/xhb/filestat.c
* uncrustified

View File

@@ -162,7 +162,7 @@ static HB_FOFFSET getblock( HB_FOFFSET offset )
/* if a full buffer's worth was not read in, make it full. */
if( ( buffbot != buffsize ) && ( fsize > buffsize ) )
if( buffbot != buffsize && fsize > buffsize )
{
if( offset > 0 )
hb_fsSeekLarge( infile, -buffsize, FS_END );
@@ -195,7 +195,7 @@ static void buff_align()
i = bufftop; /* start at the top of the file and scan */
/* forward until a CR is reached. */
while( ( buffer[ i ] != CR ) && ( i < buffbot ) )
while( buffer[ i ] != CR && i < buffbot )
i++;
bufftop = i + 2;
@@ -221,7 +221,7 @@ static void buff_align()
i = buffbot; /* point the end of the buffer to a valid */
/* complete text line. */
while( ( buffer[ i ] != CR ) && ( i > bufftop ) )
while( buffer[ i ] != CR && i > bufftop )
i--;
buffbot = i + 2;
@@ -243,7 +243,7 @@ static void win_align()
winbot = wintop; /* find out if there is enough text for */
i = 0; /* full window. */
while( ( winbot < buffbot ) && ( i < height ) )
while( winbot < buffbot && i < height )
{
if( buffer[ winbot ] == CR )
i++;
@@ -259,7 +259,7 @@ static void win_align()
wintop = winbot;
i = 0; /* and setup wintop */
while( ( wintop > bufftop ) && ( i <= height ) )
while( wintop > bufftop && i <= height )
{
if( buffer[ wintop ] == LF )
i++;
@@ -349,7 +349,7 @@ static void winup()
bRefresh = HB_TRUE;
k = wintop - 3;
while( ( buffer[ k ] != CR ) && ( k > bufftop ) )
while( buffer[ k ] != CR && k > bufftop )
k--;
if( k >= bufftop )
@@ -375,7 +375,7 @@ static void winup()
j = 0;
buffoffset = getblock( j );
wintop = ( ( int ) ( i - buffoffset ) );
wintop = ( int ) ( i - buffoffset );
buff_align();
win_align();
@@ -397,7 +397,7 @@ static void windown()
bRefresh = HB_TRUE;
k = winbot;
while( ( buffer[ k ] != CR ) && ( k <= buffbot ) )
while( buffer[ k ] != CR && k <= buffbot )
k++;
k += 2;
@@ -424,7 +424,7 @@ static void windown()
if( i < buffoffset )
wintop = 0;
else
wintop = ( ( int ) ( i - buffoffset ) );
wintop = ( int ) ( i - buffoffset );
buff_align();
win_align();
@@ -748,7 +748,7 @@ HB_FUNC( FT_DISPFILE )
default: if( keytype == K_STRING )
{
for( i = 0; i <= kcount; i++ )
if( ( ch > 0 ) && ( ch < 256 ) )
if( ch > 0 && ch < 256 )
if( ( int ) kstr[ i ] == ch )
bDone = HB_TRUE;
break; /* if so terminate */

View File

@@ -391,7 +391,7 @@ static long _ft_skip( long iRecs )
/* get count of chars in this line */
iByteCount = _findeol( cPtr, iBytesRemaining );
if( ( iByteCount > 0 ) && ( iByteCount != iBytesRemaining ) )
if( iByteCount > 0 && iByteCount != iBytesRemaining )
{
/* found a CRLF, iByteCount points to first char of next
record */
@@ -512,9 +512,9 @@ static long _ft_skip( long iRecs )
}
}
}
while( ( iBytesRemaining > 0 ) );
while( iBytesRemaining > 0 );
}
while( ( fpOffset > 0 ) && ( iBytesRead == BUFFSIZE ) );
while( fpOffset > 0 && iBytesRead == BUFFSIZE );
}
else
{

View File

@@ -40,7 +40,7 @@ HB_FUNC( FT_PEEK )
auto unsigned int ProtMode = cpmiIsProtected();
auto unsigned char * bytePtr;
if( ( PCOUNT >= 2 ) && ( HB_ISNUM( 1 ) ) && ( HB_ISNUM( 2 ) ) )
if( PCOUNT >= 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
{
FP_SEG( bytePtr ) = hb_parni( 1 );
FP_OFF( bytePtr ) = hb_parni( 2 );
@@ -61,6 +61,4 @@ HB_FUNC( FT_PEEK )
}
else
Bogus: hb_retni( -1 );
return;
}

View File

@@ -40,7 +40,7 @@ HB_FUNC( FT_POKE )
auto unsigned int ProtMode = hb_cpmiIsProtected();
auto unsigned char * bytePtr;
if( ( PCOUNT >= 3 ) && ( HB_ISNUM( 1 ) ) && ( HB_ISNUM( 2 ) ) && ( HB_ISNUM( 3 ) ) )
if( PCOUNT >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) )
{
FP_SEG( bytePtr ) = hb_parni( 1 );
FP_OFF( bytePtr ) = hb_parni( 2 );
@@ -63,6 +63,4 @@ HB_FUNC( FT_POKE )
}
else
Bogus: hb_retl( HB_FALSE );
return;
}