From 66e541e8ae5314dcf551e28554cf56b7601ef456 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Nov 2012 14:37:40 +0000 Subject: [PATCH] 2012-11-21 15:36 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbwin/win_regc.c % merged UNICODE/non-UNICODE branch by using sizeof(). Checkme. * contrib/hbzebra/datamtrx.c * minor formatting * contrib/xhb/freadlin.c * deleted excessive () --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/hbwin/win_regc.c | 8 ++------ harbour/contrib/hbzebra/datamtrx.c | 9 ++++++--- harbour/contrib/xhb/freadlin.c | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c0808fd768..1ad73b8612 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,17 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-21 15:36 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/hbwin/win_regc.c + % merged UNICODE/non-UNICODE branch by using sizeof(). + Checkme. + + * contrib/hbzebra/datamtrx.c + * minor formatting + + * contrib/xhb/freadlin.c + * deleted excessive () + 2012-11-21 15:05 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbzebra/code128.c * contrib/hbzebra/pdf417.c diff --git a/harbour/contrib/hbwin/win_regc.c b/harbour/contrib/hbwin/win_regc.c index 36b3e5f785..f08a34a9e3 100644 --- a/harbour/contrib/hbwin/win_regc.c +++ b/harbour/contrib/hbwin/win_regc.c @@ -143,9 +143,7 @@ HB_FUNC( WIN_REGQUERYVALUEEX ) lpValue, &dwSize ) == ERROR_SUCCESS ) { - #if defined( UNICODE ) - dwSize >>= 1; - #endif + dwSize /= sizeof( TCHAR ); HB_STORSTRLEN( ( LPTSTR ) lpValue, dwSize, 5 ); } @@ -225,9 +223,7 @@ HB_FUNC( WIN_REGSETVALUEEX ) ++nValueLen; - #if defined( UNICODE ) - nValueLen *= 2; - #endif + nValueLen *= sizeof( TCHAR ); hb_retl( RegSetValueEx( ( HKEY ) hb_parptr( 1 ), lpKey, diff --git a/harbour/contrib/hbzebra/datamtrx.c b/harbour/contrib/hbzebra/datamtrx.c index fdd93e98d9..2f8c744614 100644 --- a/harbour/contrib/hbzebra/datamtrx.c +++ b/harbour/contrib/hbzebra/datamtrx.c @@ -364,7 +364,8 @@ static void _datamatrix_do_placement( PHB_BITBUFFER pBits, unsigned char * pCW, _datamatrix_place( pArr, iPRow, iPCol, iR, iC, i++ ); iR -= 2; iC += 2; - } while( iR >= 0 && iC < iPCol ); + } + while( iR >= 0 && iC < iPCol ); iR++; iC += 3; @@ -375,11 +376,13 @@ static void _datamatrix_do_placement( PHB_BITBUFFER pBits, unsigned char * pCW, _datamatrix_place( pArr, iPRow, iPCol, iR, iC, i++ ); iR += 2; iC -= 2; - } while( iR < iPRow && iC >= 0 ); + } + while( iR < iPRow && iC >= 0 ); iR += 3; iC++; - } while( iR < iPRow || iC < iPCol ); + } + while( iR < iPRow || iC < iPCol ); if( pArr[ iPRow * iPCol - 1 ] == 0 ) pArr[ iPRow * iPCol - 1 ] = pArr[ iPRow * iPCol - iPCol - 2 ] = 1; diff --git a/harbour/contrib/xhb/freadlin.c b/harbour/contrib/xhb/freadlin.c index e3e40e167b..00a2b9c768 100644 --- a/harbour/contrib/xhb/freadlin.c +++ b/harbour/contrib/xhb/freadlin.c @@ -155,7 +155,7 @@ static char * hb_fsReadLine( HB_FHANDLE hFileHandle, HB_ISIZ * plBuffLen, const nTries++; } - while( ( ! *pbFound ) && nRead > 0 ); + while( ! *pbFound && nRead > 0 ); return pBuff; }