diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3df97968e0..f70b30a6a3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,4 +1,4 @@ -/* +/* * $Id$ */ diff --git a/harbour/config/w32/pocc.cf b/harbour/config/w32/pocc.cf index ebaa013883..306dc74acd 100644 --- a/harbour/config/w32/pocc.cf +++ b/harbour/config/w32/pocc.cf @@ -16,7 +16,7 @@ CC_IN = -c CC_OUT = -Fo CPPFLAGS = -I. -CPPFLAGS += -Ze -Go +CPPFLAGS += -Ze -Go -MT # optimizations CPPFLAGS += -Ot -Ox diff --git a/harbour/config/w32/poccce.cf b/harbour/config/w32/poccce.cf index a3c6ae9703..b86862776c 100644 --- a/harbour/config/w32/poccce.cf +++ b/harbour/config/w32/poccce.cf @@ -23,7 +23,7 @@ CPPFLAGS += -Ze -Go CPPFLAGS += -Ot -Ox # For Pocket PC and ARM processors (including XScale) -CPPFLAGS += -Tarm-coff -DSTRSAFE_NO_DEPRECATE +CPPFLAGS += -Tarm-coff ifneq ($(HB_INC_COMPILE),) CPPFLAGS += -I$(HB_INC_COMPILE) diff --git a/harbour/contrib/Makefile b/harbour/contrib/Makefile index da5d49e108..4ca503e1c0 100644 --- a/harbour/contrib/Makefile +++ b/harbour/contrib/Makefile @@ -13,7 +13,6 @@ DIRS=\ hbbtree \ hbclipsm \ hbct \ - hbdbgfx \ hbgf \ hbgt \ hbmisc \ diff --git a/harbour/contrib/hbwin/win_dll.c b/harbour/contrib/hbwin/win_dll.c index fbf042cf80..e184971913 100644 --- a/harbour/contrib/hbwin/win_dll.c +++ b/harbour/contrib/hbwin/win_dll.c @@ -258,7 +258,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, #if defined( __MINGW32__ ) #elif defined( __BORLANDC__ ) || defined(__DMC__) #else - DWORD *pESP; + DWORD * pESP; #endif /* Reserve 256 bytes of stack space for our arguments */ @@ -267,7 +267,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, "\tsubl $0x100, %%esp\n" : "=r" (pStack) ); #elif defined( __BORLANDC__ ) || defined(__DMC__) - pStack = (DWORD *)_ESP; + pStack = ( DWORD * ) _ESP; _ESP -= 0x100; #else _asm mov pStack, esp @@ -279,10 +279,10 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, 4-byte boundary. We start at the rightmost argument. */ for( i = 0; i < nArgs; i++ ) { - nInd = (nArgs - 1) - i; + nInd = ( nArgs - 1 ) - i; /* Start at the back of the arg ptr, aligned on a DWORD */ - nSize = (Parm[nInd].nWidth + 3) / 4 * 4; - pArg = (BYTE *) Parm[nInd].pArg + nSize - 4; + nSize = ( Parm[ nInd ].nWidth + 3 ) / 4 * 4; + pArg = ( BYTE * ) Parm[ nInd ].pArg + nSize - 4; dwStSize += ( DWORD ) nSize; /* Count no of bytes on stack */ nLoops = ( nSize / 4 ) - 1; @@ -290,7 +290,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, while( nSize > 0 ) { /* Copy argument to the stack */ - if( Parm[nInd].dwFlags & DC_FLAG_ARGPTR ) + if( Parm[ nInd ].dwFlags & DC_FLAG_ARGPTR ) { /* Arg has a ptr to a variable that has the arg */ dwVal = ( DWORD ) pArg; /* Get first four bytes */ @@ -299,7 +299,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, else { /* Arg has the real arg */ - dwVal = *( (DWORD *)( (BYTE *) ( &( Parm[nInd].numargs.dwArg ) ) + ( nLoops * 4 ) ) ); + dwVal = *( ( DWORD * )( ( BYTE * ) ( &( Parm[ nInd ].numargs.dwArg ) ) + ( nLoops * 4 ) ) ); } /* Do push dwVal */ @@ -344,18 +344,18 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, else if( pRet == NULL ) { Res.Int = dwEAX; - (&Res.Int)[1] = dwEDX; + ( &Res.Int )[ 1 ] = dwEDX; } else if( ( ( iFlags & DC_BORLAND ) == 0 ) && ( nRetSiz <= 8 ) ) { /* Microsoft optimized less than 8-bytes structure passing */ - ((int *)pRet)[0] = dwEAX; - ((int *)pRet)[1] = dwEDX; + ( ( int * ) pRet )[ 0 ] = dwEAX; + ( ( int * ) pRet )[ 1 ] = dwEDX; } #elif defined( __BORLANDC__ ) || defined(__DMC__) - _ESP += (0x100 - dwStSize); + _ESP += ( 0x100 - dwStSize ); _EDX = ( DWORD ) &lpFunction; - __emit__(0xff,0x12); /* call [edx]; */ + __emit__( 0xFF, 0x12 ); /* call [edx]; */ dwEAX = _EAX; dwEDX = _EDX; @@ -370,14 +370,14 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, _EBX = ( DWORD ) &Res; _EAX = dwEAX; _EDX = dwEDX; - __emit__(0xd9,0x1b); /* _asm fnstp float ptr [ebx] */ + __emit__( 0xD9, 0x1B ); /* _asm fnstp float ptr [ebx] */ } else if( iFlags & DC_RETVAL_MATH8 ) { _EBX = ( DWORD ) &Res; _EAX = dwEAX; _EDX = dwEDX; - __emit__(0xdd,0x1b); /* _asm fnstp qword ptr [ebx] */ + __emit__( 0xDD, 0x1B ); /* _asm fnstp qword ptr [ebx] */ } else if( pRet == NULL ) { @@ -386,7 +386,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, _EDX = dwEDX; /* _asm mov DWORD PTR [ebx], eax */ /* _asm mov DWORD PTR [ebx + 4], edx */ - __emit__(0x89,0x03,0x89,0x53,0x04); + __emit__( 0x89, 0x03, 0x89, 0x53, 0x04 ); } else if( ( ( iFlags & DC_BORLAND ) == 0 ) && ( nRetSiz <= 8 ) ) { @@ -395,7 +395,7 @@ RESULT DynaCall( int iFlags, LPVOID lpFunction, int nArgs, _EDX = dwEDX; /* _asm mov DWORD PTR [ebx], eax */ /* _asm mov DWORD PTR [ebx + 4], edx */ - __emit__(0x89,0x03,0x89,0x53,0x04); + __emit__( 0x89, 0x03, 0x89, 0x53, 0x04 ); } #else _asm add esp, 0x100 /* Restore to original position */ diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index 9a51b17df2..0e7ec0bed9 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -174,11 +174,11 @@ BOOL hb_GetDefaultPrinter( char * pPrinterName, LPDWORD pdwBufferSize ) if( dwSize && dwSize < *pdwBufferSize ) { dwSize = 0; - while( pPrinterName[dwSize] != '\0' && pPrinterName[dwSize] != ',' ) + while( pPrinterName[ dwSize ] != '\0' && pPrinterName[ dwSize ] != ',' ) { dwSize++; } - pPrinterName[dwSize] = '\0'; + pPrinterName[ dwSize ] = '\0'; *pdwBufferSize = dwSize + 1; Result = TRUE; } @@ -323,7 +323,7 @@ HB_FUNC( PRINTERPORTTONAME ) LONG hb_PrintFileRaw( UCHAR * cPrinterName, UCHAR * cFileName, UCHAR * cDocName ) { - UCHAR printBuffer[BIG_PRINT_BUFFER]; + UCHAR printBuffer[ BIG_PRINT_BUFFER ]; HANDLE hPrinter, hFile; DOC_INFO_1 DocInfo; DWORD nRead, nWritten; @@ -348,7 +348,7 @@ LONG hb_PrintFileRaw( UCHAR * cPrinterName, UCHAR * cFileName, UCHAR * cDocName while( ReadFile( hFile, printBuffer, BIG_PRINT_BUFFER, &nRead, NULL ) && ( nRead > 0 ) ) { - if( printBuffer[nRead - 1] == 26 ) + if( printBuffer[ nRead - 1 ] == 26 ) { nRead--; /* Skip the EOF() character */ } diff --git a/harbour/contrib/make_gcc_all.sh b/harbour/contrib/make_gcc_all.sh index 36bbd4ddc5..736624d074 100755 --- a/harbour/contrib/make_gcc_all.sh +++ b/harbour/contrib/make_gcc_all.sh @@ -41,7 +41,7 @@ fi if [ "$HB_CONTRIBLIBS" != "" ]; then _HB_DIRS="${HB_CONTRIBLIBS}" else - _HB_DIRS="hbbmcdx hbbtree hbclipsm hbct hbdbgfx hbgt hbmisc hbmsql hbmzip hbnf hbtip hbsqlit3 hbtpathy hbvpdf hbziparc xhb" + _HB_DIRS="hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmsql hbmzip hbnf hbtip hbsqlit3 hbtpathy hbvpdf hbziparc xhb" case "$HB_ARCHITECTURE" in w32|cyg|os2) diff --git a/harbour/source/compiler/gencc.c b/harbour/source/compiler/gencc.c index d4e1657664..a9992914a5 100644 --- a/harbour/source/compiler/gencc.c +++ b/harbour/source/compiler/gencc.c @@ -58,17 +58,20 @@ void hb_compGenCString( FILE * yyc, BYTE * pText, ULONG ulLen ) * NOTE: After optimization some CHR(n) can be converted * into a string containing nonprintable characters. * - * TODO: add switch to use hexadecimal format "%#04x" - * * ? is escaped to avoid conflicts with trigraph sequences which * are part of ANSI C standard */ if( uchr == '"' || uchr == '\\' || uchr == '?' ) fprintf( yyc, "\\%c", uchr ); else if( uchr < ( BYTE ) ' ' || uchr >= 127 ) - fprintf( yyc, "\\%03o%s", uchr, ulPos < ulLen - 1 && - pText[ ulPos + 1 ] >= ( BYTE ) '0' && - pText[ ulPos + 1 ] <= ( BYTE ) '9' ? "\" \"" : "" ); + { + BYTE uchrnext = pText[ ulPos + 1 ]; + + fprintf( yyc, "\\x%02X%s", uchr, ulPos < ulLen - 1 && + ( uchrnext >= ( BYTE ) '0' && uchrnext <= ( BYTE ) '9' ) || + ( uchrnext >= ( BYTE ) 'a' && uchrnext <= ( BYTE ) 'z' ) || + ( uchrnext >= ( BYTE ) 'A' && uchrnext <= ( BYTE ) 'Z' ) ? "\" \"" : "" ); + } else fprintf( yyc, "%c", uchr ); } diff --git a/harbour/source/main/harbour.c b/harbour/source/main/harbour.c index dd5d65457f..effd227a25 100644 --- a/harbour/source/main/harbour.c +++ b/harbour/source/main/harbour.c @@ -622,6 +622,6 @@ int main( int argc, char * argv[] ) return iResult; } -#if defined( HB_WINCE ) && !defined( __CEGCC__ ) +#if defined( HB_WINCE ) && !defined( __CEGCC__ ) && !defined( __POCC__ ) # include "hbwmain.c" #endif diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index a56718b24c..bb769dbfa6 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -738,6 +738,6 @@ int main( int argc, char * argv[] ) return iResult; } -#if defined( HB_WINCE ) && !defined( __CEGCC__ ) +#if defined( HB_WINCE ) && !defined( __CEGCC__ ) && !defined( __POCC__ ) # include "hbwmain.c" #endif diff --git a/harbour/source/rdd/hbsix/sxcompat.prg b/harbour/source/rdd/hbsix/sxcompat.prg index d930a0853f..430705fdb6 100644 --- a/harbour/source/rdd/hbsix/sxcompat.prg +++ b/harbour/source/rdd/hbsix/sxcompat.prg @@ -322,7 +322,7 @@ FUNCTION Sx_KillTag( xTag, xIndex ) ENDIF IF !Empty( cIndex ) IF ordBagClear( cIndex ) - lRet := ferase( cIndex ) != -1 + lRet := FErase( cIndex ) != -1 ENDIF ENDIF ENDIF @@ -389,11 +389,11 @@ FUNCTION RDD_Info( xID ) IF ISNUMBER( xID ) IF !Empty( Alias( xID ) ) - ( xID )->( RDDName() ) + ( xID )->( rddName() ) ENDIF ELSEIF ISCHARACTER( xID ) cRDD := Upper( AllTrim( xID ) ) - IF ascan( RDDList(), {|x| Upper( x ) == cRDD } ) == 0 + IF AScan( rddList(), {|x| Upper( x ) == cRDD } ) == 0 cRDD := NIL ENDIF ELSEIF xID == NIL @@ -442,11 +442,11 @@ FUNCTION Sx_BLOB2File( cFileName, cFldName ) FUNCTION Sx_File2BLOB( cFileName, cFldName, nActionCode ) LOCAL nAction := 0 - IF HB_BITAND( nActionCode, BLOB_FILECOMPRESS ) != 0 - nAction := HB_BITOR( nAction, FILEPUT_COMPRESS ) + IF hb_bitAnd( nActionCode, BLOB_FILECOMPRESS ) != 0 + nAction := hb_bitOr( nAction, FILEPUT_COMPRESS ) ENDIF - IF HB_BITAND( nActionCode, BLOB_FILEENCRYPT ) != 0 - nAction := HB_BITOR( nAction, FILEPUT_ENCRYPT ) + IF hb_bitAnd( nActionCode, BLOB_FILEENCRYPT ) != 0 + nAction := hb_bitOr( nAction, FILEPUT_ENCRYPT ) ENDIF RETURN dbFileGet( cFldName, cFileName, nAction ) diff --git a/harbour/source/rtl/hbhex.c b/harbour/source/rtl/hbhex.c index f2db57e1a5..8ff55e8882 100644 --- a/harbour/source/rtl/hbhex.c +++ b/harbour/source/rtl/hbhex.c @@ -108,7 +108,7 @@ HB_FUNC( HB_NUMTOHEX ) if( ISNUM( 1 ) ) ulNum = hb_parnint( 1 ); else if( ISPOINTER( 1 ) ) - ulNum = (HB_PTRDIFF) hb_parptr( 1 ); + ulNum = ( HB_PTRDIFF ) hb_parptr( 1 ); else { hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );