diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 82afd9ad2b..d1fb84e854 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,42 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-24 11:44 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/estack.c + ! Replaced printf() calls with hb_snprintf() and hb_conOutErr() + calls. This will avoid reported problems where MinGW binary + build refers to internal printf function. As a rule we should + never use printf() in Harbour code. There are still a few + commented ones in hbrtl. + [TOMERGE 2.0] + + * src/vm/hvm.c + ! Replaced printf() (commented) call with HB_TRACE(). + [TOMERGE 2.0] + + * utils/hbmk2/hbmk2.prg + ! Fixed -build option not being recognized. + ! Fixed -build option not being ignored in second option + parsing loop. + ! Fixed -lang= option not being ignored in second option + parsing loop. + [TOMERGE 2.0] + + * utils/hbmk2/hbmk2.pt_BR.po + * utils/hbmk2/hbmk2.hu_HU.po + * utils/hbmk2/hbmk2.prg + + Extended help text for -head option. + + * contrib/hbwin/win_prn1.c + % WIN_LOADBITMAPFILE() optimized to use hb_retclen_buffer(). + ! WIN_LOADBITMAPFILE() fixed to return empty string instead + of NIL in case of file read failure. + + * examples/rddado/adordd.ch + + Added new 'adCmd*' constants. From xhb. + (2010-01-20 20:53 UTC+0100 Miguel Angel Marchuet) + * Formatting. + 2010-01-23 13:32 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/idefindreplace.prg ! Fixed: error when find operation was unsuccessful. @@ -25,16 +61,16 @@ + Added HBXBP_DBG( HB_TR_ALWAYS,... ) * contrib/hbxbp/xbppushbutton.prg - + Behavior: if focus is set on the object, then its property is + + Behavior: if focus is set on the object, then its property is changed to autodefault() which means the button will be highlighted with additional border to indicate that it can be activated with "Return" press. However this property does not work in - buttons if XbpDialog() is the parent. + buttons if XbpDialog() is the parent. * contrib/hbxbp/xbpgeneric.prg * contrib/hbxbp/xbpwindow.prg * contrib/hbxbp/xbpdialog.prg - + Implemented: XbpDialog():maxButton, :minButton + + Implemented: XbpDialog():maxButton, :minButton QUESTION: which instance variable controls the resizing behavior? * contrib/hbxbp/xbpsle.prg @@ -42,10 +78,10 @@ oSle1:returnPressed := {|| SetAppFocus( oSle2 ) } This facilitates the TAB behavior which navigating the SLE's. This effectively also means you can control the SLE's like - ReadModal(). Just validate the SLE (oGet) and move to - another SLE or any other part. + ReadModal(). Just validate the SLE (oGet) and move to + another SLE or any other part. - Angel, your observation will matter. + Angel, your observation will matter. 2010-01-23 14:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/hbwapi.h diff --git a/harbour/contrib/hbwin/win_prn1.c b/harbour/contrib/hbwin/win_prn1.c index 0246223618..b68d0c5163 100644 --- a/harbour/contrib/hbwin/win_prn1.c +++ b/harbour/contrib/hbwin/win_prn1.c @@ -514,6 +514,9 @@ HB_FUNC( WIN_LOADBITMAPFILE ) { HB_FHANDLE fhnd = hb_fsOpen( hb_parcx( 1 ), FO_READ | FO_SHARED ); + /* Set default return value */ + hb_retc_null(); + if( fhnd != FS_ERROR ) { ULONG ulSize = hb_fsSeek( fhnd, 0, FS_END ); @@ -528,17 +531,13 @@ HB_FUNC( WIN_LOADBITMAPFILE ) hb_fsSeek( fhnd, 0, FS_SET ); if( hb_fsReadLarge( fhnd, pbmfh, ulSize ) == ulSize && pbmfh->bfType == *( WORD * ) "BM" ) - hb_retclen( ( char * ) pbmfh, ( HB_SIZE ) ulSize ); - - hb_xfree( pbmfh ); + hb_retclen_buffer( ( char * ) pbmfh, ( HB_SIZE ) ulSize ); + else + hb_xfree( pbmfh ); } - else - hb_retc_null(); hb_fsClose( fhnd ); } - else - hb_retc_null(); } HB_FUNC( WIN_DRAWBITMAP ) diff --git a/harbour/examples/rddado/adordd.ch b/harbour/examples/rddado/adordd.ch index a42bf7c194..86694fa8c2 100644 --- a/harbour/examples/rddado/adordd.ch +++ b/harbour/examples/rddado/adordd.ch @@ -54,19 +54,19 @@ #ifndef _ADORDD_CH #define _ADORDD_CH -// Cursor Type +/* Cursor Type */ #define adOpenForwardOnly 0 #define adOpenKeyset 1 #define adOpenDynamic 2 #define adOpenStatic 3 -// Lock Types +/* Lock Types */ #define adLockReadOnly 1 #define adLockPessimistic 2 #define adLockOptimistic 3 #define adLockBatchOptimistic 4 -// Field Types +/* Field Types */ #define adEmpty 0 #define adTinyInt 16 #define adSmallInt 2 @@ -106,7 +106,7 @@ #define adFileTime 64 #define adPropVariant 138 #define adVarNumeric 139 -#define adArray // &H2000 +#define adArray /* &H2000 */ #define adRecDeleted 4 @@ -117,14 +117,14 @@ #define adKeyForeign 2 -// Constant Group: ObjectStateEnum +/* Constant Group: ObjectStateEnum */ #define adStateClosed 0 #define adStateOpen 1 #define adStateConnecting 2 #define adStateExecuting 4 #define adStateFetching 8 -// Constant Group: SchemaEnum +/* Constant Group: SchemaEnum */ #define adSchemaProviderSpecific ( -1 ) #define adSchemaAsserts 0 #define adSchemaCatalogs 1 @@ -172,21 +172,30 @@ #define adSchemaCommands 42 #define adSchemaSets 43 -// Constant Group: Supports -#define adAddNew 0x1000400 // Supports the AddNew method to add new records. -#define adApproxPosition 0x0004000 // Supports the AbsolutePosition and AbsolutePage properties. -#define adBookmark 0x0002000 // Supports the Bookmark property to gain access to specific records. -#define adDelete 0x1000800 // Supports the Delete method to delete records. -#define adFind 0x0080000 // Supports the Find method to locate a row in a Recordset. -#define adHoldRecords 0x0000100 // Retrieves more records or changes the next position without committing all pending changes. -#define adIndex 0x0100000 // Supports the Index property to name an index. -#define adMovePrevious 0x0000200 // Supports the MoveFirst and MovePrevious methods, and Move or GetRows methods to move the current record position backward without requiring bookmarks. -#define adNotify 0x0040000 // Indicates that the underlying data provider supports notifications (which determines whether Recordset events are supported). -#define adResync 0x0020000 // Supports the Resync method to update the cursor with the data that is visible in the underlying database. -#define adSeek 0x0200000 // Supports the Seek method to locate a row in a Recordset. -#define adUpdate 0x1008000 // Supports the Update method to modify existing data. +/* Constant Group: Supports */ +#define adAddNew 0x1000400 /* Supports the AddNew method to add new records. */ +#define adApproxPosition 0x0004000 /* Supports the AbsolutePosition and AbsolutePage properties. */ +#define adBookmark 0x0002000 /* Supports the Bookmark property to gain access to specific records. */ +#define adDelete 0x1000800 /* Supports the Delete method to delete records. */ +#define adFind 0x0080000 /* Supports the Find method to locate a row in a Recordset. */ +#define adHoldRecords 0x0000100 /* Retrieves more records or changes the next position without committing all pending changes. */ +#define adIndex 0x0100000 /* Supports the Index property to name an index. */ +#define adMovePrevious 0x0000200 /* Supports the MoveFirst and MovePrevious methods, and Move or GetRows methods to move the current record position backward without requiring bookmarks. */ +#define adNotify 0x0040000 /* Indicates that the underlying data provider supports notifications (which determines whether Recordset events are supported). */ +#define adResync 0x0020000 /* Supports the Resync method to update the cursor with the data that is visible in the underlying database. */ +#define adSeek 0x0200000 /* Supports the Seek method to locate a row in a Recordset. */ +#define adUpdate 0x1008000 /* Supports the Update method to modify existing data. */ #define adUpdateBatch 0x0010000 +/* Command type */ +#define adCmdUnspecified ( -1 ) +#define adCmdUnknown 8 +#define adCmdText 1 +#define adCmdTable 2 +#define adCmdStoredProc 4 +#define adCmdFile 256 +#define adCmdTableDirect 512 + #command USE <(db)> [VIA ] [ALIAS ] [] ; [] [] [] ; [CODEPAGE ] [INDEX <(index1)> [, <(indexN)>]] ; diff --git a/harbour/src/vm/estack.c b/harbour/src/vm/estack.c index 8d2b42052a..e07f4a2358 100644 --- a/harbour/src/vm/estack.c +++ b/harbour/src/vm/estack.c @@ -1105,90 +1105,94 @@ void hb_stackBaseProcInfo( char * szProcName, USHORT * puiProcLine ) /* NOTE: DEBUG function */ void hb_stackDispLocal( void ) { + char buffer[ 1024 ]; HB_STACK_TLS_PRELOAD PHB_ITEM * pBase; HB_TRACE(HB_TR_DEBUG, ("hb_stackDispLocal()")); - printf( "%s", hb_conNewLine() ); - printf( HB_I_("Virtual Machine Stack Dump at %s(%i):"), + hb_conOutErr( hb_conNewLine(), 0 ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("Virtual Machine Stack Dump at %s(%i):"), ( *hb_stack.pBase )->item.asSymbol.value->szName, ( *hb_stack.pBase )->item.asSymbol.stackstate->uiLineNo ); - printf( "%s", hb_conNewLine() ); - printf( "--------------------------" ); + hb_conOutErr( buffer, 0 ); + hb_conOutErr( hb_conNewLine(), 0 ); + hb_conOutErr( "--------------------------", 0 ); for( pBase = hb_stack.pBase; pBase <= hb_stack.pPos; pBase++ ) { - printf( "%s", hb_conNewLine() ); + hb_conOutErr( hb_conNewLine(), 0 ); switch( hb_itemType( *pBase ) ) { case HB_IT_NIL: - printf( HB_I_("NIL ") ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("NIL ") ); break; case HB_IT_ARRAY: if( hb_arrayIsObject( *pBase ) ) - printf( HB_I_("OBJECT = %s "), hb_objGetClsName( *pBase ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("OBJECT = %s "), hb_objGetClsName( *pBase ) ); else - printf( HB_I_("ARRAY ") ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("ARRAY ") ); break; case HB_IT_BLOCK: - printf( HB_I_("BLOCK ") ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("BLOCK ") ); break; case HB_IT_DATE: { char szDate[ 9 ]; - printf( HB_I_("DATE = \"%s\" "), hb_itemGetDS( *pBase, szDate ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("DATE = \"%s\" "), hb_itemGetDS( *pBase, szDate ) ); } break; case HB_IT_TIMESTAMP: { char szDateTime[ 24 ]; - printf( HB_I_("TIMESTAMP = \"%s\" "), + hb_snprintf( buffer, sizeof( buffer ), HB_I_("TIMESTAMP = \"%s\" "), hb_timeStampStr( szDateTime, ( *pBase )->item.asDateTime.julian, ( *pBase )->item.asDateTime.time ) ); } break; case HB_IT_DOUBLE: - printf( HB_I_("DOUBLE = %f "), hb_itemGetND( *pBase ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("DOUBLE = %f "), hb_itemGetND( *pBase ) ); break; case HB_IT_LOGICAL: - printf( HB_I_("LOGICAL = %s "), hb_itemGetL( *pBase ) ? ".T." : ".F." ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("LOGICAL = %s "), hb_itemGetL( *pBase ) ? ".T." : ".F." ); break; case HB_IT_LONG: { char szBuf[ 24 ]; - printf( HB_I_("LONG = %s ") , hb_numToStr( szBuf, sizeof( szBuf ), hb_itemGetNInt( *pBase ) ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("LONG = %s ") , hb_numToStr( szBuf, sizeof( szBuf ), hb_itemGetNInt( *pBase ) ) ); break; } case HB_IT_INTEGER: - printf( HB_I_("INTEGER = %i "), hb_itemGetNI( *pBase ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("INTEGER = %i "), hb_itemGetNI( *pBase ) ); break; case HB_IT_STRING: - printf( HB_I_("STRING = \"%s\" "), hb_itemGetCPtr( *pBase ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("STRING = \"%s\" "), hb_itemGetCPtr( *pBase ) ); break; case HB_IT_SYMBOL: - printf( HB_I_("SYMBOL = %s "), ( *pBase )->item.asSymbol.value->szName ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("SYMBOL = %s "), ( *pBase )->item.asSymbol.value->szName ); break; case HB_IT_POINTER: - printf( HB_I_("POINTER = %p "), ( *pBase )->item.asPointer.value ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("POINTER = %p "), ( *pBase )->item.asPointer.value ); break; default: - printf( HB_I_("UNKNOWN = TYPE %i "), hb_itemType( *pBase ) ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("UNKNOWN = TYPE %i "), hb_itemType( *pBase ) ); break; } + + hb_conOutErr( buffer, 0 ); } } diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index bb8d498bd6..f639daba52 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -7755,7 +7755,7 @@ PHB_SYMBOLS hb_vmRegisterSymbols( PHB_SYMB pModuleSymbols, USHORT uiSymbols, #if 0 if( fPublic && ( hSymScope & ( HB_FS_INITEXIT | HB_FS_STATIC ) ) != 0 ) { - printf("Registring: %s:%s scope %04x\r\n", szModuleName, pSymbol->szName, hSymScope ); fflush(stdout); + HB_TRACE(HB_TR_DEBUG, ("Registering: %s:%s scope %04x", szModuleName, pSymbol->szName, hSymScope)); } #endif diff --git a/harbour/utils/hbmk2/hbmk2.hu_HU.po b/harbour/utils/hbmk2/hbmk2.hu_HU.po index 750083004d..9a7446cb0e 100644 --- a/harbour/utils/hbmk2/hbmk2.hu_HU.po +++ b/harbour/utils/hbmk2/hbmk2.hu_HU.po @@ -384,7 +384,7 @@ msgstr "K #: hbmk2.prg:7941 #, c-format -msgid "control source header parsing (in incremental build mode)\\n can be: native, full, partial (default), off" +msgid "control source header parsing (in incremental build mode)\n can be: native (uses compiler to extract dependencies), full (uses simple text parser on the whole file), partial (default, uses simple text parser on 1st 16KB chunk of the file), off" msgstr "finomhangolja a forrásállományok automatikus fejléc detektálást (lépcsőzetes üzemmódban)\\n lehet: native, full, partial (default), off" #: hbmk2.prg:7850 diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 49761194db..d156f58dcd 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -106,17 +106,17 @@ 1. Gather supported compilers by Harbour installation (look for lib//*[/] subdirs) Show error if nothing is found - 2. Look if any supported compilers are found embedded or in PATH - for target . + 2. Look if any supported compilers are found embedded, in PATH + or on HB_CCPATH for target . Show error if nothing is found 3. If HB_COMPILER is set to one of them, select it. (TODO: handle multiple installations of the same compiler. F.e. embedded mingw and one in PATH, or two versions of MSVC) 4. If HB_COMPILER is set, but not to one of them, show warning and use the highest one on the priority list. - 5. If HB_COMPILER is not set, or the one set isn't available, + 5. If HB_COMPILER is not set, use the highest one on the priority list. - NOTES: - compilers in PATH have higher priority than embedded. + NOTES: - Priority list: HB_CCPATH, PATH, embedded. - Priority list: mingw, msvc, bcc, watcom, pocc, xcc - Compilers of native CPU target have higher priority. (extra) On x64 Windows: msvc64, msvc, msvcia64, mingw64, mingw, ... @@ -827,7 +827,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) CASE Left( cParamL, 6 ) == "-plat=" ; ParseCOMPPLAT( hbmk, SubStr( cParam, 7 ), _TARG_PLAT ) CASE Left( cParamL, 10 ) == "-platform=" ; ParseCOMPPLAT( hbmk, SubStr( cParam, 11 ), _TARG_PLAT ) CASE Left( cParamL, 6 ) == "-arch=" ; ParseCOMPPLAT( hbmk, SubStr( cParam, 7 ), _TARG_PLAT ) /* Compatibility */ - CASE Left( cParamL, 6 ) == "-build=" ; hbmk[ _HBMK_cBUILD ] := SubStr( cParam, 8 ) + CASE Left( cParamL, 7 ) == "-build=" ; hbmk[ _HBMK_cBUILD ] := SubStr( cParam, 8 ) CASE Left( cParamL, 6 ) == "-lang=" ; hbmk[ _HBMK_cUILNG ] := SubStr( cParam, 7 ) ; SetUILang( hbmk ) CASE cParamL == "-hbrun" ; lSkipBuild := .T. ; hbmk[ _HBMK_lRUN ] := .T. CASE cParamL == "-hbraw" ; hbmk[ _HBMK_lInfo ] := .F. ; lStopAfterHarbour := .T. ; lStopAfterCComp := .T. ; hbmk[ _HBMK_lCreateLib ] := .F. ; hbmk[ _HBMK_lCreateDyn ] := .F. ; lAcceptCFlag := .F. ; lAcceptLDFlag := .F. @@ -1540,6 +1540,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) Left( cParamL, 6 ) == "-plat=" .OR. ; Left( cParamL, 10 ) == "-platform=" .OR. ; Left( cParamL, 6 ) == "-arch=" .OR. ; /* Compatibility */ + Left( cParamL, 7 ) == "-build=" .OR. ; + Left( cParamL, 6 ) == "-lang=" .OR. ; Left( cParamL, 5 ) == "-env:" .OR. ; cParamL == "-hbrun" .OR. ; cParamL == "-hbraw" .OR. ; @@ -8151,7 +8153,7 @@ STATIC PROCEDURE ShowHelp( lLong ) { "-runflag=" , I_( "pass flag to output executable when -run option is used" ) },; { "-jobs=" , I_( "start n compilation threads (multiprocess platforms only)" ) },; { "-inc" , I_( "enable incremental build mode" ) },; - { "-[no]head[=]" , I_( "control source header parsing (in incremental build mode)\n can be: native, full, partial (default), off" ) },; + { "-[no]head[=]" , I_( "control source header parsing (in incremental build mode)\n can be: native (uses compiler to extract dependencies), full (uses simple text parser on the whole file), partial (default, uses simple text parser on 1st 16KB chunk of the file), off" ) },; { "-rebuild" , I_( "rebuild all (in incremental build mode)" ) },; { "-clean" , I_( "clean (in incremental build mode)" ) },; { "-workdir=" , hb_StrFormat( I_( "working directory for incremental build mode\n(default: %1$s/plat/comp)" ), _WORKDIR_BASE_ ) },; diff --git a/harbour/utils/hbmk2/hbmk2.pt_BR.po b/harbour/utils/hbmk2/hbmk2.pt_BR.po index 30a7169b47..e6b676c454 100644 --- a/harbour/utils/hbmk2/hbmk2.pt_BR.po +++ b/harbour/utils/hbmk2/hbmk2.pt_BR.po @@ -585,8 +585,7 @@ msgstr "seta o #: hbmk2.prg:7942 #, c-format msgid "" -"control source header parsing (in incremental build mode)\\n" -" can be: native, full, partial (default), off" +"control source header parsing (in incremental build mode)\n can be: native (uses compiler to extract dependencies), full (uses simple text parser on the whole file), partial (default, uses simple text parser on 1st 16KB chunk of the file), off" msgstr "" "controla a análise de cabeçalhos (no modo de compilaçăo incremental)\\n" " pode ser: native, full, partial (padrăo), off"