diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 427e521323..3084bcee58 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,26 @@ +Tue Oct 26 17:16:43 1999 Gonzalo A. Diethelm + + * source/common/hbtrace.c: + Now it is REALLY efficient; no copying, nothing. + + * source/rtl/codebloc.c: + * source/rtl/dir.c: + * source/rtl/filesys.c: + * source/rtl/inkey.c: + * source/rtl/memvars.c: + * source/rtl/set.c: + * source/vm/hvm.c: + Got rid of other ways of tracing. Hopefully now HB_TRACE() is the + only, standard way used in Harbour. + + * source/rtl/gt/gt_tpl.c: + * source/rtl/gt/gtdos.c: + * source/rtl/gt/gtos2.c: + * source/rtl/gt/gtstd.c: + * source/rtl/gt/gtwin.c: + Made sure all the GT implementations (including the template) have + proper HB_TRACE() calls. + Tue Oct 26 13:20:46 1999 Gonzalo A. Diethelm * source/runner/runlib.c: diff --git a/harbour/source/common/hbtrace.c b/harbour/source/common/hbtrace.c index b700f81586..509bbdbf72 100644 --- a/harbour/source/common/hbtrace.c +++ b/harbour/source/common/hbtrace.c @@ -44,8 +44,7 @@ int hb_tr_line_ = 0; void hb_tr_trace( char * fmt, ... ) { - char file[256]; - int i, j; + int i; va_list ap; /* @@ -55,7 +54,7 @@ void hb_tr_trace( char * fmt, ... ) * * we just show * - * baz.c + * foo/bar/baz.c */ for (i = 0; hb_tr_file_[i] != '\0'; ++i) { if (hb_tr_file_[i] != '.' && @@ -63,16 +62,12 @@ void hb_tr_trace( char * fmt, ... ) hb_tr_file_[i] != '\\') break; } - for (j = 0; hb_tr_file_[i] != '\0'; ++i, ++j) { - file[j] = hb_tr_file_[i]; - } - file[j] = '\0'; /* * Print file and line. */ fprintf(stderr, "%s:%d: ", - file, hb_tr_line_); + hb_tr_file_ + i, hb_tr_line_); /* * Print the name and arguments for the function. diff --git a/harbour/source/rtl/codebloc.c b/harbour/source/rtl/codebloc.c index b6fac0b3e3..e540a900d2 100644 --- a/harbour/source/rtl/codebloc.c +++ b/harbour/source/rtl/codebloc.c @@ -39,10 +39,6 @@ #include "ctoharb.h" #include "itemapi.h" -/* Uncomment this to trace codeblocks activity -#define CODEBLOCKDEBUG -*/ - /* Creates the codeblock structure * * pBuffer -> the buffer with pcodes (without HB_P_PUSHBLOCK) @@ -167,9 +163,8 @@ HB_CODEBLOCK_PTR hb_codeblockNew( BYTE * pBuffer, pCBlock->pSymbols = pSymbols; pCBlock->ulCounter = 1; -#ifdef CODEBLOCKDEBUG - printf( "\ncodeblock created (%li) %lx", pCBlock->ulCounter, pCBlock ); -#endif + HB_TRACE(("codeblock created (%li) %lx\n", pCBlock->ulCounter, pCBlock)); + return pCBlock; } @@ -181,9 +176,8 @@ void hb_codeblockDelete( HB_ITEM_PTR pItem ) HB_TRACE(("hb_codeblockDelete(%p)", pItem)); -#ifdef CODEBLOCKDEBUG - printf( "\ndelete a codeblock (%li) %lx", pCBlock->ulCounter, pCBlock ); -#endif + HB_TRACE(("deleting a codeblock (%li) %lx\n", pCBlock->ulCounter, pCBlock)); + if( --pCBlock->ulCounter == 0 ) { /* free space allocated for local variables @@ -206,9 +200,8 @@ void hb_codeblockDelete( HB_ITEM_PTR pItem ) /* free space allocated for a CODEBLOCK structure */ hb_xfree( pCBlock ); - #ifdef CODEBLOCKDEBUG - printf( "\ncodeblock deleted (%li) %lx", pCBlock->ulCounter, pCBlock ); - #endif + + HB_TRACE(("codeblock deleted (%li) %lx\n", pCBlock->ulCounter, pCBlock)); } } @@ -262,7 +255,6 @@ void hb_codeblockCopy( PHB_ITEM pDest, PHB_ITEM pSource ) pDest->item.asBlock.value = pSource->item.asBlock.value; pDest->item.asBlock.value->ulCounter++; - #ifdef CODEBLOCKDEBUG - printf( "\ncopy a codeblock (%li) %lx", pSource->item.asBlock.value->ulCounter, pSource->item.asBlock.value ); - #endif + + HB_TRACE(("copied a codeblock (%li) %lx\n", pSource->item.asBlock.value->ulCounter, pSource->item.asBlock.value)); } diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index 8463d88b21..633968b6aa 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -575,11 +575,9 @@ HARBOUR HB_DIRECTORY( void ) if( strlen( pfname ) < 1 ) strcpy( pfname, "*" ); -/* debug code - printf( "\n dirname pattern %s %s ", dirname, pattern ); - printf( "\n pfname pfext %s %s ", pfname, pfext ); - while( 0 == getchar() ); -*/ + HB_TRACE(("dirname: |%s|, pattern: |%s|\n", dirname, pattern)); + HB_TRACE(("pfname: |%s|, pfext: |%s|\n", pfname, pfext)); + /* should have drive,directory in dirname and filespec in pattern */ tzset(); @@ -622,10 +620,8 @@ HARBOUR HB_DIRECTORY( void ) if( NULL == dir ) { -/* debug code - printf( "\n invalid dirname %s ", dirname ); - while( 0 == getchar() ); -*/ + HB_TRACE(("invalid dirname |%s|\n", dirname)); + hb_itemReturn( pDir ); hb_itemRelease( pDir ); return; @@ -660,10 +656,8 @@ HARBOUR HB_DIRECTORY( void ) if( !*fname ) strcpy( fname, "*" ); -/* debug code - printf( "\n fname: %s fext: %s ", fname, fext ); - while( 0 == getchar() ); -*/ + HB_TRACE(("fname: |%s|, fext: |%s|\n", fname, fext)); + if( hb_strMatchRegExp( fname, pfname ) && hb_strMatchRegExp( fext, pfext ) ) { attrib = 0; @@ -748,19 +742,13 @@ HARBOUR HB_DIRECTORY( void ) sprintf( ttime, "%02d:%02d:%02d", ft->tm_hour, ft->tm_min, ft->tm_sec ); -/* debug code - printf( "\n name date time %s %s %s ", filename, ddate, ttime ); - while( 0 == getchar() ); -*/ + HB_TRACE(("name: |%s|, date: |%s|, time: |%s|\n", filename, ddate, ttime)); } -/* debug code else { - printf( "\n invalid file %s ", fullfile ); - while( 0 == getchar() ); + HB_TRACE(("invalid file |%s|\n", fullfile)); } -*/ if( !( ( ( ushbMask & FA_HIDDEN ) == 0 && ( attrib & FA_HIDDEN ) > 0 ) || ( ( ushbMask & FA_SYSTEM ) == 0 && ( attrib & FA_SYSTEM ) > 0 ) || @@ -806,10 +794,9 @@ HARBOUR HB_DIRECTORY( void ) #if defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINGW32__) } #endif -/* debug code - printf( "\n normal return" ); - while( 0 == getchar() ); -*/ + + HB_TRACE(("normal return\n")); + hb_itemReturn( pDir ); /* DIRECTORY() returns an array */ hb_itemRelease( pDir ); diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 7fe22556f2..e91c9abab4 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -218,23 +218,21 @@ static int convert_open_flags( USHORT uiFlags ) HB_TRACE(("convert_open_flags(%hu)", uiFlags)); -/* DEBUG: printf("\nHarbour open flags: 0x%04x", uiFlags); */ - result_flags |= O_BINARY; -/* DEBUG: printf(", O_BINARY"); */ + HB_TRACE(("convert_open_flags: added O_BINARY\n")); #if defined( _MSC_VER ) || defined(__MINGW32__) || defined(__IBMCPP__) if( ( uiFlags & ( FO_WRITE | FO_READWRITE ) ) == FO_READ ) { result_flags |= O_RDONLY; -/* DEBUG: printf(", O_RDONLY"); */ + HB_TRACE(("convert_open_flags: added O_RDONLY\n")); } #else if( ( uiFlags & ( FO_WRITE | FO_READWRITE ) ) == FO_READ ) { result_flags |= ( O_RDONLY | SH_COMPAT ); -/* DEBUG: printf(", O_RDONLY SH_COMPAT"); */ + HB_TRACE(("convert_open_flags: added O_RDONLY SH_COMPAT\n")); } #endif @@ -242,13 +240,13 @@ static int convert_open_flags( USHORT uiFlags ) if( uiFlags & FO_WRITE ) { result_flags |= O_WRONLY; -/* DEBUG: printf(", O_WRONLY"); */ + HB_TRACE(("convert_open_flags: added O_WRONLY\n")); } if( uiFlags & FO_READWRITE ) { result_flags |= O_RDWR; -/* DEBUG: printf(", O_RDWR"); */ + HB_TRACE(("convert_open_flags: added O_RDWR\n")); } #if ! defined(_MSC_VER) && ! defined(__MINGW32__) && ! defined(__IBMCPP__) @@ -256,34 +254,35 @@ static int convert_open_flags( USHORT uiFlags ) if( ( uiFlags & FO_DENYREAD ) == FO_DENYREAD ) { result_flags |= SH_DENYRD; -/* DEBUG: printf(", SH_DENYRD"); */ + HB_TRACE(("convert_open_flags: added SH_DENYRD\n")); } else if( uiFlags & FO_EXCLUSIVE ) { result_flags |= SH_DENYRW; -/* DEBUG: printf(", SH_DENYRW"); */ + HB_TRACE(("convert_open_flags: added SH_DENYRW\n")); } else if( uiFlags & FO_DENYWRITE ) { result_flags |= SH_DENYWR; -/* DEBUG: printf(", SH_DENYWR"); */ + HB_TRACE(("convert_open_flags: added SH_DENYWR\n")); } if( uiFlags & FO_DENYNONE ) { result_flags |= SH_DENYNO; -/* DEBUG: printf(", SH_DENYNO"); */ + HB_TRACE(("convert_open_flags: added SH_DENYNO\n")); } if( uiFlags & FO_SHARED ) { result_flags |= SH_DENYNO; -/* DEBUG: printf(", SH_DENYNO"); */ + HB_TRACE(("convert_open_flags: added SH_DENYNO\n")); } #endif -/* DEBUG: printf(", C/C++ open flags: 0x%04x\n", result_flags); */ + + HB_TRACE(("convert_open_flags: result is 0x%04x\n", result_flags)); return result_flags; } @@ -318,7 +317,7 @@ static void convert_create_flags( USHORT uiFlags, int * result_flags, unsigned * if( uiFlags & FC_READONLY ) { *result_pmode = S_IRUSR; -/* DEBUG: printf(" S_IRUSR"); */ + HB_TRACE(("convert_create_flags: S_IRUSR")); } if( uiFlags & FC_HIDDEN ) @@ -326,7 +325,8 @@ static void convert_create_flags( USHORT uiFlags, int * result_flags, unsigned * if( uiFlags & FC_SYSTEM ) *result_flags |= 0; -/* DEBUG: printf(" 0x%04x, 0x%04x\n", *result_flags, *result_pmode); */ + + HB_TRACE(("convert_create_flags: 0x%04x, 0x%04x\n", *result_flags, *result_pmode)); } #endif @@ -1747,12 +1747,10 @@ PHB_FNAME hb_fsFNameSplit( char * szFileName ) pFileName->szName[ iDotPos - iSlashPos - 1 ] = '\0'; } -/* DEBUG - printf( "\nFilename: %s\n", szFileName ); - printf( "\n szPath: %s\n", pFileName->szPath ); - printf( "\n szName: %s\n", pFileName->szName ); - printf( "\n szExt: %s\n", pFileName->szExtension ); -*/ + HB_TRACE(("hb_fsFNameSplit: Filename: |%s|\n", szFileName)); + HB_TRACE(("hb_fsFNameSplit: szPath: |%s|\n", pFileName->szPath)); + HB_TRACE(("hb_fsFNameSplit: szName: |%s|\n", pFileName->szName)); + HB_TRACE(("hb_fsFNameSplit: szExt: |%s|\n", pFileName->szExtension)); return pFileName; } @@ -1819,13 +1817,10 @@ char * hb_fsFNameMerge( char * szFileName, PHB_FNAME pFileName ) } } -/* DEBUG - printf( "\nMERGE:\n" ); - printf( "\n szPath: %s\n", pFileName->szPath ); - printf( "\n szName: %s\n", pFileName->szName ); - printf( "\n szExt: %s\n", pFileName->szExtension ); - printf( "\nFilename result: %s\n", szFileName ); -*/ + HB_TRACE(("hb_fsFNameMerge: szPath: |%s|\n", pFileName->szPath)); + HB_TRACE(("hb_fsFNameMerge: szName: |%s|\n", pFileName->szName)); + HB_TRACE(("hb_fsFNameMerge: szExt: |%s|\n", pFileName->szExtension)); + HB_TRACE(("hb_fsFNameMerge: Filename: |%s|\n", szFileName)); return szFileName; } diff --git a/harbour/source/rtl/gt/gt_tpl.c b/harbour/source/rtl/gt/gt_tpl.c index 2706f4ccf9..db63bab44e 100644 --- a/harbour/source/rtl/gt/gt_tpl.c +++ b/harbour/source/rtl/gt/gt_tpl.c @@ -41,34 +41,46 @@ void hb_gt_Init( void ) { + HB_TRACE(("hb_gt_Init()")); + /* TODO: Is anything required to initialize the video subsystem? */ } void hb_gt_Done( void ) { + HB_TRACE(("hb_gt_Done()")); + /* TODO: */ } BOOL hb_gt_IsColor( void ) { + HB_TRACE(("hb_gt_IsColor()")); + /* TODO: How to detect this? */ return TRUE; } USHORT hb_gt_GetScreenWidth( void ) { + HB_TRACE(("hb_gt_GetScreenWidth()")); + /* TODO: How many columns on screen? */ return 0; } USHORT hb_gt_GetScreenHeight( void ) { + HB_TRACE(("hb_gt_GetScreenHeight()")); + /* TODO: How many rows on screen? */ return 0; } void hb_gt_SetPos( USHORT uiRow, USHORT uiCol ) { + HB_TRACE(("hb_gt_SetPos(%hu, %hu)", uiRow, uiCol)); + /* TODO: How to reposition the cursor? */ HB_SYMBOL_UNUSED( uiRow ); @@ -77,12 +89,16 @@ void hb_gt_SetPos( USHORT uiRow, USHORT uiCol ) USHORT hb_gt_Col( void ) { + HB_TRACE(("hb_gt_Col()")); + /* TODO: What Column is the cursor on? */ return 0; } USHORT hb_gt_Row( void ) { + HB_TRACE(("hb_gt_Row()")); + /* TODO: What Row is the cursor on? */ return 0; } @@ -91,16 +107,9 @@ USHORT hb_gt_GetCursorStyle( void ) { /* TODO: What shape is the cursor? */ USHORT uiStyle = 0; -/* - char start, end; - if( !visible ) - { - uiStyle = SC_NONE; - } - else - { -*/ + HB_TRACE(("hb_gt_GetCursorStyle()")); + /* example from the dos driver */ /* hb_gt_GetCursorSize( &start, &end ) @@ -126,6 +135,8 @@ USHORT hb_gt_GetCursorStyle( void ) void hb_gt_SetCursorStyle( USHORT uiStyle ) { + HB_TRACE(("hb_gt_SetCursorStyle(%hu)", uiStyle)); + /* TODO: How to set the shape of the cursor? */ /* see ..\..\..\tests\working\cursrtst.prg for an explanation */ switch( uiStyle ) @@ -153,6 +164,8 @@ void hb_gt_SetCursorStyle( USHORT uiStyle ) void hb_gt_Puts( USHORT uiRow, USHORT uiCol, BYTE byAttr, BYTE * pbyStr, ULONG ulLen ) { + HB_TRACE(("hb_gt_Puts(%hu, %hu, %d, %p, %lu)", uiRow, uiCol, (int) byAttr, pbyStr, ulLen)); + HB_SYMBOL_UNUSED( uiRow ); HB_SYMBOL_UNUSED( uiCol ); HB_SYMBOL_UNUSED( byAttr ); @@ -162,6 +175,8 @@ void hb_gt_Puts( USHORT uiRow, USHORT uiCol, BYTE byAttr, BYTE * pbyStr, ULONG u void hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyDst ) { + HB_TRACE(("hb_gt_GetText(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pbyDst)); + HB_SYMBOL_UNUSED( uiTop ); HB_SYMBOL_UNUSED( uiLeft ); HB_SYMBOL_UNUSED( uiBottom ); @@ -171,6 +186,8 @@ void hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight void hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbySrc ) { + HB_TRACE(("hb_gt_PutText(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pbySrc)); + HB_SYMBOL_UNUSED( uiTop ); HB_SYMBOL_UNUSED( uiLeft ); HB_SYMBOL_UNUSED( uiBottom ); @@ -180,6 +197,8 @@ void hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight void hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) { + HB_TRACE(("hb_gt_SetAttribute(%hu, %hu, %hu, %hu, %d)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr)); + /* TODO: we want to take a screen that is say bright white on blue, and change the attributes only for a section of the screen to white on black. @@ -194,6 +213,8 @@ void hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT ui void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr, SHORT iRows, SHORT iCols ) { + HB_TRACE(("hb_gt_Scroll(%hu, %hu, %hu, %hu, %d, %hd, %hd)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr, iRows, iCols)); + HB_SYMBOL_UNUSED( uiTop ); HB_SYMBOL_UNUSED( uiLeft ); HB_SYMBOL_UNUSED( uiBottom ); @@ -204,6 +225,8 @@ void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void hb_gt_DispBegin( void ) { + HB_TRACE(("hb_gt_DispBegin()")); + /* TODO: Is there a way to change screen buffers? ie: can we write somewhere without it going to the screen and then update the screen from this buffer at a later time? @@ -213,11 +236,15 @@ void hb_gt_DispBegin( void ) void hb_gt_DispEnd() { + HB_TRACE(("hb_gt_DispEnd()")); + /* TODO: here we flush the buffer, and restore normal screen writes */ } BOOL hb_gt_SetMode( USHORT uiRows, USHORT uiCols ) { + HB_TRACE(("hb_gt_SetMode(%hu, %hu)", uiRows, uiCols)); + /* TODO: How to change the size of the screen? */ HB_SYMBOL_UNUSED( uiRows ); @@ -226,6 +253,8 @@ BOOL hb_gt_SetMode( USHORT uiRows, USHORT uiCols ) void hb_gt_Replicate( BYTE byChar, ULONG ulLen ) { + HB_TRACE(("hb_gt_Replicate(%d, %lu)", (int) byChar, ulLen)); + /* TODO: this will write character c nlength times to the screen. Note that it is not used yet If there is no native function that supports this, it is @@ -238,6 +267,8 @@ void hb_gt_Replicate( BYTE byChar, ULONG ulLen ) BOOL hb_gt_GetBlink() { + HB_TRACE(("hb_gt_GetBlink()")); + /* TODO: under dos, the background 'intensity' bit can be switched from intensity to 'blinking' does this work under your platform? @@ -247,6 +278,8 @@ BOOL hb_gt_GetBlink() void hb_gt_SetBlink( BOOL bBlink ) { + HB_TRACE(("hb_gt_SetBlink(%d)", (int) bBlink)); + /* TODO: set the bit if it's supported */ HB_SYMBOL_UNUSED( bBlink ); diff --git a/harbour/source/rtl/gt/gtdos.c b/harbour/source/rtl/gt/gtdos.c index 2e30c2745b..c43fcc9188 100644 --- a/harbour/source/rtl/gt/gtdos.c +++ b/harbour/source/rtl/gt/gtdos.c @@ -97,6 +97,8 @@ static int s_iOldCtrlBreak = 0; static int hb_gt_CtrlBrkHandler( void ) { + HB_TRACE(("hb_gt_CtrlBrkHandler()")); + if( hb_set.HB_SET_CANCEL ) hb_vmRequestCancel(); @@ -105,11 +107,15 @@ static int hb_gt_CtrlBrkHandler( void ) static void hb_gt_CtrlBrkRestore( void ) { + HB_TRACE(("hb_gt_CtrlBrkRestore()")); + setcbrk( s_iOldCtrlBreak ); } void hb_gt_Init( void ) { + HB_TRACE(("hb_gt_Init()")); + /* Set the Ctrl+Break handler [vszel] */ ctrlbrk( hb_gt_CtrlBrkHandler ); @@ -129,10 +135,13 @@ void hb_gt_Init( void ) void hb_gt_Done( void ) { + HB_TRACE(("hb_gt_Done()")); } BOOL hb_gt_IsColor( void ) { + HB_TRACE(("hb_gt_IsColor()")); + return hb_gt_GetScreenMode() != 7; } @@ -141,6 +150,8 @@ static char FAR * hb_gt_ScreenAddress() { char FAR * ptr; + HB_TRACE(("hb_gt_ScreenAddress()")); + #if defined(__WATCOMC__) && defined(__386__) if( hb_gt_IsColor() ) { @@ -168,12 +179,16 @@ static char FAR * hb_gt_ScreenAddress() #ifndef __DJGPP__ char FAR * hb_gt_ScreenPtr( USHORT cRow, USHORT cCol ) { + HB_TRACE(("hb_gt_ScreenPtr(%hu, %hu)", cRow, cCol)); + return scrnPtr + ( cRow * hb_gt_GetScreenWidth() * 2 ) + ( cCol * 2 ); } #endif static char hb_gt_GetScreenMode( void ) { + HB_TRACE(("hb_gt_GetScreenMode()")); + #if defined(__WATCOMC__) && defined(__386__) return *( ( char * ) 0x0449 ); #elif defined(__DJGPP__) @@ -185,6 +200,8 @@ static char hb_gt_GetScreenMode( void ) USHORT hb_gt_GetScreenWidth( void ) { + HB_TRACE(("hb_gt_GetScreenWidth()")); + #if defined(__WATCOMC__) && defined(__386__) return ( USHORT ) *( ( char * ) 0x044A ); #elif defined(__DJGPP__) @@ -196,6 +213,8 @@ USHORT hb_gt_GetScreenWidth( void ) USHORT hb_gt_GetScreenHeight( void ) { + HB_TRACE(("hb_gt_GetScreenHeigth()")); + #if defined(__WATCOMC__) && defined(__386__) return ( USHORT ) ( char ) ( *( ( char * ) 0x0484 ) + 1 ); #elif defined(__DJGPP__) @@ -207,70 +226,87 @@ USHORT hb_gt_GetScreenHeight( void ) void hb_gt_SetPos( USHORT usRow, USHORT usCol ) { + HB_TRACE(("hb_gt_SetPos(%hu, %hu)", usRow, usCol)); + #if defined(__TURBOC__) - BYTE cRow, cCol; - - cRow = ( BYTE ) usRow; - cCol = ( BYTE ) usCol; - - _AH = 0x02; - _BH = 0; - _DH = cRow; - _DL = cCol; - geninterrupt( 0x10 ); + { + BYTE cRow, cCol; + cRow = ( BYTE ) usRow; + cCol = ( BYTE ) usCol; + + _AH = 0x02; + _BH = 0; + _DH = cRow; + _DL = cCol; + geninterrupt( 0x10 ); + } #else - union REGS regs; - regs.h.ah = 0x02; - regs.h.bh = 0; - regs.h.dh = ( BYTE ) usRow; - regs.h.dl = ( BYTE ) usCol; + { + union REGS regs; + regs.h.ah = 0x02; + regs.h.bh = 0; + regs.h.dh = ( BYTE ) usRow; + regs.h.dl = ( BYTE ) usCol; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif + } #endif } static void hb_gt_SetCursorSize( char start, char end ) { + HB_TRACE(("hb_gt_SetCursorSize(%d, %d)", (int) start, (int) end)); + #if defined(__TURBOC__) - _AH = 0x01; - _CH = start; - _CL = end; - geninterrupt( 0x10 ); + { + _AH = 0x01; + _CH = start; + _CL = end; + geninterrupt( 0x10 ); + } #else - union REGS regs; - regs.h.ah = 0x01; - regs.h.ch = start; - regs.h.cl = end; + { + union REGS regs; + regs.h.ah = 0x01; + regs.h.ch = start; + regs.h.cl = end; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif + } #endif } static void hb_gt_GetCursorSize( char * start, char *end ) { + HB_TRACE(("hb_gt_GetCursorSize(%p, %p)", start, end)); + #if defined(__TURBOC__) - _AH = 0x03; - _BH = 0; - geninterrupt( 0x10 ); - *start = _CH; - *end = _CL; + { + _AH = 0x03; + _BH = 0; + geninterrupt( 0x10 ); + *start = _CH; + *end = _CL; + } #else - union REGS regs; - regs.h.ah = 0x03; - regs.h.bh = 0; + { + union REGS regs; + regs.h.ah = 0x03; + regs.h.bh = 0; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif - *start = regs.h.ch; - *end = regs.h.cl; + *start = regs.h.ch; + *end = regs.h.cl; + } #endif } @@ -279,6 +315,8 @@ USHORT hb_gt_GetCursorStyle( void ) char start, end; int rc; + HB_TRACE(("hb_gt_GetCursorStyle()")); + hb_gt_GetCursorSize( &start, &end ); if( ( start == 32 ) && ( end == 32 ) ) @@ -304,6 +342,8 @@ USHORT hb_gt_GetCursorStyle( void ) void hb_gt_SetCursorStyle( USHORT style ) { + HB_TRACE(("hb_gt_SetCursorStyle(%hu)", style)); + switch( style ) { case SC_NONE: @@ -333,120 +373,156 @@ void hb_gt_SetCursorStyle( USHORT style ) static void hb_gt_xGetXY( USHORT cRow, USHORT cCol, BYTE * attr, BYTE * ch ) { -#ifdef __DJGPP__ - short ch_attr; - gettext( cCol + 1, cRow + 1, cCol + 1, cRow + 1, &ch_attr ); - *ch = ch_attr >> 8; - *attr = ch_attr & 0xFF; + HB_TRACE(("hb_gt_xGetXY(%hu, %hu, %p, %p", cRow, cCol, ch, attr)); -/* printf("\r\nhb_gt_xGetXY(): row == %d, col = %d, char = %d, attr = %d", cRow, cCol, *ch, *attr ); */ +#ifdef __DJGPP__ + { + short ch_attr; + gettext( cCol + 1, cRow + 1, cCol + 1, cRow + 1, &ch_attr ); + *ch = ch_attr >> 8; + *attr = ch_attr & 0xFF; + } #else - char FAR *p; - p = hb_gt_ScreenPtr( cRow, cCol ); - *ch = *p; - *attr = *( p + 1 ); + { + char FAR *p; + p = hb_gt_ScreenPtr( cRow, cCol ); + *ch = *p; + *attr = *( p + 1 ); + } #endif } - + void hb_gt_xPutch( USHORT cRow, USHORT cCol, BYTE attr, BYTE ch ) { + HB_TRACE(("hb_gt_xPutch(%hu, %hu, %d, %d", cRow, cCol, (int) attr, (int) ch)); + #ifdef __DJGPP__ - long ch_attr = ( ch << 8 ) | attr; -/* printf("\r\nhb_gt_xPutch(): row == %d, col = %d, char = %d, attr = %d", cRow, cCol, ch, attr ); */ - puttext( cCol + 1, cRow + 1, cCol + 1, cRow + 1, &ch_attr ); + { + long ch_attr; + ch_attr = ( ch << 8 ) | attr; + puttext( cCol + 1, cRow + 1, cCol + 1, cRow + 1, &ch_attr ); + } #else - char FAR * p; - p = hb_gt_ScreenPtr( cRow, cCol ); - *p = ch; - *( p + 1 ) = attr; + { + char FAR * p; + p = hb_gt_ScreenPtr( cRow, cCol ); + *p = ch; + *( p + 1 ) = attr; + } #endif } void hb_gt_Puts( USHORT cRow, USHORT cCol, BYTE attr, BYTE *str, ULONG len ) { + HB_TRACE(("hb_gt_Puts(%hu, %hu, %d, %p, %lu", cRow, cCol, (int) attr, str, len)); + #ifdef __DJGPP__ - int i = ( int ) len; - int bottom, left = cCol, right, top = cRow; - int width = hb_gt_GetScreenWidth(); - BYTE * ch_attr, * ptr; -/* printf("\r\nhb_gt_Puts(): row == %d, col = %d, attr = %d, len = %d", cRow, cCol, attr, len ); */ - ptr = ch_attr = hb_xgrab( i * 2 ); - while( i-- ) { -/* printf("+"); */ - *ptr++ = *str++; -/* printf("-"); */ - *ptr++ = attr; + int i; + int bottom, left, right, top; + int width; + BYTE * ch_attr; + BYTE * ptr; + + i = ( int ) len; + left = cCol; + top = cRow; + width = hb_gt_GetScreenWidth(); + ptr = ch_attr = hb_xgrab( i * 2 ); + while( i-- ) + { + *ptr++ = *str++; + *ptr++ = attr; + } + i = len - 1; /* We want end position, not next cursor position */ + right = left; + bottom = top; + if( right + i > width - 1 ) + { + /* + * Calculate end row position and the remainder size for the + * end column adjust. + */ + bottom += ( i / width ); + i = i % width; + } + right += i; + if( right > width - 1 ) + { + /* Column movement overflows into next row */ + bottom++; + right -= width; + } + puttext( left + 1, top + 1, right + 1, bottom + 1, ch_attr ); + hb_xfree( ch_attr ); } - i = len - 1; /* We want end position, not next cursor position */ - right = left; - bottom = top; - if( right + i > width - 1 ) - { - /* Calculate end row position and the remainder size for the end column adjust */ - bottom += ( i / width ); - i = i % width; - } - right += i; - if( right > width - 1 ) - { - /* Column movement overflows into next row */ - bottom++; - right -= width; - } -/* printf("\r\nhb_gt_Puts(): puttext( %d,%d, %d,%d )", left + 1, top + 1, right + 1, bottom + 1 ); */ - puttext( left + 1, top + 1, right + 1, bottom + 1, ch_attr ); - hb_xfree( ch_attr ); #else - char FAR *p; - int i; - p = hb_gt_ScreenPtr( cRow, cCol ); - for( i = 0; i < len; i++ ) { - *p++ = *str++; - *p++ = attr; + char FAR *p; + int i; + + p = hb_gt_ScreenPtr( cRow, cCol ); + for( i = 0; i < len; i++ ) + { + *p++ = *str++; + *p++ = attr; + } } #endif } void hb_gt_GetText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, BYTE * dest ) { -#ifdef __DJGPP__ - gettext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, dest ); -#else - USHORT x, y; + HB_TRACE(("hb_gt_GetText(%hu, %hu, %hu, %hu, %p", usTop, usLeft, usBottom, usRight, dest)); - for( y = usTop; y <= usBottom; y++ ) +#ifdef __DJGPP__ { - for( x = usLeft; x <= usRight; x++ ) - { - hb_gt_xGetXY( y, x, dest + 1, dest ); - dest += 2; - } + gettext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, dest ); + } +#else + { + USHORT x, y; + + for( y = usTop; y <= usBottom; y++ ) + { + for( x = usLeft; x <= usRight; x++ ) + { + hb_gt_xGetXY( y, x, dest + 1, dest ); + dest += 2; + } + } } #endif } void hb_gt_PutText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, BYTE * srce ) { -#ifdef __DJGPP__ - puttext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, srce ); -#else - USHORT x, y; + HB_TRACE(("hb_gt_PutText(%hu, %hu, %hu, %hu, %p", usTop, usLeft, usBottom, usRight, srce)); - for( y = usTop; y <= usBottom; y++ ) +#ifdef __DJGPP__ { - for( x = usLeft; x <= usRight; x++ ) - { - hb_gt_xPutch( y, x, *( srce + 1 ), *srce ); - srce += 2; - } + puttext( usLeft + 1, usTop + 1, usRight + 1, usBottom + 1, srce ); + } +#else + { + USHORT x, y; + + for( y = usTop; y <= usBottom; y++ ) + { + for( x = usLeft; x <= usRight; x++ ) + { + hb_gt_xPutch( y, x, *( srce + 1 ), *srce ); + srce += 2; + } + } } #endif } void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, BYTE attr ) { + HB_TRACE(("hb_gt_SetAttribute(%hu, %hu, %hu, %hu, %d", usTop, usLeft, usBottom, usRight, (int) attr)); + USHORT x, y; for( y = usTop; y <= usBottom; y++ ) @@ -464,41 +540,53 @@ void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT us USHORT hb_gt_Col( void ) { + HB_TRACE(("hb_gt_Col()")); + #if defined(__TURBOC__) - _AH = 0x03; - _BH = 0; - geninterrupt( 0x10 ); - return _DL; + { + _AH = 0x03; + _BH = 0; + geninterrupt( 0x10 ); + return _DL; + } #else - union REGS regs; - regs.h.ah = 0x03; - regs.h.bh = 0; + { + union REGS regs; + regs.h.ah = 0x03; + regs.h.bh = 0; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif - return regs.h.dl; + return regs.h.dl; + } #endif } USHORT hb_gt_Row( void ) { + HB_TRACE(("hb_gt_Row()")); + #if defined(__TURBOC__) - _AH = 0x03; - _BH = 0; - geninterrupt( 0x10 ); - return _DH; + { + _AH = 0x03; + _BH = 0; + geninterrupt( 0x10 ); + return _DH; + } #else - union REGS regs; - regs.h.ah = 0x03; - regs.h.bh = 0; + { + union REGS regs; + regs.h.ah = 0x03; + regs.h.bh = 0; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif - return regs.h.dh; + return regs.h.dh; + } #endif } @@ -511,6 +599,8 @@ void hb_gt_Scroll( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, int iLength = ( usRight - usLeft ) + 1; int iCount, iColOld, iColNew, iColSize; + HB_TRACE(("hb_gt_Scroll(%hu, %hu, %hu, %hu, %d, %hd, %hd)", usTop, usLeft, usBottom, usRight, (int) attr, sVert, sHoriz)); + hb_gtGetPos( &usRow, &usCol ); if( hb_gtRectSize( usTop, usLeft, usBottom, usRight, &uiSize ) == 0 ) @@ -562,6 +652,8 @@ void hb_gt_Scroll( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, void hb_gt_DispBegin( void ) { + HB_TRACE(("hb_gt_DispBegin()")); + /* ptucker */ #ifndef __DJGPP__ if( hb_gtDispCount() == 1 ) @@ -582,6 +674,8 @@ void hb_gt_DispBegin( void ) void hb_gt_DispEnd( void ) { + HB_TRACE(("hb_gt_DispEnd()")); + /* ptucker */ #ifndef __DJGPP__ if( hb_gtDispCount() == 1 ) @@ -601,6 +695,8 @@ void hb_gt_DispEnd( void ) BOOL hb_gt_SetMode( USHORT usRows, USHORT usCols ) { + HB_TRACE(("hb_gt_SetMode(%hu, %hu)", usRows, usCols)); + /* TODO: Implement this function. */ HB_SYMBOL_UNUSED( usRows ); @@ -611,12 +707,16 @@ BOOL hb_gt_SetMode( USHORT usRows, USHORT usCols ) void hb_gt_Replicate( BYTE c, ULONG nLength ) { + HB_TRACE(("hb_gt_Replicate(%d, %lu)", (int) c, nLength)); + c = ' '; nLength = 0; } BOOL hb_gt_GetBlink() { + HB_TRACE(("hb_gt_GetBlink()")); + #if defined(__WATCOMC__) && defined(__386__) return *( ( char * ) 0x0465 ) & 0x10; #elif defined(__DJGPP__) @@ -628,21 +728,26 @@ BOOL hb_gt_GetBlink() void hb_gt_SetBlink( BOOL bBlink ) { + HB_TRACE(("hb_gt_SetBlink(%d)", (int) bBlink)); + #if defined(__TURBOC__) - _AX = 0x1003; - _BX = bBlink; - geninterrupt( 0x10 ); - return; + { + _AX = 0x1003; + _BX = bBlink; + geninterrupt( 0x10 ); + } #else - union REGS regs; - regs.h.ah = 0x10; - regs.h.al = 0x03; - regs.h.bh = 0; - regs.h.bl = bBlink; + { + union REGS regs; + regs.h.ah = 0x10; + regs.h.al = 0x03; + regs.h.bh = 0; + regs.h.bl = bBlink; #if defined(__WATCOMC__) && defined(__386__) - int386( 0x10, ®s, ®s ); + int386( 0x10, ®s, ®s ); #else - int86( 0x10, ®s, ®s ); + int86( 0x10, ®s, ®s ); #endif + } #endif } diff --git a/harbour/source/rtl/gt/gtos2.c b/harbour/source/rtl/gt/gtos2.c index 17890d66ad..7b03c8971d 100644 --- a/harbour/source/rtl/gt/gtos2.c +++ b/harbour/source/rtl/gt/gtos2.c @@ -55,11 +55,15 @@ static void hb_gt_GetCursorSize( char * start, char * end ); void hb_gt_Init( void ) { + HB_TRACE(("hb_gt_Init()")); + /* TODO: Is anything required to initialize the video subsystem? */ } void hb_gt_Done( void ) { + HB_TRACE(("hb_gt_Done()")); + /* TODO: */ } @@ -68,6 +72,8 @@ BOOL hb_gt_IsColor( void ) /* Chen Kedem */ VIOMODEINFO vi; + HB_TRACE(("hb_gt_IsColor()")); + vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &vi, 0 ); return vi.fbType != 0; /* 0 = monochrom-compatible mode */ @@ -77,6 +83,8 @@ USHORT hb_gt_GetScreenWidth( void ) { VIOMODEINFO vi; + HB_TRACE(("hb_gt_GetScreenWidth()")); + vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &vi, 0 ); return vi.col; @@ -86,6 +94,8 @@ USHORT hb_gt_GetScreenHeight( void ) { VIOMODEINFO vi; + HB_TRACE(("hb_gt_GetScreenHeight()")); + vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &vi, 0 ); return vi.row; @@ -93,6 +103,8 @@ USHORT hb_gt_GetScreenHeight( void ) void hb_gt_SetPos( USHORT uiRow, USHORT uiCol ) { + HB_TRACE(("hb_gt_SetPos(%hu, %hu)", uiRow, uiCol)); + VioSetCurPos( uiRow, uiCol, 0 ); } @@ -100,6 +112,8 @@ USHORT hb_gt_Row( void ) { USHORT x, y; + HB_TRACE(("hb_gt_Row()")); + VioGetCurPos( &y, &x, 0 ); return y; } @@ -108,6 +122,8 @@ USHORT hb_gt_Col( void ) { USHORT x, y; + HB_TRACE(("hb_gt_Col()")); + VioGetCurPos( &y, &x, 0 ); return x; } @@ -118,6 +134,9 @@ void hb_gt_Scroll( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, /* Chen Kedem */ BYTE bCell[ 2 ]; /* character/attribute pair */ + + HB_TRACE(("hb_gt_Scroll(%hu, %hu, %hu, %hu, %d, %hd, %hd)", usTop, usLeft, usBottom, usRigth, (int) attr, sVert, sHoriz)); + bCell [ 0 ] = ' '; bCell [ 1 ] = attr; if( ( sVert | sHoriz ) == 0 ) /* both zero, clear region */ @@ -145,6 +164,8 @@ static void hb_gt_GetCursorSize( char * start, char * end ) { VIOCURSORINFO vi; + HB_TRACE(("hb_gt_GetCursorSize(%p, %p)", start, end)); + VioGetCurType( &vi, 0 ); *start = vi.yStart; *end = vi.cEnd; @@ -156,6 +177,8 @@ static void hb_gt_SetCursorSize( char start, char end, int visible ) /* Chen Kedem */ VIOCURSORINFO vi; + HB_TRACE(("hb_gt_SetCursorSize(%d, %d, %d)", (int) start, (int) end, visible)); + vi.yStart = start; vi.cEnd = end; vi.cx = 0; @@ -167,8 +190,10 @@ static char hb_gt_GetCellSize() { /* Chen Kedem */ char rc ; - VIOMODEINFO vi; + + HB_TRACE(("hb_gt_GetCellSize()")); + vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &vi, 0 ); rc = ( char )( vi.row ? ( vi.vres / vi.row ) - 1 : 0 ); @@ -182,6 +207,8 @@ USHORT hb_gt_GetCursorStyle( void ) char cellsize; VIOCURSORINFO vi; + HB_TRACE(("hb_gt_GetCursorStyle()")); + VioGetCurType( &vi, 0 ); if( vi.attr ) @@ -218,6 +245,8 @@ void hb_gt_SetCursorStyle( USHORT style ) char cellsize; VIOCURSORINFO vi; + HB_TRACE(("hb_gt_SetCursorStyle(%hu)", style)); + cellsize = hb_gt_GetCellSize(); switch( style ) { @@ -248,6 +277,8 @@ void hb_gt_SetCursorStyle( USHORT style ) void hb_gt_Puts( USHORT usRow, USHORT usCol, BYTE attr, BYTE * str, ULONG len ) { + HB_TRACE(("hb_gt_Puts(%hu, %hu, %d, %p, %lu)", usRow, usCol, (int) attr, str, len)); + VioWrtCharStrAtt( ( char * ) str, ( USHORT ) len, usRow, usCol, ( BYTE * ) &attr, 0 ); } @@ -255,6 +286,8 @@ void hb_gt_GetText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight { USHORT width, y; + HB_TRACE(("hb_gt_GetText(%hu, %hu, %hu, %hu, %p)", usTop, usLeft, usBottom, usRigth, dest)); + width = ( USHORT ) ( ( usRight - usLeft + 1 ) * 2 ); for( y = usTop; y <= usBottom; y++ ) { @@ -267,6 +300,8 @@ void hb_gt_PutText( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight { USHORT width, y; + HB_TRACE(("hb_gt_PutText(%hu, %hu, %hu, %hu, %p)", usTop, usLeft, usBottom, usRigth, srce)); + width = ( USHORT ) ( ( usRight - usLeft + 1 ) * 2 ); for( y = usTop; y <= usBottom; y++ ) { @@ -284,6 +319,8 @@ void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT us USHORT width, y; + HB_TRACE(("hb_gt_SetAttribute(%hu, %hu, %hu, %hu, %d)", usTop, usLeft, usBottom, usRigth, (int) attr)); + /* assume top level check that coordinate are all valid and fall within visible screen, else if width cannot be fit on current line @@ -296,6 +333,8 @@ void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT us void hb_gt_DispBegin( void ) { + HB_TRACE(("hb_gt_DispBegin()")); + /* TODO: Is there a way to change screen buffers? ie: can we write somewhere without it going to the screen and then update the screen from this buffer at a later time? @@ -305,6 +344,8 @@ void hb_gt_DispBegin( void ) void hb_gt_DispEnd( void ) { + HB_TRACE(("hb_gt_DispEnd()")); + /* TODO: here we flush the buffer, and restore normal screen writes */ } @@ -312,6 +353,8 @@ BOOL hb_gt_SetMode( USHORT uiRows, USHORT uiCols ) { VIOMODEINFO vi; + HB_TRACE(("hb_gt_SetMode(%hu, %hu)", uiRows, uiCols)); + VioGetMode( &vi, 0 ); /* fill structure with current settings */ vi.row = uiRows; vi.col = uiCols; @@ -320,6 +363,8 @@ BOOL hb_gt_SetMode( USHORT uiRows, USHORT uiCols ) void hb_gt_Replicate( BYTE c, ULONG ulLen ) { + HB_TRACE(("hb_gt_Replicate(%d, %lu)", (int) c, ulLen)); + /* TODO: this will write character c nlength times to the screen. Note that it is not used yet If there is no native function that supports this, it is @@ -335,6 +380,8 @@ BOOL hb_gt_GetBlink() /* Chen Kedem */ VIOINTENSITY vi; + HB_TRACE(("hb_gt_GetBlink()")); + vi.cb = sizeof( VIOINTENSITY ); /* 6 */ vi.type = 2; /* get intensity/blink toggle */ VioGetState( &vi, 0 ); @@ -346,6 +393,8 @@ void hb_gt_SetBlink( BOOL bBlink ) /* Chen Kedem */ VIOINTENSITY vi; + HB_TRACE(("hb_gt_SetBlink(%d)", (int) bBlink)); + vi.cb = sizeof( VIOINTENSITY ); /* 6 */ vi.type = 2; /* set intensity/blink toggle */ vi.fs = ( bBlink ? 0 : 1 ); /* 0 = blink, 1 = intens */ diff --git a/harbour/source/rtl/gt/gtstd.c b/harbour/source/rtl/gt/gtstd.c index 46024bafee..cf89262368 100644 --- a/harbour/source/rtl/gt/gtstd.c +++ b/harbour/source/rtl/gt/gtstd.c @@ -48,6 +48,8 @@ static BOOL s_bBlink; void hb_gt_Init( void ) { + HB_TRACE(("hb_gt_Init()")); + s_iRow = 0; s_iCol = 0; #if defined(HB_OS_UNIX_COMPATIBLE) @@ -62,52 +64,70 @@ void hb_gt_Init( void ) void hb_gt_Done( void ) { - ; + HB_TRACE(("hb_gt_Done()")); } BOOL hb_gt_IsColor( void ) { + HB_TRACE(("hb_gt_IsColor()")); + return FALSE; } USHORT hb_gt_GetScreenWidth( void ) { + HB_TRACE(("hb_gt_GetScreenWidth()")); + return s_uiMaxCol; } USHORT hb_gt_GetScreenHeight( void ) { + HB_TRACE(("hb_gt_GetScreenHeight()")); + return s_uiMaxRow; } void hb_gt_SetPos( USHORT uiRow, USHORT uiCol ) { + HB_TRACE(("hb_gt_SetPos(%hu, %hu)", uiRow, uiCol)); + s_iCol = ( SHORT ) uiCol; s_iRow = ( SHORT ) uiRow; } USHORT hb_gt_Col( void ) { + HB_TRACE(("hb_gt_Col()")); + return s_iCol; } USHORT hb_gt_Row( void ) { + HB_TRACE(("hb_gt_Row()")); + return s_iRow; } USHORT hb_gt_GetCursorStyle( void ) { + HB_TRACE(("hb_gt_GetCursorStyle()")); + return s_uiCursorStyle; } void hb_gt_SetCursorStyle( USHORT uiCursorStyle ) { + HB_TRACE(("hb_gt_SetCursorStyle(%hu)", uiCursorStyle)); + s_uiCursorStyle = uiCursorStyle; } void hb_gt_Puts( USHORT uiRow, USHORT uiCol, BYTE byAttr, BYTE * pbyStr, ULONG ulLen ) { + HB_TRACE(("hb_gt_Puts(%hu, %hu, %d, %p, %lu)", uiRow, uiCol, (int) byAttr, pbyStr, ulLen)); + /* TODO: */ HB_SYMBOL_UNUSED( uiRow ); @@ -119,6 +139,8 @@ void hb_gt_Puts( USHORT uiRow, USHORT uiCol, BYTE byAttr, BYTE * pbyStr, ULONG u void hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbyDst ) { + HB_TRACE(("hb_gt_GetText(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pbyDst)); + HB_SYMBOL_UNUSED( uiTop ); HB_SYMBOL_UNUSED( uiLeft ); HB_SYMBOL_UNUSED( uiBottom ); @@ -128,6 +150,8 @@ void hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight void hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbySrc ) { + HB_TRACE(("hb_gt_PutText(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pbySrc)); + /* TODO: */ HB_SYMBOL_UNUSED( uiTop ); @@ -139,6 +163,8 @@ void hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight void hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ) { + HB_TRACE(("hb_gt_PutText(%hu, %hu, %hu, %hu, %d)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr)); + HB_SYMBOL_UNUSED( uiTop ); HB_SYMBOL_UNUSED( uiLeft ); HB_SYMBOL_UNUSED( uiBottom ); @@ -148,6 +174,8 @@ void hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT ui void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr, SHORT iRows, SHORT iCols ) { + HB_TRACE(("hb_gt_Scroll(%hu, %hu, %hu, %hu, %d, %hu, %hu)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr, iRows, iCols)); + /* TODO: */ HB_SYMBOL_UNUSED( uiTop ); @@ -160,22 +188,30 @@ void hb_gt_Scroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void hb_gt_DispBegin( void ) { + HB_TRACE(("hb_gt_DispBegin()")); + ; /* Do nothing */ } void hb_gt_DispEnd() { + HB_TRACE(("hb_gt_DispEnd()")); + ; /* Do nothing */ } BOOL hb_gt_SetMode( USHORT uiMaxRow, USHORT uiMaxCol ) { + HB_TRACE(("hb_gt_SetMode(%hu, %hu)", uiMaxRow, uiMaxCol)); + s_uiMaxRow = uiMaxRow; s_uiMaxCol = uiMaxCol; } void hb_gt_Replicate( BYTE byChar, ULONG ulLen ) { + HB_TRACE(("hb_gt_Replicate(%d, %lu)", (int) byChar, ulLen)); + /* TODO: */ HB_SYMBOL_UNUSED( byChar ); @@ -184,10 +220,14 @@ void hb_gt_Replicate( BYTE byChar, ULONG ulLen ) BOOL hb_gt_GetBlink() { + HB_TRACE(("hb_gt_GetBlink()")); + return s_bBlink; } void hb_gt_SetBlink( BOOL bBlink ) { + HB_TRACE(("hb_gt_SetBlink(%d)", (int) bBlink)); + s_bBlink = bBlink; } diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index 1be1305d90..df3a9a6564 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -107,6 +107,8 @@ static BOOL hb_gt_CtrlHandler( DWORD dwCtrlType ) { BOOL bHandled; + HB_TRACE(("hb_gt_CtrlHandler(%lu)", (unsigned long) dwCtrlType)); + switch( dwCtrlType ) { case CTRL_C_EVENT: diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index ac8a2849b5..b5cb3c2377 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -379,11 +379,9 @@ void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour BOOL bCtrl = dwState & ( LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED ); BOOL bShift = dwState & SHIFT_PRESSED; BOOL bEnhanced = dwState & ENHANCED_KEY; -/* - Debug code: -printf("\nhb_inkeyPoll: wKey is %d, dwState is %d, ch is %d", wKey, dwState, ch); -*/ + HB_TRACE(("hb_inkeyPoll: wKey is %d, dwState is %d, ch is %d", wKey, dwState, ch)); + if( bAlt ) { /* Alt key held */ @@ -607,19 +605,20 @@ printf("\nhb_inkeyPoll: wKey is %d, dwState is %d, ch is %d", wKey, dwState, ch) } } } -/* - Debug code: - else - { -WORD wKey; -if( s_eventmask & INKEY_EXTENDED ) - wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualKeyCode; -else - wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualScanCode; -printf("\nhb_inkeyPoll: wKey is %d", wKey); - } -*/ +#if 0 + /* Debug code: */ + else + { + + WORD wKey; + if( s_eventmask & INKEY_EXTENDED ) + wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualKeyCode; + else + wKey = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.wVirtualScanCode; + HB_TRACE(("hb_inkeyPoll: wKey is %d", wKey)); + } +#endif } } /* Set up to process the next input event (if any) */ diff --git a/harbour/source/rtl/memvars.c b/harbour/source/rtl/memvars.c index cb4931d17d..ce33a79c81 100644 --- a/harbour/source/rtl/memvars.c +++ b/harbour/source/rtl/memvars.c @@ -84,10 +84,6 @@ struct mv_PUBLIC_var_info }; -/* Uncomment this to trace memvars activity -#define MEMVARDEBUG -*/ - static void hb_memvarCreateFromItem( PHB_ITEM, BYTE, PHB_ITEM ); static void hb_memvarCreateFromDynSymbol( PHB_DYNS, BYTE, PHB_ITEM ); static void hb_memvarAddPrivate( PHB_DYNS ); @@ -218,9 +214,7 @@ HB_HANDLE hb_memvarValueNew( HB_ITEM_PTR pSource, BOOL bTrueMemvar ) else pValue->item.type = IT_NIL; - #ifdef MEMVARDEBUG - printf( "\n>>>>>Memvar item created with handle =%i", hValue ); - #endif + HB_TRACE(("hb_memvarValueNew: memvar item created with handle %i", hValue)); return hValue; } @@ -291,19 +285,18 @@ void hb_memvarValueIncRef( HB_HANDLE hValue ) { HB_TRACE(("hb_memvarValueIncRef(%p)", hValue)); - #ifdef MEMVARDEBUG +#if 0 + /* Debug */ if( hValue < 1 || hValue > s_globalTableSize ) { - printf( "\nInvalid MEMVAR handle %i (max %li)\n", hValue, s_globalTableSize ); + HB_TRACE(("Invalid memvar handle %i (max %li)", hValue, s_globalTableSize)); exit( 1 ); } - #endif +#endif s_globalTable[ hValue ].counter++; - #ifdef MEMVARDEBUG - printf( "\n+++Memvar item (%i) increment refCounter=%li", hValue, s_globalTable[ hValue ].counter ); - #endif + HB_TRACE(("Memvar item (%i) increment refCounter=%li", hValue, s_globalTable[ hValue ].counter)); } /* @@ -317,18 +310,18 @@ void hb_memvarValueDecRef( HB_HANDLE hValue ) HB_TRACE(("hb_memvarValueDecRef(%p)", hValue)); - #ifdef MEMVARDEBUG +#if 0 if( hValue < 1 || hValue > s_globalTableSize ) { - printf( "\nInvalid MEMVAR handle %i (max %li)\n", hValue, s_globalTableSize ); + HB_TRACE(("Invalid memvar handle %i (max %li)", hValue, s_globalTableSize)); exit( 1 ); } - #endif +#endif pValue = s_globalTable + hValue; - #ifdef MEMVARDEBUG - printf( "\n---Memvar item (%i) decrement refCounter=%li", hValue, pValue->counter-1 ); - #endif + + HB_TRACE(("Memvar item (%i) decrement refCounter=%li", hValue, pValue->counter-1)); + if( pValue->counter > 0 ) { if( --pValue->counter == 0 ) @@ -353,19 +346,19 @@ void hb_memvarValueDecRef( HB_HANDLE hValue ) else ++s_globalFreeCnt; - #ifdef MEMVARDEBUG - printf( "\n<<<<pDynSym; if( pDyn ) { - #ifdef MEMVARDEBUG - printf( "\n::::Memvar item (%i)(%s) assigned", pDyn->hMemvar, pMemvarSymb->szName ); - #endif + HB_TRACE(("Memvar item (%i)(%s) assigned", pDyn->hMemvar, pMemvarSymb->szName)); + if( pDyn->hMemvar ) { /* value is already created */ @@ -418,9 +410,8 @@ ERRCODE hb_memvarGet( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb ) pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym; if( pDyn ) { - #ifdef MEMVARDEBUG - printf( "\n????Memvar item (%i)(%s) queried", pDyn->hMemvar, pMemvarSymb->szName ); - #endif + HB_TRACE(("Memvar item (%i)(%s) queried", pDyn->hMemvar, pMemvarSymb->szName)); + if( pDyn->hMemvar ) { /* value is already created @@ -476,9 +467,8 @@ void hb_memvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb ) pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym; if( pDyn ) { - #ifdef MEMVARDEBUG - printf( "\n@@@@Memvar item (%i)(%s) referenced", pDyn->hMemvar, pMemvarSymb->szName ); - #endif + HB_TRACE(("Memvar item (%i)(%s) referenced", pDyn->hMemvar, pMemvarSymb->szName)); + if( pDyn->hMemvar ) { /* value is already created */ diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index d374a88b8a..fc526b2959 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -1124,12 +1124,10 @@ HARBOUR HB_DEFPATH( void ) } buffer[ size ] = '\0'; size = strlen( buffer ); -/* - Debug code: -printf( "\nHB_DEFPATH: buffer is '%s', size is %d, last char is '%c',", buffer, size, buffer[ size - 1] ); -printf( " OS_PATH_DELIMITER is '%c', and OS_PATH_LIST_SEPARATOR is '%c'.", OS_PATH_DELIMITER, OS_PATH_LIST_SEPARATOR ); -*/ + HB_TRACE(("HB_DEFPATH: buffer is |%s|, size is %d, last char is |%c|", buffer, size, buffer[ size - 1])); + HB_TRACE(("HB_DEFPATH: OS_PATH_DELIMITER is |%c| and OS_PATH_LIST_SEPARATOR is |%c|", OS_PATH_DELIMITER, OS_PATH_LIST_SEPARATOR)); + /* If the path is not empty and it doesn't end with a drive or path delimiter, then add the appropriate separator. Use ':' if the size of the path is 1 and the list separator is not ':', otherwise use diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 0019781bba..031033d4ca 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -223,25 +223,12 @@ static LONG s_lRecoverBase = 0; */ static USHORT s_uiActionRequest = 0; -/* uncomment it to trace the virtual machine activity */ -/* #define bHB_DEBUG */ - -#if defined(bHB_DEBUG) -#define HB_DEBUG( x ) printf( x ) -#define HB_DEBUG2( x, y ) printf( x, y ) -#else -#define HB_DEBUG( x ) -#define HB_DEBUG2( x, y ) -#endif - /* application entry point */ void hb_vmInit( void ) { HB_TRACE(("hb_vmInit()")); - HB_DEBUG( "hb_vmInit\n" ); - /* initialize internal data structures */ s_aStatics.type = IT_NIL; hb_stack.Return.type = IT_NIL; @@ -355,8 +342,6 @@ void hb_vmQuit( void ) /* hb_dynsymLog(); */ hb_xexit(); - HB_DEBUG( "Done!\n" ); - exit( s_byErrorLevel ); } @@ -370,8 +355,6 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) HB_TRACE(("hb_vmExecute(%p, %p)", pCode, pSymbols)); - HB_DEBUG( "hb_vmExecute\n" ); - ulPrivateBase = hb_memvarGetPrivatesBase(); while( ( bCode = pCode[ w ] ) != HB_P_ENDPROC ) { @@ -556,7 +539,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) case HB_P_PARAMETER: uiParams = pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ); hb_memvarNewParameter( pSymbols + uiParams, hb_stack.pBase + 1 + pCode[ w + 3 ] ); - HB_DEBUG( "(hb_vmPopParameter)\n" ); + HB_TRACE(("(hb_vmPopParameter)")); w += 4; break; @@ -596,7 +579,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) case HB_P_ENDBLOCK: hb_vmEndBlock(); - HB_DEBUG( "EndBlock\n" ); + HB_TRACE(("(EndBlock)")); return; /* end of a codeblock - stop evaluation */ /* BEGIN SEQUENCE/RECOVER/END SEQUENCE */ @@ -750,7 +733,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) case HB_P_PUSHNIL: hb_stack.pPos->type = IT_NIL; hb_stackPush(); - HB_DEBUG( "(hb_vmPushNil)\n" ); + HB_TRACE(("(hb_vmPushNil)")); w++; break; @@ -816,7 +799,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) uiParams = pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ); hb_rddGetFieldValue( hb_stack.pPos, pSymbols + uiParams ); hb_stackPush(); - HB_DEBUG( "hb_vmPushField\n" ); + HB_TRACE(("(hb_vmPushField)")); w += 3; break; @@ -844,7 +827,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) uiParams = pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ); hb_memvarGetValue( hb_stack.pPos, pSymbols + uiParams ); hb_stackPush(); - HB_DEBUG( "(hb_vmPushMemvar)\n" ); + HB_TRACE(("(hb_vmPushMemvar)")); w += 3; break; @@ -852,7 +835,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) uiParams = pCode[ w + 1 ] + ( pCode[ w + 2 ] * 256 ); hb_memvarGetRefer( hb_stack.pPos, pSymbols + uiParams ); hb_stackPush(); - HB_DEBUG( "(hb_vmPushMemvarRef)\n" ); + HB_TRACE(("(hb_vmPushMemvarRef)")); w += 3; break; @@ -889,7 +872,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) } } while( uiAction == E_RETRY ); - HB_DEBUG( "(hb_vmPushVariable)\n" ); + HB_TRACE(("(hb_vmPushVariable)")); w += 3; } break; @@ -930,7 +913,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) hb_stackDec(); hb_rddPutFieldValue( hb_stack.pPos, pSymbols + uiParams ); hb_itemClear( hb_stack.pPos ); - HB_DEBUG( "hb_vmPopField\n" ); + HB_TRACE(("(hb_vmPopField)")); w += 3; break; @@ -949,7 +932,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) hb_stackDec(); hb_memvarSetValue( pSymbols + uiParams, hb_stack.pPos ); hb_itemClear( hb_stack.pPos ); - HB_DEBUG( "(hb_vmPopMemvar)\n" ); + HB_TRACE(("(hb_vmPopMemvar)")); w += 3; break; @@ -967,7 +950,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) if( hb_rddFieldPut( hb_stack.pPos, pSymbols + uiParams ) == FAILURE ) hb_memvarSetValue( pSymbols + uiParams, hb_stack.pPos ); hb_itemClear( hb_stack.pPos ); - HB_DEBUG( "(hb_vmPopVariable)\n" ); + HB_TRACE(("(hb_vmPopVariable)")); w += 3; break; @@ -1128,8 +1111,6 @@ static void hb_vmPlus( void ) hb_itemRelease( pResult ); } } - - HB_DEBUG( "Plus\n" ); } static void hb_vmMinus( void ) @@ -1911,8 +1892,6 @@ static void hb_vmAnd( void ) HB_TRACE(("hb_vmAnd()")); - HB_DEBUG( "And\n" ); - pItem2 = hb_stack.pPos - 1; pItem1 = hb_stack.pPos - 2; if( IS_LOGICAL( pItem1 ) && IS_LOGICAL( pItem2 ) ) @@ -2154,7 +2133,7 @@ static void hb_vmArrayNew( HB_ITEM_PTR pArray, USHORT uiDimension ) void hb_vmMessage( PHB_SYMB pSymMsg ) /* sends a message to an object */ { - HB_TRACE(("hb_vmMessage(%p)", pSymMsg)); + HB_TRACE(("hb_vmMessage(%p, %s)", pSymMsg, pSymMsg->szName)); hb_itemCopy( hb_stack.pPos, hb_stack.pPos - 1 ); /* moves the object forward */ hb_itemClear( hb_stack.pPos - 1 ); @@ -2162,8 +2141,6 @@ void hb_vmMessage( PHB_SYMB pSymMsg ) /* sends a message to an object */ ( hb_stack.pPos - 1 )->item.asSymbol.value = pSymMsg; ( hb_stack.pPos - 1 )->item.asSymbol.stackbase = ( hb_stack.pPos - 1 ) - hb_stack.pItems; hb_stackPush(); - - HB_DEBUG2( "Message: %s\n", pSymMsg->szName ); } static void hb_vmOperatorCall( PHB_ITEM pObjItem, PHB_ITEM pMsgItem, char * szSymbol ) @@ -2305,8 +2282,6 @@ static void hb_vmSwapAlias( void ) memcpy( pWorkArea, pItem, sizeof( HB_ITEM ) ); pItem->type = IT_NIL; hb_stackDec(); - - HB_DEBUG( "hb_vmSwapAlias\n" ); } /* ------------------------------- */ @@ -2357,8 +2332,6 @@ void hb_vmDo( USHORT uiParams ) hb_stack.pBase = hb_stack.pItems + pItem->item.asSymbol.stackbase; pItem->item.asSymbol.stackbase = wStackBase; - HB_DEBUG2( "Do with %i params\n", uiParams ); - if( ! IS_NIL( pSelf ) ) /* are we sending a message ? */ { if( pSym == &( hb_symEval ) && IS_BLOCK( pSelf ) ) @@ -2449,8 +2422,6 @@ static HARBOUR hb_vmDoBlock( void ) /* restore stack pointers */ hb_stack.pBase = hb_stack.pItems + uiStackBase; hb_stack.pBase->item.asSymbol.lineno = uiLine; - - HB_DEBUG( "End of DoBlock\n" ); } void hb_vmFunction( USHORT uiParams ) @@ -2498,8 +2469,6 @@ static void hb_vmFrame( BYTE bLocals, BYTE bParams ) for( i = 0; i < ( iTotal - hb_stack.pBase->item.asSymbol.paramcnt ); i++ ) hb_vmPushNil(); } - - HB_DEBUG( "Frame\n" ); } static void hb_vmSFrame( PHB_SYMB pSym ) /* sets the statics frame for a function */ @@ -2508,7 +2477,6 @@ static void hb_vmSFrame( PHB_SYMB pSym ) /* sets the statics frame for a fu /* _INITSTATICS is now the statics frame. Statics() changed it! */ hb_stack.iStatics = ( int ) pSym->pFunPtr; /* pSym is { "$_INITSTATICS", FS_INIT | FS_EXIT, _INITSTATICS } for each PRG */ - HB_DEBUG( "SFrame\n" ); } static void hb_vmStatics( PHB_SYMB pSym, USHORT uiStatics ) /* initializes the global aStatics array or redimensionates it */ @@ -2525,8 +2493,6 @@ static void hb_vmStatics( PHB_SYMB pSym, USHORT uiStatics ) /* initializes the g pSym->pFunPtr = ( PHB_FUNC ) hb_arrayLen( &s_aStatics ); hb_arraySize( &s_aStatics, hb_arrayLen( &s_aStatics ) + uiStatics ); } - - HB_DEBUG2( "Statics %li\n", hb_arrayLen( &s_aStatics ) ); } static void hb_vmEndBlock( void ) @@ -2536,7 +2502,6 @@ static void hb_vmEndBlock( void ) hb_stackDec(); /* make the last item visible */ hb_itemCopy( &hb_stack.Return, hb_stack.pPos ); /* copy it */ hb_itemClear( hb_stack.pPos ); /* and now clear it */ - HB_DEBUG( "EndBlock\n" ); } static void hb_vmRetValue( void ) @@ -2546,8 +2511,6 @@ static void hb_vmRetValue( void ) hb_stackDec(); /* make the last item visible */ hb_itemCopy( &hb_stack.Return, hb_stack.pPos ); /* copy it */ hb_itemClear( hb_stack.pPos ); /* now clear it */ - - HB_DEBUG( "hb_vmRetValue\n" ); } static void hb_vmDebuggerEndProc( void ) @@ -2590,8 +2553,6 @@ void hb_vmPush( PHB_ITEM pItem ) hb_itemCopy( hb_stack.pPos, pItem ); hb_stackPush(); - - HB_DEBUG( "hb_vmPush\n" ); } void hb_vmPushNil( void ) @@ -2600,8 +2561,6 @@ void hb_vmPushNil( void ) hb_stack.pPos->type = IT_NIL; hb_stackPush(); - - HB_DEBUG( "hb_vmPushNil\n" ); } void hb_vmPushLogical( BOOL bValue ) @@ -2611,8 +2570,6 @@ void hb_vmPushLogical( BOOL bValue ) hb_stack.pPos->type = IT_LOGICAL; hb_stack.pPos->item.asLogical.value = bValue; hb_stackPush(); - - HB_DEBUG( "hb_vmPushLogical\n" ); } void hb_vmPushNumber( double dNumber, int iDec ) @@ -2640,8 +2597,6 @@ void hb_vmPushInteger( int iNumber ) hb_stack.pPos->item.asInteger.value = iNumber; hb_stack.pPos->item.asInteger.length = 10; hb_stackPush(); - - HB_DEBUG( "hb_vmPushInteger\n" ); } void hb_vmPushLong( long lNumber ) @@ -2652,8 +2607,6 @@ void hb_vmPushLong( long lNumber ) hb_stack.pPos->item.asLong.value = lNumber; hb_stack.pPos->item.asLong.length = 10; hb_stackPush(); - - HB_DEBUG( "hb_vmPushLong\n" ); } void hb_vmPushDouble( double dNumber, int iDec ) @@ -2665,8 +2618,6 @@ void hb_vmPushDouble( double dNumber, int iDec ) hb_stack.pPos->item.asDouble.length = ( dNumber > 10000000000.0 ) ? 20 : 10; hb_stack.pPos->item.asDouble.decimal = ( iDec > 9 ) ? 9 : iDec; hb_stackPush(); - - HB_DEBUG( "hb_vmPushDouble\n" ); } void hb_vmPushDate( LONG lDate ) @@ -2676,8 +2627,6 @@ void hb_vmPushDate( LONG lDate ) hb_stack.pPos->type = IT_DATE; hb_stack.pPos->item.asDate.value = lDate; hb_stackPush(); - - HB_DEBUG( "hb_vmPushDate\n" ); } void hb_vmPushString( char * szText, ULONG length ) @@ -2694,8 +2643,6 @@ void hb_vmPushString( char * szText, ULONG length ) hb_stack.pPos->item.asString.length = length; hb_stack.pPos->item.asString.value = szTemp; hb_stackPush(); - - HB_DEBUG( "hb_vmPushString\n" ); } void hb_vmPushSymbol( PHB_SYMB pSym ) @@ -2706,8 +2653,6 @@ void hb_vmPushSymbol( PHB_SYMB pSym ) hb_stack.pPos->item.asSymbol.value = pSym; hb_stack.pPos->item.asSymbol.stackbase = hb_stack.pPos - hb_stack.pItems; hb_stackPush(); - - HB_DEBUG2( "hb_vmPushSymbol: %s\n", pSym->szName ); } /* +0 -> HB_P_PUSHBLOCK @@ -2741,8 +2686,6 @@ static void hb_vmPushBlock( BYTE * pCode, PHB_SYMB pSymbols ) */ hb_stack.pPos->item.asBlock.lineno = hb_stack.pBase->item.asSymbol.lineno; hb_stackPush(); - - HB_DEBUG( "hb_vmPushBlock\n" ); } /* pushes current workarea number on the eval stack @@ -2755,8 +2698,6 @@ static void hb_vmPushAlias( void ) hb_stack.pPos->item.asInteger.value = hb_rddGetCurrentWorkAreaNumber(); hb_stack.pPos->item.asInteger.length = 10; hb_stackPush(); - - HB_DEBUG( "hb_vmPushAlias\n" ); } /* It pops the last item from the stack to use it to select a workarea @@ -2779,8 +2720,6 @@ static void hb_vmPushAliasedField( PHB_SYMB pSym ) hb_rddGetFieldValue( pAlias, pSym ); hb_rddSelectWorkAreaNumber( iCurrArea ); - - HB_DEBUG( "hb_vmPushAliasedField\n" ); } static void hb_vmPushLocal( SHORT iLocal ) @@ -2805,8 +2744,6 @@ static void hb_vmPushLocal( SHORT iLocal ) hb_itemCopy( hb_stack.pPos, hb_codeblockGetVar( hb_stack.pBase + 1, ( LONG ) iLocal ) ); hb_stackPush(); - - HB_DEBUG2( "hb_vmPushLocal %i\n", iLocal ); } static void hb_vmPushLocalByRef( SHORT iLocal ) @@ -2819,8 +2756,6 @@ static void hb_vmPushLocalByRef( SHORT iLocal ) hb_stack.pPos->item.asRefer.offset = hb_stack.pBase - hb_stack.pItems +1; hb_stack.pPos->item.asRefer.itemsbase = &hb_stack.pItems; hb_stackPush(); - - HB_DEBUG2( "hb_vmPushLocalByRef %i\n", iLocal ); } static void hb_vmPushStatic( USHORT uiStatic ) @@ -2835,8 +2770,6 @@ static void hb_vmPushStatic( USHORT uiStatic ) else hb_itemCopy( hb_stack.pPos, pStatic ); hb_stackPush(); - - HB_DEBUG2( "hb_vmPushStatic %i\n", uiStatic ); } static void hb_vmPushStaticByRef( USHORT uiStatic ) @@ -2849,8 +2782,6 @@ static void hb_vmPushStaticByRef( USHORT uiStatic ) hb_stack.pPos->item.asRefer.offset = hb_stack.iStatics; hb_stack.pPos->item.asRefer.itemsbase = &s_aStatics.item.asArray.value->pItems; hb_stackPush(); - - HB_DEBUG2( "hb_vmPushStaticByRef %i\n", uiStatic ); } static void hb_vmDuplicate( void ) @@ -2879,8 +2810,6 @@ static BOOL hb_vmPopLogical( void ) { HB_TRACE(("hb_vmPopLogical()")); - HB_DEBUG( "hb_vmPopLogical\n" ); - if( IS_LOGICAL( hb_stack.pPos - 1 ) ) { hb_stackDec(); @@ -2901,8 +2830,6 @@ static long hb_vmPopDate( void ) { HB_TRACE(("hb_vmPopDate()")); - HB_DEBUG( "hb_vmPopDate\n" ); - hb_stackDec(); hb_stack.pPos->type = IT_NIL; @@ -2942,8 +2869,6 @@ static double hb_vmPopNumber( void ) hb_stack.pPos->type = IT_NIL; - HB_DEBUG( "hb_vmPopNumber\n" ); - return dNumber; } @@ -2981,8 +2906,6 @@ static double hb_vmPopDouble( int * piDec ) hb_stack.pPos->type = IT_NIL; - HB_DEBUG( "hb_vmPopDouble\n" ); - return dNumber; } @@ -2995,8 +2918,6 @@ static void hb_vmPopAlias( void ) hb_stackDec(); hb_vmSelectWorkarea( hb_stack.pPos ); - - HB_DEBUG( "hb_vmPopAlias\n" ); } /* Pops the alias to use it to select a workarea and next pops a value @@ -3015,8 +2936,6 @@ static void hb_vmPopAliasedField( PHB_SYMB pSym ) hb_rddSelectWorkAreaNumber( iCurrArea ); hb_stackDec(); /* alias - it was cleared in hb_vmSelectWorkarea */ hb_stackPop(); /* field value */ - - HB_DEBUG( "hb_vmPopAliasedField\n" ); } static void hb_vmPopLocal( SHORT iLocal ) @@ -3042,8 +2961,6 @@ static void hb_vmPopLocal( SHORT iLocal ) hb_itemCopy( hb_codeblockGetVar( hb_stack.pBase + 1, iLocal ), hb_stack.pPos ); hb_itemClear( hb_stack.pPos ); - - HB_DEBUG( "hb_vmPopLocal\n" ); } static void hb_vmPopStatic( USHORT uiStatic ) @@ -3061,8 +2978,6 @@ static void hb_vmPopStatic( USHORT uiStatic ) hb_itemCopy( pStatic, hb_stack.pPos ); hb_itemClear( hb_stack.pPos ); - - HB_DEBUG( "hb_vmPopStatic\n" ); } /* ------------------------------- */ @@ -3093,7 +3008,6 @@ static void hb_stackFree( void ) HB_TRACE(("hb_stackFree()")); hb_xfree( hb_stack.pItems ); - HB_DEBUG( "hb_stackFree\n" ); } static void hb_stackPush( void ) @@ -3138,7 +3052,6 @@ static void hb_stackInit( void ) hb_stack.pBase = hb_stack.pItems; hb_stack.pPos = hb_stack.pItems; /* points to the first stack item */ hb_stack.wItems = STACK_INITHB_ITEMS; - HB_DEBUG( "hb_stackInit\n" ); } /* NOTE: DEBUG function */