diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6c985053c1..9b5c214eff 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,39 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-21 17:45 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * harbour.spec + + Added HU translation (cpwin). + + * source/rtl/gtfunc.c + % Minor opt. + + * source/rtl/console.c + * source/rtl/fserror.c + * source/rtl/strmatch.c + * source/rtl/padr.c + * source/rtl/hbhex.c + * source/rtl/at.c + * source/rtl/abs.c + * source/rtl/dates.c + * source/rtl/padc.c + * source/rtl/mod.c + * source/rtl/hbrandom.c + * source/rtl/filesys.c + * source/rtl/padl.c + * source/rtl/val.c + * source/rtl/hbregex.c + * source/vm/runner.c + * source/vm/hashes.c + * source/vm/itemapi.c + * source/vm/hvm.c + * source/vm/maindllp.c + * source/vm/fm.c + * source/vm/arrayshb.c + * source/vm/classes.c + * source/common/hbtrace.c + * Formatting (whitespace only) + 2008-05-21 16:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * make_vc.mak diff --git a/harbour/harbour.spec b/harbour/harbour.spec index 02d95490ce..02a6930868 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -92,6 +92,7 @@ Summary: Free software Clipper compatible compiler Summary(pl): Darmowy kompilator kompatybilny z jêzykiem Clipper. Summary(pt_BR): Um compilador Clipper compativel Gratis Summary(ru): ó×ÏÂÏÄÎÙÊ ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ Clipper. +Summary(hu): Szabad szoftver Clipper kompatibilis fordító Name: %{name} Version: %{version} Release: %{releasen}%{platform} @@ -140,6 +141,7 @@ uma maquina virtual e documenta Summary: Shared runtime libaries for %{dname} compiler Summary(pl): Dzielone bilioteki dla kompilatora %{dname} Summary(ru): óÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÕÅÍÙÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname} +Summary(hu): Megosztott könyvtárak a(z) %{dname} fordítóhoz Group: Development/Languages Provides: lib%{name}.so lib%{name}mt.so @@ -163,6 +165,10 @@ linkados dinamicamente. üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÕÅÍÙÅ ÂÉÂÌÉÏÔÅËÉ %{dname}, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÒÁÂÏÔÙ ÄÉÎÁÍÉÞÅÓËÉ ÓËÏÍÐÏÎÏ×ÁÎÎÙÈ ÐÒÏÇÒÁÍÍ. +%description -l hu lib +A(z) %{dname} egy Clipper kompatibilis fordítóprogram. +Ez a csomag biztosítja a dinamikusan szerkesztett %{dname} +programokhoz szükséges megosztott (dinamikus) futtatókönyvtárakat. ###################################################################### ## static libs @@ -172,6 +178,7 @@ linkados dinamicamente. Summary: Static runtime libaries for %{dname} compiler Summary(pl): Statyczne bilioteki dla kompilatora %{dname} Summary(ru): óÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname} +Summary(hu): Statikus könyvtárak a(z) %{dname} fordítóhoz Group: Development/Languages Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} @@ -195,12 +202,18 @@ dos os programas üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ËÏÍÐÉÌÑÔÏÒÁ %{dname}, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÓÔÁÔÉÞÅÓËÏÊ ËÏÍÐÏÎÏ×ËÉ ÐÒÏÇÒÁÍÍ. +%description -l hu lib +A(z) %{dname} egy Clipper kompatibilis fordítóprogram. +Ez a csomag biztosítja a statikusan szerkesztett %{dname} +programokhoz szükséges statikus futtatókönyvtárakat. + %package contrib Summary: Contrib runtime libaries for %{dname} compiler Summary(pl): Bilioteki z drzewa contrib dla kompilatora %{dname} Summary(pt_BR): Libs contrib para %{dname} Summary(ru): âÉÂÌÉÏÔÅËÉ ÉÚ ÄÅÒÅ×Á contrib ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname} +Summary(hu): Kiegészítõ könyvtárak a(z) %{dname} fordítóhoz Group: Development/Languages Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} @@ -222,6 +235,11 @@ dos programas. %{dname} - ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper. üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ %{dname} ÉÚ ÄÅÒÅ×Á contrib. +%description -l hu lib +A(z) %{dname} egy Clipper kompatibilis fordítóprogram. +Ez a csomag kiegészítõ (contrib) könyvtárakat biztosít +statikus szerkesztéshez. + ###################################################################### ## Preperation. diff --git a/harbour/source/common/hbtrace.c b/harbour/source/common/hbtrace.c index 7f1cd61d26..92a60406c2 100644 --- a/harbour/source/common/hbtrace.c +++ b/harbour/source/common/hbtrace.c @@ -223,7 +223,7 @@ void hb_tr_trace( char * fmt, ... ) hb_tr_line_ = -1; } - if ( s_flush ) + if( s_flush ) { fflush( s_fp ); } diff --git a/harbour/source/rtl/abs.c b/harbour/source/rtl/abs.c index 6a86e3f44c..63cf4603bc 100644 --- a/harbour/source/rtl/abs.c +++ b/harbour/source/rtl/abs.c @@ -72,7 +72,7 @@ HB_FUNC( ABS ) if( iNumber >= 0 ) hb_retnilen( iNumber, iWidth ); #if -HB_INT_MAX > HB_INT_MIN - else if ( iNumber < -HB_INT_MAX ) + else if( iNumber < -HB_INT_MAX ) #if HB_LONG_MAX > HB_INT_MAX hb_retnint( - ( HB_LONG ) iNumber ); #else @@ -89,7 +89,7 @@ HB_FUNC( ABS ) if( lNumber >= 0 ) hb_retnintlen( lNumber, iWidth ); #if -HB_LONG_MAX > HB_LONG_MIN - else if ( lNumber < -HB_LONG_MAX ) + else if( lNumber < -HB_LONG_MAX ) hb_retndlen( - ( double ) lNumber, 0, iDec ); #endif else @@ -105,4 +105,3 @@ HB_FUNC( ABS ) else hb_errRT_BASE_SubstR( EG_ARG, 1089, NULL, "ABS", HB_ERR_ARGS_BASEPARAMS ); } - diff --git a/harbour/source/rtl/at.c b/harbour/source/rtl/at.c index a227c6ab3b..4e2deebed2 100644 --- a/harbour/source/rtl/at.c +++ b/harbour/source/rtl/at.c @@ -68,15 +68,18 @@ HB_FUNC( HB_AT ) ULONG ulEnd = ISNUM( 4 ) ? ( ULONG ) hb_parnl( 4 ) : ulTextLength; ULONG ulPos; - if ( ulStart > ulTextLength || ulEnd < ulStart ) hb_retnl( 0 ); + if( ulStart > ulTextLength || ulEnd < ulStart ) + hb_retnl( 0 ); else { - if ( ulEnd > ulTextLength ) ulEnd = ulTextLength; + if( ulEnd > ulTextLength ) + ulEnd = ulTextLength; ulPos = hb_strAt( hb_itemGetCPtr( pSub ), hb_itemGetCLen( pSub ), hb_itemGetCPtr( pText ) + ulStart - 1, ulEnd - ulStart + 1 ); - if ( ulPos > 0) ulPos += ( ulStart - 1 ); + if( ulPos > 0) + ulPos += ( ulStart - 1 ); hb_retnl( ulPos ); } diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 1e7608e972..058805a131 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -281,7 +281,7 @@ static void hb_conOut( USHORT uiParam, hb_out_func_typedef * pOutFunc ) else pszString = hb_itemString( pItem, &ulLen, &bFreeReq ); - if ( ulLen ) + if( ulLen ) pOutFunc( pszString, ulLen ); if( bFreeReq ) diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index d2cbd0012a..9f8f2e4fb1 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -139,7 +139,7 @@ HB_EXPORT char * hb_dateFormat( const char * szDate, char * szFormattedDate, con break; case 'M': - switch ( digit_count ) + switch( digit_count ) { case 4: if( ! used_m && format_count < size ) diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 6515590d51..d7edd61660 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -616,7 +616,7 @@ HB_EXPORT FHANDLE hb_fsPOpen( BYTE * pFilename, BYTE * pMode ) dup2( hNullHandle, 2 ); } iMaxFD = sysconf( _SC_OPEN_MAX ); - if ( iMaxFD < 3 ) + if( iMaxFD < 3 ) iMaxFD = 1024; for( hNullHandle = 3; hNullHandle < iMaxFD; ++hNullHandle ) close(hNullHandle); @@ -958,7 +958,7 @@ HB_EXPORT USHORT hb_fsWrite( FHANDLE hFileHandle, const BYTE * pBuff, USHORT uiC DWORD dwWritten = 0; BOOL fResult; - if ( uiCount ) + if( uiCount ) { fResult = WriteFile( DosToWinHandle(hFileHandle), pBuff, uiCount, &dwWritten, NULL ); } @@ -1567,7 +1567,7 @@ HB_EXPORT ULONG hb_fsSeek( FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags ) /* FIXME: it should work if DosSetFilePtr is lseek compatible but maybe OS2 has DosGetFilePtr too, if not then remove this comment, Druzus */ - if ( DosSetFilePtr( hFileHandle, 0, SEEK_CUR, &ulPos ) != 0 ) + if( DosSetFilePtr( hFileHandle, 0, SEEK_CUR, &ulPos ) != 0 ) { ulPos = 0; } @@ -1586,7 +1586,7 @@ HB_EXPORT ULONG hb_fsSeek( FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags ) hb_fsSetIOError( (DWORD) ulPos != INVALID_SET_FILE_POINTER, 0 ); } - if ( (DWORD) ulPos == INVALID_SET_FILE_POINTER ) + if( (DWORD) ulPos == INVALID_SET_FILE_POINTER ) { ulPos = (DWORD) SetFilePointer( DosToWinHandle(hFileHandle), 0, NULL, SEEK_CUR ); } @@ -1602,10 +1602,10 @@ HB_EXPORT ULONG hb_fsSeek( FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags ) ulPos = lseek( hFileHandle, lOffset, Flags ); hb_fsSetIOError( ulPos != (ULONG) -1, 0 ); } - if ( ulPos == (ULONG) -1 ) + if( ulPos == (ULONG) -1 ) { ulPos = lseek( hFileHandle, 0L, SEEK_CUR ); - if ( ulPos == (ULONG) -1 ) + if( ulPos == (ULONG) -1 ) { ulPos = 0; } @@ -1647,7 +1647,7 @@ HB_EXPORT HB_FOFFSET hb_fsSeekLarge( FHANDLE hFileHandle, HB_FOFFSET llOffset, U hb_fsSetIOError( llPos != ( HB_FOFFSET ) INVALID_SET_FILE_POINTER, 0 ); } - if ( llPos == ( HB_FOFFSET ) INVALID_SET_FILE_POINTER ) + if( llPos == ( HB_FOFFSET ) INVALID_SET_FILE_POINTER ) { ulOffsetHigh = 0; ulOffsetLow = SetFilePointer( DosToWinHandle( hFileHandle ), @@ -1670,7 +1670,7 @@ HB_EXPORT HB_FOFFSET hb_fsSeekLarge( FHANDLE hFileHandle, HB_FOFFSET llOffset, U hb_fsSetIOError( llPos != (HB_FOFFSET) -1, 0 ); } - if ( llPos == (HB_FOFFSET) -1 ) + if( llPos == (HB_FOFFSET) -1 ) { llPos = lseek64( hFileHandle, 0L, SEEK_CUR ); } @@ -2435,9 +2435,10 @@ HB_EXPORT BOOL hb_fsDisableWaitLocks( int iSet ) { BOOL fRetVal = s_fUseWaitLocks; - if ( iSet >= 0 ) + if( iSet >= 0 ) { s_fUseWaitLocks = ( iSet == 0 ); } + return fRetVal; } diff --git a/harbour/source/rtl/fserror.c b/harbour/source/rtl/fserror.c index 162e5ba9bc..6d00c0001b 100644 --- a/harbour/source/rtl/fserror.c +++ b/harbour/source/rtl/fserror.c @@ -74,7 +74,7 @@ static int hb_errnoToDosError( int ErrCode ) /* These C compilers use DOS error codes in errno */ iResult = ErrCode; #else - switch ( ErrCode ) + switch( ErrCode ) { #if defined( ENMFILE ) case ENMFILE: @@ -152,7 +152,7 @@ static int hb_WinToDosError( ULONG ulError ) { int iResult; - switch ( ulError ) + switch( ulError ) { case ERROR_ALREADY_EXISTS: iResult = 5; @@ -227,7 +227,7 @@ HB_EXPORT void hb_fsSetIOError( BOOL fResult, USHORT uiOperation ) /* TODO: implement it */ HB_SYMBOL_UNUSED( uiOperation ); - if ( fResult ) + if( fResult ) { s_uiOsErrorLast = s_uiErrorLast = 0; } @@ -242,7 +242,7 @@ HB_EXPORT void hb_fsSetIOError( BOOL fResult, USHORT uiOperation ) extern void __cdecl _dosmaperr( unsigned long oserrno ); _dosmaperr( GetLastError() ); #endif - if ( _doserrno != 0 ) + if( _doserrno != 0 ) { s_uiOsErrorLast = s_uiErrorLast = _doserrno; } diff --git a/harbour/source/rtl/gtfunc.c b/harbour/source/rtl/gtfunc.c index 851a47a160..0f71d9b49d 100644 --- a/harbour/source/rtl/gtfunc.c +++ b/harbour/source/rtl/gtfunc.c @@ -56,9 +56,9 @@ HB_FUNC( HB_SETDISPCP ) { - if ( ISCHAR(1) ) + if( ISCHAR( 1 ) ) { - if ( hb_pcount() == 2 && ISLOG(2) ) + if( hb_pcount() == 2 && ISLOG( 2 ) ) hb_gtSetDispCP( hb_parc( 1 ), NULL, hb_parl( 2 ) ); else hb_gtSetDispCP( hb_parc( 1 ), hb_parc( 2 ), hb_parl( 3 ) ); @@ -69,19 +69,17 @@ HB_FUNC( HB_SETDISPCP ) HB_FUNC( HB_SETKEYCP ) { - if ( ISCHAR(1) ) - { + if( ISCHAR( 1 ) ) hb_gtSetKeyCP( hb_parc( 1 ), hb_parc( 2 ) ); - } else hb_errRT_BASE_SubstR( EG_ARG, 1089, NULL, "HB_SETKEYCP", HB_ERR_ARGS_BASEPARAMS ); } HB_FUNC( HB_SETTERMCP ) { - if ( ISCHAR(1) ) + if( ISCHAR( 1 ) ) { - if ( hb_pcount() == 2 && ISLOG(2) ) + if( hb_pcount() == 2 && ISLOG( 2 ) ) { hb_gtSetDispCP( hb_parc( 1 ), NULL, hb_parl( 2 ) ); hb_gtSetKeyCP( hb_parc( 1 ), NULL ); @@ -120,38 +118,29 @@ HB_FUNC( HB_GTVERSION ) HB_FUNC( HB_GTALERT ) { - int iClrNorm = ISCHAR( 3 ) ? hb_gtColorToN( hb_parc( 3 ) ) : hb_parni( 3 ), - iClrHigh = ISCHAR( 4 ) ? hb_gtColorToN( hb_parc( 4 ) ) : hb_parni( 4 ); - - hb_retni( hb_gtAlert( hb_param( 1, HB_IT_ANY ), hb_param( 2, HB_IT_ANY ), - iClrNorm, iClrHigh, hb_parnd( 5 ) ) ); + hb_retni( hb_gtAlert( hb_param( 1, HB_IT_ANY ), + hb_param( 2, HB_IT_ANY ), + ISCHAR( 3 ) ? hb_gtColorToN( hb_parc( 3 ) ) : hb_parni( 3 ) /* iClrNorm */, + ISCHAR( 4 ) ? hb_gtColorToN( hb_parc( 4 ) ) : hb_parni( 4 ) /* iClrHigh */, + hb_parnd( 5 ) ) ); } HB_FUNC( HB_GFXPRIMITIVE ) { - PHB_ITEM pType = hb_param( 1, HB_IT_NUMERIC ); - PHB_ITEM pTop = hb_param( 2, HB_IT_NUMERIC ); - PHB_ITEM pLeft = hb_param( 3, HB_IT_NUMERIC ); - PHB_ITEM pBottom = hb_param( 4, HB_IT_NUMERIC ); - PHB_ITEM pRight = hb_param( 5, HB_IT_NUMERIC ); - PHB_ITEM pColor = hb_param( 6, HB_IT_NUMERIC ); - - hb_retni( hb_gtGfxPrimitive( hb_itemGetNI(pType), - hb_itemGetNI(pTop), hb_itemGetNI(pLeft), - hb_itemGetNI(pBottom), hb_itemGetNI(pRight), - hb_itemGetNI(pColor) ) ); + hb_retni( hb_gtGfxPrimitive( hb_parni( 1 ) /* nType */, + hb_parni( 2 ) /* nTop */, + hb_parni( 3 ) /* nLeft */, + hb_parni( 4 ) /* nBottom */, + hb_parni( 5 ) /* nRight */, + hb_parni( 6 ) /* nColor */ ) ); } HB_FUNC( HB_GFXTEXT ) { - PHB_ITEM pTop = hb_param( 1, HB_IT_NUMERIC ); - PHB_ITEM pLeft = hb_param( 2, HB_IT_NUMERIC ); - char *cText = hb_parc(3); - PHB_ITEM pColor = hb_param( 4, HB_IT_NUMERIC ); - PHB_ITEM pSize = hb_param( 5, HB_IT_NUMERIC ); - PHB_ITEM pWidth = hb_param( 6, HB_IT_NUMERIC ); - - hb_gtGfxText( hb_itemGetNI(pTop), - hb_itemGetNI(pLeft), cText, hb_itemGetNI(pColor), - hb_itemGetNI(pSize), hb_itemGetNI(pWidth) ); + hb_gtGfxText( hb_parni( 1 ) /* nTop */, + hb_parni( 2 ) /* nLeft */, + hb_parc( 3 ) /* cText */, + hb_parni( 4 ) /* nColor */, + hb_parni( 5 ) /* nSize */, + hb_parni( 6 ) /* nWidth */ ); } diff --git a/harbour/source/rtl/hbhex.c b/harbour/source/rtl/hbhex.c index 444b0c8182..040e991f39 100644 --- a/harbour/source/rtl/hbhex.c +++ b/harbour/source/rtl/hbhex.c @@ -67,11 +67,11 @@ HB_FUNC( HB_HEXTONUM ) { int iDigit; char c = *szHex++; - if ( c >= '0' && c <= '9' ) + if( c >= '0' && c <= '9' ) iDigit = c - '0'; - else if ( c >= 'A' && c <= 'F' ) + else if( c >= 'A' && c <= 'F' ) iDigit = c - ( 'A' - 10 ); - else if ( c >= 'a' && c <= 'f' ) + else if( c >= 'a' && c <= 'f' ) iDigit = c - ( 'a' - 10 ); else { diff --git a/harbour/source/rtl/hbrandom.c b/harbour/source/rtl/hbrandom.c index 3b227bd5c5..877c91daa9 100644 --- a/harbour/source/rtl/hbrandom.c +++ b/harbour/source/rtl/hbrandom.c @@ -80,7 +80,7 @@ HB_FUNC( HB_RANDOM ) { double dX = hb_parnd( 2 ); double dY = hb_parnd( 1 ); - if ( dX > dY ) + if( dX > dY ) { double dZ = dY; dY = dX; @@ -110,7 +110,7 @@ HB_FUNC( HB_RANDOMINT ) { HB_LONG lX = hb_parnint( 1 ); HB_LONG lY = hb_parnint( 2 ); - if ( lX > lY ) + if( lX > lY ) { HB_LONG lZ = lY; lY = lX; diff --git a/harbour/source/rtl/hbregex.c b/harbour/source/rtl/hbregex.c index 3dc5798b7b..47fda74a6e 100644 --- a/harbour/source/rtl/hbregex.c +++ b/harbour/source/rtl/hbregex.c @@ -273,7 +273,7 @@ static BOOL hb_regex( int iRequest ) iMatches = hb_regexec( pRegEx, pszString, ulLen, iMaxMatch, aMatches ); if( iMatches > 0 ) { - switch ( iRequest ) + switch( iRequest ) { case 0: pRetArray = hb_itemArrayNew( iMatches ); @@ -386,7 +386,7 @@ static BOOL hb_regex( int iRequest ) if( !fOnlyMatch ) { hb_arrayNew( pMatch, 3 ); - if ( iEO != -1 ) + if( iEO != -1 ) { /* matched string */ hb_arraySetCL( pMatch, 1, pszString + iSO, iEO - iSO ); diff --git a/harbour/source/rtl/mod.c b/harbour/source/rtl/mod.c index db2559bd3b..13a79a60d1 100644 --- a/harbour/source/rtl/mod.c +++ b/harbour/source/rtl/mod.c @@ -79,7 +79,7 @@ HB_FUNC( MOD ) { double dResult = fmod( dNumber, dBase ); - if ( dResult && ( dNumber > 0 ? dBase < 0 : dBase > 0 ) ) + if( dResult && ( dNumber > 0 ? dBase < 0 : dBase > 0 ) ) dResult += dBase; hb_retnd( dResult ); } diff --git a/harbour/source/rtl/padc.c b/harbour/source/rtl/padc.c index c61f4a9429..c504081a19 100644 --- a/harbour/source/rtl/padc.c +++ b/harbour/source/rtl/padc.c @@ -88,12 +88,12 @@ HB_FUNC( PADC ) ( ULONG ) lLen - ulSize - ulPad ); hb_retclen_buffer( szResult, ( ULONG ) lLen ); - if ( bFreeReq ) + if( bFreeReq ) hb_xfree( szText ); } else { - if ( bFreeReq ) + if( bFreeReq ) hb_retclen_buffer( szText, ( ULONG ) lLen ); else hb_retclen( szText, lLen ); diff --git a/harbour/source/rtl/padl.c b/harbour/source/rtl/padl.c index 8cf67a5077..06cd995c77 100644 --- a/harbour/source/rtl/padl.c +++ b/harbour/source/rtl/padl.c @@ -85,12 +85,12 @@ HB_FUNC( PADL ) hb_xmemcpy( szResult + ( ULONG ) lLen - ulSize, szText, ulSize ); hb_retclen_buffer( szResult, ( ULONG ) lLen ); - if ( bFreeReq ) + if( bFreeReq ) hb_xfree( szText ); } else { - if ( bFreeReq ) + if( bFreeReq ) hb_retclen_buffer( szText, ( ULONG ) lLen ); else hb_retclen( szText, lLen ); diff --git a/harbour/source/rtl/padr.c b/harbour/source/rtl/padr.c index 4ffb1fc837..a0e9e8a732 100644 --- a/harbour/source/rtl/padr.c +++ b/harbour/source/rtl/padr.c @@ -85,12 +85,12 @@ HB_FUNC( PADR ) hb_xmemset( szResult + ulSize, cPad, ( ULONG ) lLen - ulSize ); hb_retclen_buffer( szResult, ( ULONG ) lLen ); - if ( bFreeReq ) + if( bFreeReq ) hb_xfree( szText ); } else { - if ( bFreeReq ) + if( bFreeReq ) hb_retclen_buffer( szText, ( ULONG ) lLen ); else hb_retclen( szText, lLen ); diff --git a/harbour/source/rtl/strmatch.c b/harbour/source/rtl/strmatch.c index f4e5faf875..a726fb5249 100644 --- a/harbour/source/rtl/strmatch.c +++ b/harbour/source/rtl/strmatch.c @@ -70,18 +70,18 @@ HB_EXPORT BOOL hb_strMatchWild( const char *szString, const char *szPattern ) i = j = ulAny = 0; ulLen = strlen( szString ); ulSize = strlen( szPattern ); - while ( i < ulSize ) + while( i < ulSize ) { - if ( szPattern[i] == '*' ) + if( szPattern[i] == '*' ) { fAny = TRUE; i++; } - else if ( j < ulLen && ( szPattern[i] == '?' || szPattern[i] == szString[j] ) ) + else if( j < ulLen && ( szPattern[i] == '?' || szPattern[i] == szString[j] ) ) { - if ( fAny ) + if( fAny ) { - if ( ulAny >= ulBufSize ) + if( ulAny >= ulBufSize ) { if( ( ulBufSize <<= 1 ) == ( HB_MAX_WILDPATTERN << 1 ) ) { @@ -104,11 +104,11 @@ HB_EXPORT BOOL hb_strMatchWild( const char *szString, const char *szPattern ) j++; i++; } - else if ( fAny && j < ulLen ) + else if( fAny && j < ulLen ) { j++; } - else if ( ulAny > 0 ) + else if( ulAny > 0 ) { ulAny--; i = ulAnyPosP[ulAny]; @@ -140,19 +140,19 @@ HB_EXPORT BOOL hb_strMatchWildExact( const char *szString, const char *szPattern i = j = ulAny = 0; ulLen = strlen( szString ); ulSize = strlen( szPattern ); - while ( i < ulSize || ( j < ulLen && !fAny ) ) + while( i < ulSize || ( j < ulLen && !fAny ) ) { - if ( i < ulSize && szPattern[i] == '*' ) + if( i < ulSize && szPattern[i] == '*' ) { fAny = TRUE; i++; } - else if ( j < ulLen && i < ulSize && - ( szPattern[i] == '?' || szPattern[i] == szString[j] ) ) + else if( j < ulLen && i < ulSize && + ( szPattern[i] == '?' || szPattern[i] == szString[j] ) ) { - if ( fAny ) + if( fAny ) { - if ( ulAny >= ulBufSize ) + if( ulAny >= ulBufSize ) { if( ( ulBufSize <<= 1 ) == ( HB_MAX_WILDPATTERN << 1 ) ) { @@ -175,11 +175,11 @@ HB_EXPORT BOOL hb_strMatchWildExact( const char *szString, const char *szPattern j++; i++; } - else if ( fAny && j < ulLen ) + else if( fAny && j < ulLen ) { j++; } - else if ( ulAny > 0 ) + else if( ulAny > 0 ) { ulAny--; i = ulAnyPosP[ulAny]; @@ -213,18 +213,18 @@ HB_EXPORT BOOL hb_strMatchCaseWildExact( const char *szString, const char *szPat ulSize = strlen( szPattern ); while ( i < ulSize || ( j < ulLen && !fAny ) ) { - if ( i < ulSize && szPattern[i] == '*' ) + if( i < ulSize && szPattern[i] == '*' ) { fAny = TRUE; i++; } - else if ( j < ulLen && i < ulSize && - ( szPattern[i] == '?' || - hb_charUpper( szPattern[i] ) == hb_charUpper( szString[j] ) ) ) + else if( j < ulLen && i < ulSize && + ( szPattern[i] == '?' || + hb_charUpper( szPattern[i] ) == hb_charUpper( szString[j] ) ) ) { - if ( fAny ) + if( fAny ) { - if ( ulAny >= ulBufSize ) + if( ulAny >= ulBufSize ) { if( ( ulBufSize <<= 1 ) == ( HB_MAX_WILDPATTERN << 1 ) ) { @@ -247,11 +247,11 @@ HB_EXPORT BOOL hb_strMatchCaseWildExact( const char *szString, const char *szPat j++; i++; } - else if ( fAny && j < ulLen ) + else if( fAny && j < ulLen ) { j++; } - else if ( ulAny > 0 ) + else if( ulAny > 0 ) { ulAny--; i = ulAnyPosP[ulAny]; diff --git a/harbour/source/rtl/val.c b/harbour/source/rtl/val.c index 30a4fb4d0b..8bc7b0d2c0 100644 --- a/harbour/source/rtl/val.c +++ b/harbour/source/rtl/val.c @@ -69,7 +69,7 @@ HB_FUNC( VAL ) fDbl = hb_valStrnToNum( szText, iLen, &lValue, &dValue , &iDec, &iWidth ); - if ( !fDbl ) + if( !fDbl ) hb_retnintlen( lValue, iWidth ); else hb_retnlen( dValue, iWidth, iDec ); diff --git a/harbour/source/vm/arrayshb.c b/harbour/source/vm/arrayshb.c index 30469fa83a..a5a620e16b 100644 --- a/harbour/source/vm/arrayshb.c +++ b/harbour/source/vm/arrayshb.c @@ -224,15 +224,15 @@ HB_FUNC( AFILL ) LONG lStart = hb_parnl( 3 ), lCount = hb_parnl( 4 ); /* Explicy lCount of 0 - Nothing to do! */ - if ( ISNUM(4) && lCount == 0 ) + if( ISNUM( 4 ) && lCount == 0 ) return; /* Clipper aborts if negative start. */ - else if ( lStart < 0 ) + else if( lStart < 0 ) return; /* Clipper allows Start to be of wrong type, or 0, and corrects it to 1. */ - else if ( lStart == 0 ) + else if( lStart == 0 ) lStart = 1; - if ( lCount < 0 ) + if( lCount < 0 ) { /* Clipper allows the Count to be negative, if start is 1, and corrects it to maximum elements. */ if( lStart == 1 ) diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 9f378299ed..86a8fecc55 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -2521,57 +2521,57 @@ static BOOL hb_clsAddMsg( USHORT uiClass, const char * szMessage, pMessage = s___msgDestructor.pDynSym; else if( uiType == HB_OO_MSG_ONERROR ) pMessage = s___msgOnError.pDynSym; - else if (strcmp("+", szMessage) == 0) + else if( strcmp( "+", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_PLUS )->pDynSym; - else if (strcmp("-", szMessage) == 0) + else if( strcmp( "-", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_MINUS )->pDynSym; - else if (strcmp("*", szMessage) == 0) + else if( strcmp( "*", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_MULT )->pDynSym; - else if (strcmp("/", szMessage) == 0) + else if( strcmp( "/", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_DIVIDE )->pDynSym; - else if (strcmp("%", szMessage) == 0) + else if( strcmp( "%", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_MOD )->pDynSym; - else if (strcmp("^", szMessage) == 0) + else if( strcmp( "^", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_POWER )->pDynSym; - else if (strcmp("**", szMessage) == 0) + else if( strcmp( "**", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_POWER )->pDynSym; - else if (strcmp("++", szMessage) == 0) + else if( strcmp( "++", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_INC )->pDynSym; - else if (strcmp("--", szMessage) == 0) + else if( strcmp( "--", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_DEC )->pDynSym; - else if (strcmp("==", szMessage) == 0) + else if( strcmp( "==", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_EXACTEQUAL )->pDynSym; - else if (strcmp("=", szMessage) == 0) + else if( strcmp( "=", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_EQUAL )->pDynSym; - else if (strcmp("!=", szMessage) == 0) + else if( strcmp( "!=", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_NOTEQUAL )->pDynSym; - else if (strcmp("<>", szMessage) == 0) + else if( strcmp( "<>", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_NOTEQUAL )->pDynSym; - else if (strcmp("#", szMessage) == 0) + else if( strcmp( "#", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_NOTEQUAL )->pDynSym; - else if (strcmp("<", szMessage) == 0) + else if( strcmp( "<", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_LESS )->pDynSym; - else if (strcmp("<=", szMessage) == 0) + else if( strcmp( "<=", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_LESSEQUAL )->pDynSym; - else if (strcmp(">", szMessage) == 0) + else if( strcmp( ">", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_GREATER )->pDynSym; - else if (strcmp(">=", szMessage) == 0) + else if( strcmp( ">=", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_GREATEREQUAL )->pDynSym; - else if (strcmp(":=", szMessage) == 0) + else if( strcmp( ":=", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_ASSIGN )->pDynSym; - else if (strcmp("$", szMessage) == 0) + else if( strcmp( "$", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_INSTRING )->pDynSym; - else if (strcmp("$$", szMessage) == 0) + else if( strcmp( "$$", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_INCLUDE )->pDynSym; - else if (strcmp("!", szMessage) == 0) + else if( strcmp( "!", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_NOT )->pDynSym; - else if (hb_stricmp(".NOT.", szMessage) == 0) + else if( hb_stricmp( ".NOT.", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_NOT )->pDynSym; - else if (hb_stricmp(".AND.", szMessage) == 0) + else if( hb_stricmp( ".AND.", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_AND )->pDynSym; - else if (hb_stricmp(".OR.", szMessage) == 0) + else if( hb_stricmp( ".OR.", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_OR )->pDynSym; - else if( strcmp("[]", szMessage) == 0) + else if( strcmp( "[]", szMessage ) == 0 ) pMessage = ( s_opSymbols + HB_OO_OP_ARRAYINDEX )->pDynSym; else pMessage = hb_dynsymGet( szMessage ); diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index c633291409..fe0272345d 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -591,7 +591,7 @@ HB_EXPORT void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ snprintf( buffer, sizeof( buffer ), "Total memory allocated: %li bytes (%li block(s))", s_lMemoryMaxConsumed, s_lMemoryMaxBlocks ); hb_conOutErr( buffer, 0 ); - if ( hLog ) + if( hLog ) { char szTime[ 9 ]; int iYear, iMonth, iDay; @@ -610,7 +610,8 @@ HB_EXPORT void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ snprintf( buffer, sizeof( buffer ), "WARNING! Memory allocated but not released: %li bytes (%li block(s))", s_lMemoryConsumed, s_lMemoryBlocks ); hb_conOutErr( buffer, 0 ); - if ( hLog ) fprintf( hLog, "%s\n", buffer ); + if( hLog ) + fprintf( hLog, "%s\n", buffer ); } hb_conOutErr( hb_conNewLine(), 0 ); diff --git a/harbour/source/vm/hashes.c b/harbour/source/vm/hashes.c index 539a7a27d0..a363cb7de9 100644 --- a/harbour/source/vm/hashes.c +++ b/harbour/source/vm/hashes.c @@ -319,7 +319,7 @@ HB_EXPORT PHB_ITEM hb_hashNew( PHB_ITEM pItem ) HB_TRACE(HB_TR_DEBUG, ("hb_hashNew(%p)", pItem)); - if ( pItem == NULL ) + if( pItem == NULL ) pItem = hb_itemNew( NULL ); else if( HB_IS_COMPLEX( pItem ) ) hb_itemClear( pItem ); diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index ee1a88a26d..2f1d00864d 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -2699,7 +2699,7 @@ static void hb_vmModulus( HB_ITEM_PTR pResult, HB_ITEM_PTR pItem1, HB_ITEM_PTR p { HB_LONG lDivisor = HB_ITEM_GET_NUMINTRAW( pItem2 ); - if ( lDivisor == 0 ) + if( lDivisor == 0 ) { PHB_ITEM pSubst = hb_errRT_BASE_Subst( EG_ZERODIV, 1341, NULL, "%", 2, pItem1, pItem2 ); diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 711dcb517f..8d5501bc22 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -922,9 +922,9 @@ HB_EXPORT PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, i if( iDec > 0 ) return hb_itemPutNDLen( pItem, dNumber, iWidth, iDec ); - else if ( HB_DBL_LIM_INT( dNumber ) ) + else if( HB_DBL_LIM_INT( dNumber ) ) return hb_itemPutNILen( pItem, ( int ) dNumber, iWidth ); - else if ( HB_DBL_LIM_LONG( dNumber ) ) + else if( HB_DBL_LIM_LONG( dNumber ) ) #ifdef HB_LONG_LONG_OFF return hb_itemPutNLLen( pItem, ( long ) dNumber, iWidth ); #else @@ -1118,11 +1118,11 @@ HB_EXPORT PHB_ITEM hb_itemPutNumType( PHB_ITEM pItem, double dNumber, int iDec, { return hb_itemPutNDDec( pItem, dNumber, iDec ); } - else if ( HB_DBL_LIM_INT( dNumber ) ) + else if( HB_DBL_LIM_INT( dNumber ) ) { return hb_itemPutNI( pItem, ( int ) dNumber ); } - else if ( HB_DBL_LIM_LONG( dNumber ) ) + else if( HB_DBL_LIM_LONG( dNumber ) ) { #ifdef HB_LONG_LONG_OFF return hb_itemPutNL( pItem, ( long ) dNumber ); @@ -2048,11 +2048,11 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i int iPos, iDot; BOOL fNeg; - if ( iDec < 0 ) + if( iDec < 0 ) { iDec = 0; } - if ( iDec > 0 ) + if( iDec > 0 ) { iPos = iDot = iSize - iDec - 1; } @@ -2116,7 +2116,7 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i iPrec = 16; #endif - if ( dNumber < 0 ) + if( dNumber < 0 ) { fNeg = TRUE; dFract = modf( -dNumber, &dInt ); @@ -2127,35 +2127,35 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i dFract = modf( dNumber, &dInt ); } - while ( iPos-- > 0 ) + while( iPos-- > 0 ) { dDig = modf( dInt / doBase + 0.01, &dInt ) * doBase; szResult[ iPos ] = '0' + ( char ) ( dDig + 0.01 ); - if ( szResult[ iPos ] != '0' ) + if( szResult[ iPos ] != '0' ) iFirst = iPos; - if ( dInt < 1 ) + if( dInt < 1 ) break; } - if ( iPos > 0 ) + if( iPos > 0 ) { memset( szResult, ' ', iPos ); } - if ( iDec > 0 && iPos >= 0 ) + if( iDec > 0 && iPos >= 0 ) { - for ( iPos = iDot + 1; iPos < iSize; iPos++ ) + for( iPos = iDot + 1; iPos < iSize; iPos++ ) { dFract = modf( dFract * doBase, &dDig ); szResult[ iPos ] = '0' + ( char ) ( dDig + 0.01 ); - if ( iFirst < 0 ) + if( iFirst < 0 ) { - if ( szResult[ iPos ] != '0' ) + if( szResult[ iPos ] != '0' ) { iFirst = iPos - 1; } } - else if ( iPos - iFirst >= iPrec ) + else if( iPos - iFirst >= iPrec ) { break; } @@ -2164,11 +2164,11 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i /* now try to round the results and set 0 in places over defined precision, the same is done by Clipper */ - if ( iPos >= 0 ) + if( iPos >= 0 ) { int iZer, iLast; - if ( iFirst < 0 ) + if( iFirst < 0 ) { iZer = 0; } @@ -2180,15 +2180,15 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i iLast = ( int ) ( dDig + 0.01 ); /* hack for x.xxxx4999999999, f.e. 8.995 ~FL 8.994999999999999218.. */ - if ( iLast == 4 && iZer < 0 ) + if( iLast == 4 && iZer < 0 ) { - for ( iPos = -iZer; iPos > 0; --iPos ) + for( iPos = -iZer; iPos > 0; --iPos ) { dFract = modf( dFract * doBase, &dDig ); - if ( dDig + 0.01 < 9 && ( iPos != 1 || dDig < 2 ) ) + if( dDig + 0.01 < 9 && ( iPos != 1 || dDig < 2 ) ) break; } - if ( iPos == 0 ) + if( iPos == 0 ) iLast = 5; } iLast = iLast >= 5 ? 1 : 0; @@ -2196,26 +2196,26 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i iPos = iSize; while ( iPos-- > 0 ) { - if ( iDec == 0 || iPos != iDot ) + if( iDec == 0 || iPos != iDot ) { - if ( iZer > 0 ) + if( iZer > 0 ) { - if ( iDec == 0 || iPos <= iDot + 1 ) + if( iDec == 0 || iPos <= iDot + 1 ) { iLast = szResult[ iPos ] >= '5' ? 1 : 0; } szResult[ iPos ] = '0'; --iZer; } - else if ( iLast > 0 ) + else if( iLast > 0 ) { - if ( szResult[ iPos ] == '9' ) + if( szResult[ iPos ] == '9' ) { szResult[ iPos ] = '0'; } else { - if ( szResult[ iPos ] < '0' ) /* '-' or ' ' */ + if( szResult[ iPos ] < '0' ) /* '-' or ' ' */ { szResult[ iPos ] = '1'; iFirst = iPos; @@ -2223,7 +2223,7 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i else { szResult[ iPos ]++; - if ( iFirst < 0 ) + if( iFirst < 0 ) { iFirst = iPos; } @@ -2237,10 +2237,10 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i } } } - if ( fNeg && iFirst >= 0 && iPos >= 0 ) + if( fNeg && iFirst >= 0 && iPos >= 0 ) { iPos = ( iDot > 0 && iFirst >= iDot ) ? iDot - 2 : iFirst - 1; - if ( iPos >= 0 ) + if( iPos >= 0 ) { szResult[ iPos ] = '-'; } @@ -2275,16 +2275,16 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i { szResult[ iPos ] = '0' + ( char ) ( fNeg ? -( lNumber % 10 ) : ( lNumber % 10 ) ); lNumber /= 10; - if ( lNumber == 0 ) + if( lNumber == 0 ) break; } - if ( fNeg && iPos-- > 0 ) + if( fNeg && iPos-- > 0 ) szResult[ iPos ] = '-'; - if ( iPos > 0 ) + if( iPos > 0 ) memset( szResult, ' ', iPos ); - if ( iDec > 0 && iPos >= 0 ) + if( iDec > 0 && iPos >= 0 ) memset( &szResult[iSize - iDec], '0', iDec ); } @@ -2295,7 +2295,7 @@ HB_EXPORT BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int i memset( szResult, '*', iSize ); return FALSE; } - else if ( iDot > 0 ) + else if( iDot > 0 ) { szResult[ iDot ] = '.'; } @@ -2348,7 +2348,7 @@ HB_EXPORT char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ) if( iDec <= 0 ) iDec = 0; - else if ( pWidth ) + else if( pWidth ) iWidth -= ( iDec + 1 ); } @@ -2499,9 +2499,9 @@ HB_EXPORT char * hb_itemPadConv( PHB_ITEM pItem, ULONG * pulSize, BOOL * bFreeRe /* remove leading spaces if any, a little bit redundant but * I don't want to complicate the API interface more. Druzus */ - for ( i = 0; buffer[i] == ' '; i++ ); + for( i = 0; buffer[i] == ' '; i++ ); - if ( i > 0 ) + if( i > 0 ) { int j = 0; * pulSize -= i; @@ -2509,7 +2509,7 @@ HB_EXPORT char * hb_itemPadConv( PHB_ITEM pItem, ULONG * pulSize, BOOL * bFreeRe { buffer[j++] = buffer[i]; } - while ( buffer[i++] ); + while( buffer[i++] ); } return buffer; } diff --git a/harbour/source/vm/maindllp.c b/harbour/source/vm/maindllp.c index 060ab15a15..5c413284b2 100644 --- a/harbour/source/vm/maindllp.c +++ b/harbour/source/vm/maindllp.c @@ -216,141 +216,141 @@ PHB_ITEM hb_param( int iParam, long lMask ) /* retrieve a generic parameter */ PHB_ITEM hb_paramError( int iParam ) /* Returns either the generic parameter or a NIL item if param not provided */ { PHB_ITEM pReturn = NULL; - FARPROC pParamError=GetProcAddress( GetModuleHandle( NULL ), "_hb_paramError" ); - if (pParamError) - pReturn=((HB_PARAMERROR)pParamError)(iParam); + FARPROC pParamError = GetProcAddress( GetModuleHandle( NULL ), "_hb_paramError" ); + if( pParamError ) + pReturn = ((HB_PARAMERROR)pParamError)(iParam); return pReturn; } int hb_pcount( void ) /* returns the number of suplied parameters */ { int iReturn = 0; - FARPROC pCounts=GetProcAddress(GetModuleHandle( NULL ), "_hb_pcount" ); - if (pCounts) - iReturn=((HB_PCOUNTS)pCounts)(); + FARPROC pCounts = GetProcAddress( GetModuleHandle( NULL ), "_hb_pcount" ); + if( pCounts ) + iReturn = ((HB_PCOUNTS)pCounts)(); return iReturn; } void hb_retc( const char * szText ) /* returns a string */ { FARPROC pRetc=GetProcAddress(GetModuleHandle( NULL ), "_hb_retc" ); - if (pRetc) + if( pRetc ) ((HB_RETC)pRetc)(szText); } void hb_retclen( const char * szText, ULONG ulLen ) /* returns a string with a specific length */ { - FARPROC pRetclen=GetProcAddress(GetModuleHandle( NULL ), "_hb_retclen" ); - if (pRetclen) + FARPROC pRetclen = GetProcAddress(GetModuleHandle( NULL ), "_hb_retclen" ); + if( pRetclen ) ((HB_RETCLEN)pRetclen)(szText,ulLen); } void hb_retds( const char * szDate ) /* returns a date, must use yyyymmdd format */ { - FARPROC pRetds=GetProcAddress(GetModuleHandle( NULL ), "_hb_retds" ); - if (pRetds) + FARPROC pRetds = GetProcAddress(GetModuleHandle( NULL ), "_hb_retds" ); + if( pRetds ) ((HB_RETDS)pRetds)(szDate); } void hb_retd( int iYear, int iMonth, int iDay ) /* returns a date */ { - FARPROC pRetd=GetProcAddress(GetModuleHandle( NULL ), "_hb_retd" ); - if (pRetd) - ((HB_RETD)pRetd)(iYear,iMonth,iDay); + FARPROC pRetd = GetProcAddress(GetModuleHandle( NULL ), "_hb_retd" ); + if( pRetd ) + ((HB_RETD)pRetd)( iYear, iMonth, iDay ); } void hb_retdl( long lJulian ) /* returns a long value as a julian date */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retdl" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retdl" ); + if( pRet ) ((HB_RETDL)pRet)(lJulian); } void hb_retl( int iTrueFalse ) /* returns a logical integer */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retl" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retl" ); + if( pRet ) ((HB_RETDL)pRet)(iTrueFalse); } void hb_retnd( double dNumber ) /* returns a double */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retnd" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retnd" ); + if( pRet ) ((HB_RETND)pRet)(dNumber); } -void hb_retni( int iNumber ) /* returns a integer number */ +void hb_retni( int iNumber ) /* returns a integer number */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retni" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retni" ); + if( pRet ) ((HB_RETNI)pRet)(iNumber); } void hb_retnl( long lNumber ) /* returns a long number */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retnl" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retnl" ); + if( pRet ) ((HB_RETNL)pRet)(lNumber); } void hb_retnlen( double dNumber, int iWidth, int iDec ) /* returns a double, with specific width and decimals */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retnlen" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retnlen" ); + if( pRet ) ((HB_RETNLEN)pRet)(dNumber,iWidth,iDec); } void hb_retndlen( double dNumber, int iWidth, int iDec ) /* returns a double, with specific width and decimals */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retndlen" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retndlen" ); + if( pRet ) ((HB_RETNDLEN)pRet)(dNumber,iWidth,iDec); } void hb_retnilen( int iNumber, int iWidth ) /* returns a integer number, with specific width */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retnilen" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retnilen" ); + if( pRet ) ((HB_RETNILEN)pRet)(iNumber,iWidth); } void hb_retnllen( long lNumber, int iWidth ) /* returns a long number, with specific width */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_retnilen" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_retnilen" ); + if( pRet ) ((HB_RETNLLEN)pRet)(lNumber,iWidth); } void hb_reta( ULONG ulLen ) /* returns an array with a specific length */ { - FARPROC pRet=GetProcAddress(GetModuleHandle( NULL ), "_hb_reta" ); - if (pRet) + FARPROC pRet = GetProcAddress(GetModuleHandle( NULL ), "_hb_reta" ); + if( pRet ) ((HB_RETA)pRet)(ulLen); } ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex ) /* retrieve length or element type of an array parameter */ { ULONG ulReturn = 0; - FARPROC pParinfa=GetProcAddress( GetModuleHandle( NULL ), "_hb_parinfa" ); - if (pParinfa) - ulReturn=((HB_PARINFA)pParinfa)(iParamNum,uiArrayIndex); + FARPROC pParinfa = GetProcAddress( GetModuleHandle( NULL ), "_hb_parinfa" ); + if( pParinfa ) + ulReturn = ((HB_PARINFA)pParinfa)(iParamNum,uiArrayIndex); return ulReturn; } ULONG hb_parinfo( int iParam ) /* Determine the param count or data type */ { ULONG ulReturn = 0; - FARPROC pParinfo=GetProcAddress( GetModuleHandle( NULL ), "_hb_parinfo" ); - if (pParinfo) - ulReturn=((HB_PARINFO)pParinfo)(iParam); + FARPROC pParinfo = GetProcAddress( GetModuleHandle( NULL ), "_hb_parinfo" ); + if( pParinfo ) + ulReturn = ((HB_PARINFO)pParinfo)(iParam); return ulReturn; } ULONG hb_parclen( int iParam, ... ) /* retrieve a string parameter length */ { - FARPROC pParC= GetProcAddress( GetModuleHandle( NULL ), "_hb_parclen" ); + FARPROC pParC = GetProcAddress( GetModuleHandle( NULL ), "_hb_parclen" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParC ) { @@ -372,10 +372,10 @@ ULONG hb_parclen( int iParam, ... ) /* retrieve a string parameter length */ return 0; } -ULONG hb_parcsiz( int iParam, ... )/* retrieve a by-reference string parameter length, including terminator */ +ULONG hb_parcsiz( int iParam, ... )/* retrieve a by-reference string parameter length, including terminator */ { FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); - FARPROC pParcSiz= GetProcAddress( GetModuleHandle( NULL ), "_hb_parcsiz" ); + FARPROC pParcSiz = GetProcAddress( GetModuleHandle( NULL ), "_hb_parcsiz" ); if( pExtIsArray && pParcSiz ) { @@ -399,7 +399,7 @@ ULONG hb_parcsiz( int iParam, ... )/* retrieve a by-reference string paramete char * hb_pards( int iParam, ... ) /* retrieve a date as a string yyyymmdd */ { - FARPROC pParDs= GetProcAddress( GetModuleHandle( NULL ), "_hb_pards" ); + FARPROC pParDs = GetProcAddress( GetModuleHandle( NULL ), "_hb_pards" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParDs ) @@ -450,7 +450,7 @@ char * hb_pardsbuff( char * szDate, int iParam, ... ) /* retrieve a date as a st int hb_parl( int iParam, ... ) /* retrieve a logical parameter as an int */ { /* int iReturn; */ - FARPROC pParL=GetProcAddress( GetModuleHandle( NULL ), "_hb_parl" ); + FARPROC pParL = GetProcAddress( GetModuleHandle( NULL ), "_hb_parl" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParL ) @@ -476,7 +476,7 @@ int hb_parl( int iParam, ... ) /* retrieve a logical parameter as an int */ double hb_parnd( int iParam, ... ) /* retrieve a numeric parameter as a double */ { - FARPROC pParNd=GetProcAddress( GetModuleHandle( NULL ), "_hb_parnd" ); + FARPROC pParNd = GetProcAddress( GetModuleHandle( NULL ), "_hb_parnd" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParNd ) @@ -502,7 +502,7 @@ double hb_parnd( int iParam, ... ) /* retrieve a numeric parameter as a double * int hb_parni( int iParam, ... ) /* retrieve a numeric parameter as a integer */ { /* int iReturn; */ - FARPROC pParNi=GetProcAddress( GetModuleHandle( NULL ), "_hb_parni" ); + FARPROC pParNi = GetProcAddress( GetModuleHandle( NULL ), "_hb_parni" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParNi ) @@ -528,7 +528,7 @@ int hb_parni( int iParam, ... ) /* retrieve a numeric parameter as a integer */ long hb_parnl( int iParam, ... ) /* retrieve a numeric parameter as a long */ { - FARPROC pParNl=GetProcAddress( GetModuleHandle( NULL ), "_hb_parnl" ); + FARPROC pParNl = GetProcAddress( GetModuleHandle( NULL ), "_hb_parnl" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); if( pExtIsArray && pParNl ) @@ -763,8 +763,8 @@ int hb_stornd( double dNumber, int iParam, ... ) BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */ { - HB_ARRAYNEW pArrayNew =(HB_ARRAYNEW) GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayNew" ); - if (pArrayNew) + HB_ARRAYNEW pArrayNew = (HB_ARRAYNEW) GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayNew" ); + if( pArrayNew ) return pArrayNew( pItem, ulLen ); else return FALSE; @@ -773,7 +773,7 @@ BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */ ULONG hb_arrayLen( PHB_ITEM pArray ) /* retrives the array len */ { HB_ARRAYLEN pArrayLen = (HB_ARRAYLEN)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayLen" ); - if (pArrayLen) + if( pArrayLen ) return pArrayLen( pArray ); else return 0; @@ -782,7 +782,7 @@ ULONG hb_arrayLen( PHB_ITEM pArray ) /* retrives the array len */ BOOL hb_arrayIsObject( PHB_ITEM pArray ) /* retrives if the array is an object */ { HB_ARRAYISOBJECT pArrayIsObject = (HB_ARRAYISOBJECT)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayIsObject" ); - if (pArrayIsObject) + if( pArrayIsObject ) return pArrayIsObject( pArray ); else return FALSE; @@ -791,7 +791,7 @@ BOOL hb_arrayIsObject( PHB_ITEM pArray ) /* retrives if the array is an obj BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pItemValue ) /* add a new item to the end of an array item */ { HB_ARRAYADD pArrayAdd = (HB_ARRAYADD)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayAdd" ); - if (pArrayAdd) + if( pArrayAdd ) return pArrayAdd( pArray, pItemValue ); else return FALSE; @@ -800,7 +800,7 @@ BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pItemValue ) /* add a new item BOOL hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex ) /* insert a nil item into an array, without changing the length */ { HB_ARRAYINS pArrayIns = (HB_ARRAYINS)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayIns" ); - if (pArrayIns) + if( pArrayIns ) return pArrayIns( pArray, ulIndex ); else return FALSE; @@ -809,7 +809,7 @@ BOOL hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex ) /* insert a nil item int BOOL hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ) /* delete an array item, without changing length */ { HB_ARRAYDEL pArrayDel = (HB_ARRAYDEL)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayDel" ); - if (pArrayDel) + if( pArrayDel ) return pArrayDel( pArray, ulIndex ); else return FALSE; @@ -818,7 +818,7 @@ BOOL hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ) /* delete an array item, BOOL hb_arraySize( PHB_ITEM pArray, ULONG ulLen ) /* sets the array total length */ { HB_ARRAYSIZE pArraySize = (HB_ARRAYSIZE)GetProcAddress( GetModuleHandle( NULL ), "_hb_arraySize" ); - if (pArraySize) + if( pArraySize ) return pArraySize( pArray, ulLen ); else return FALSE; @@ -827,7 +827,7 @@ BOOL hb_arraySize( PHB_ITEM pArray, ULONG ulLen ) /* sets the array total l BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult ) /* retrieve last item in an array */ { HB_ARRAYLAST pArrayLast= (HB_ARRAYLAST)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayLast" ); - if (pArrayLast) + if( pArrayLast ) return pArrayLast( pArray, pResult ); else return FALSE; @@ -836,7 +836,7 @@ BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult ) /* retrieve last ite BOOL hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) /* sets an array element */ { HB_ARRAYSET pArraySet = (HB_ARRAYSET)GetProcAddress( GetModuleHandle( NULL ), "_hb_arraySet" ); - if (pArraySet) + if( pArraySet ) return pArraySet( pArray, ulIndex, pItem); else return FALSE; @@ -845,7 +845,7 @@ BOOL hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) /* sets BOOL hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) /* retrieves an item */ { HB_ARRAYGET pArrayGet = (HB_ARRAYGET)GetProcAddress( GetModuleHandle( NULL ), "_hb_arrayGet" ); - if (pArrayGet) + if( pArrayGet ) return pArrayGet( pArray, ulIndex, pItem); else return FALSE; @@ -853,58 +853,58 @@ BOOL hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) /* retri void hb_xinit( void ) /* Initialize fixed memory subsystem */ { - HB_XINIT pXinit = (HB_XINIT)GetProcAddress( GetModuleHandle( NULL ), "_hb_xinit" ); - if (pXinit) + HB_XINIT pXinit = (HB_XINIT)GetProcAddress( GetModuleHandle( NULL ), "_hb_xinit" ); + if( pXinit ) pXinit(); } void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ { - HB_XEXIT pXexit = (HB_XEXIT)GetProcAddress( GetModuleHandle( NULL ), "_hb_xexit" ); - if (pXexit) + HB_XEXIT pXexit = (HB_XEXIT)GetProcAddress( GetModuleHandle( NULL ), "_hb_xexit" ); + if( pXexit ) pXexit(); } void * hb_xalloc( ULONG ulSize ) /* allocates memory, returns NULL on failure */ { void * pRet = NULL; - HB_XALLOC pXalloc = (HB_XALLOC)GetProcAddress( GetModuleHandle( NULL ), "_hb_xalloc" ); - if (pXalloc) - pRet=pXalloc(ulSize); + HB_XALLOC pXalloc = (HB_XALLOC)GetProcAddress( GetModuleHandle( NULL ), "_hb_xalloc" ); + if( pXalloc ) + pRet=pXalloc( ulSize ); return pRet; } void * hb_xgrab( ULONG ulSize ) /* allocates memory, exits on failure */ { void * pRet = NULL; - HB_XGRAB pXgrab = (HB_XGRAB)GetProcAddress( GetModuleHandle( NULL ), "_hb_xgrab" ); - if (pXgrab) - pRet=pXgrab(ulSize); + HB_XGRAB pXgrab = (HB_XGRAB)GetProcAddress( GetModuleHandle( NULL ), "_hb_xgrab" ); + if( pXgrab ) + pRet = pXgrab( ulSize ); return pRet; } void hb_xfree( void * pMem ) /* frees memory */ { - HB_XFREE pXfree = (HB_XFREE)GetProcAddress( GetModuleHandle( NULL ), "_hb_xfree" ); - if (pXfree) - pXfree(pMem); + HB_XFREE pXfree = (HB_XFREE)GetProcAddress( GetModuleHandle( NULL ), "_hb_xfree" ); + if( pXfree ) + pXfree( pMem ); } void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */ { void * pRet = NULL; - HB_XREALLOC pXrealloc = (HB_XREALLOC)GetProcAddress( GetModuleHandle( NULL ), "_hb_xrealloc" ); - if (pXrealloc) - pRet= (void*)pXrealloc( pMem, ulSize ); + HB_XREALLOC pXrealloc = (HB_XREALLOC)GetProcAddress( GetModuleHandle( NULL ), "_hb_xrealloc" ); + if( pXrealloc ) + pRet = (void*) pXrealloc( pMem, ulSize ); return pRet; } ULONG hb_xsize( void * pMem ) /* returns the size of an allocated memory block */ { - HB_XSIZE pXsize = (HB_XSIZE)GetProcAddress( GetModuleHandle( NULL ), "_hb_xsize" ); - ULONG ulReturn=0; - if (pXsize) - ulReturn= pXsize((void *)pMem); + HB_XSIZE pXsize = (HB_XSIZE)GetProcAddress( GetModuleHandle( NULL ), "_hb_xsize" ); + ULONG ulReturn = 0; + if( pXsize ) + ulReturn = pXsize( (void *)pMem ); return ulReturn; } diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index 5e57104a77..bc67e39f0a 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -144,7 +144,7 @@ static char * hb_hrbReadId( char * szBody, ULONG ulBodySize, ULONG * ulBodyOffse do { - if ( *ulBodyOffset > ulBodySize ) + if( *ulBodyOffset > ulBodySize ) return NULL; } while( szBody[ ( *ulBodyOffset )++ ] ); @@ -238,7 +238,7 @@ static void hb_hrbInit( PHRB_BODY pHrbBody, int argc, char * argv[] ) static void hb_hrbExit( PHRB_BODY pHrbBody ) { - if ( pHrbBody->fExit ) + if( pHrbBody->fExit ) { ULONG ul; @@ -540,7 +540,7 @@ static void hb_hrbDo( PHRB_BODY pHrbBody, int argc, char * argv[] ) hb_hrbInit( pHrbBody, argc, argv ); /* May not have a startup symbol, if first symbol was an INIT Symbol (was executed already).*/ - if ( pHrbBody->lSymStart >= 0 ) + if( pHrbBody->lSymStart >= 0 ) { hb_vmPushSymbol( &pHrbBody->pSymRead[ pHrbBody->lSymStart ] ); hb_vmPushNil();