2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com)

* *
    * partial sync with the 3.4 fork codebase. These are the things
      synces for the most part:
      - copyright headers
      - grammar/typos in comments and some readmes
      - comment/whitespace/decorations
      - variable scoping in C files
      - DO CASE/SWITCH and some other alternate syntax usage
      - minimal amount of human readable text in strings
      - minor code updates
      - HB_TRACE() void * casts for pointers and few other changes to
        avoid C compiler warnings
      - various other, minor code cleanups
      - only Harbour/C code/headers were touched in src, utils, contrib,
        include. No 3rd party code, no make files, and with just a few
        exceptions, no 'tests' code was touched.
      - certain components were not touched were 3.4 diverged too much
        already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
      - the goal was that no actual program logic should be altered by
        these changes. Except some possible minor exceptions, any such
        change is probably a bug in this patch.
      It's a massive patch, if you find anything broken after it, please
      open an Issue with the details. Build test was done on macOS.
      The goal is make it easier to see what actual code/logic was changed
      in 3.4 compared to 3.2 and to make patches easier to apply in both
      ways.
This commit is contained in:
Viktor Szakats
2017-09-08 16:25:13 +00:00
parent d55bdd18b7
commit 5a2a287752
916 changed files with 10432 additions and 13266 deletions

View File

@@ -47,7 +47,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
/* HBDbBrowser

View File

@@ -551,7 +551,7 @@ void hb_dbgEntry( int nMode, int nLine, const char * szName, int nIndex, PHB_ITE
return;
case HB_DBG_STATICNAME:
HB_TRACE( HB_TR_DEBUG, ( "STATICNAME %s index %d frame %p", szName, nIndex, pFrame ) );
HB_TRACE( HB_TR_DEBUG, ( "STATICNAME %s index %d frame %p", szName, nIndex, ( void * ) pFrame ) );
hb_dbgAddStatic( info, szName, nIndex, pFrame );
return;
@@ -611,7 +611,6 @@ void hb_dbgEntry( int nMode, int nLine, const char * szName, int nIndex, PHB_ITE
hb_xfree( info->szToCursorModule );
}
}
/* Check if we must skip every level above info->nTraceLevel */
else if( info->bTraceOver )
{
@@ -633,7 +632,7 @@ void hb_dbgEntry( int nMode, int nLine, const char * szName, int nIndex, PHB_ITE
return;
}
/* Check if'we skipping to the end of current routine */
/* Check if we're skipping to the end of current routine */
if( info->bNextRoutine )
return;

View File

@@ -6,11 +6,6 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version, with one exception:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
@@ -146,7 +141,7 @@ STATIC PROCEDURE ProcessKey( nKey, oDlg, oBrw, aTopics )
CASE K_PGUP
CASE K_CTRL_B
ShowTopic( oDlg, aTopics, oBrw:Cargo, -1 ) // Skip to prev page
ShowTopic( oDlg, aTopics, oBrw:Cargo, -1 ) // Skip to previous page
EXIT
CASE K_PGDN
@@ -216,7 +211,7 @@ STATIC PROCEDURE ShowTopic( oDlg, aTopics, nTopic, nPageOp )
ENDIF
EXIT
CASE -1 // Show prev page
CASE -1 // Show previous page
IF oDebug:nHelpPage > 1
oDebug:nHelpPage--
@@ -245,7 +240,7 @@ STATIC FUNCTION GetTopics()
LOCAL aTopics := {}
LOCAL cLine
FOR EACH cLine IN hb_ATokens( help_en(), Chr( 10 ) )
FOR EACH cLine IN hb_ATokens( help_en(), .T. )
IF hb_LeftEq( cLine, "--" )
AAdd( aTopics, { PadR( SubStr( cLine, Len( "--" ) + 1 ), 12 ), {} } )
ELSEIF ! Empty( aTopics ) .AND. ;

View File

@@ -50,8 +50,8 @@
#xcommand MENUITEM [ <oMenuItem> PROMPT ] <cPrompt> ;
[ IDENT <nIdent> ] [ ACTION <uAction,...> ] ;
[ CHECKED <bChecked> ] => ;
[ <oMenuItem> := ] HBDbMenu():AddItem( HBDbMenuItem():New( <cPrompt>,;
[{||<uAction>}], [<bChecked>], [<nIdent>] ) )
[ <oMenuItem> := ] HBDbMenu():AddItem( HBDbMenuItem():New( <cPrompt>, ;
[{|| <uAction> }], [<bChecked>], [<nIdent>] ) )
#xcommand SEPARATOR => HBDbMenu():AddItem( HBDbMenuItem():New( "-" ) )
#xcommand ENDMENU => ATail( HBDbMenu():aMenus ):Build()

View File

@@ -46,7 +46,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "inkey.ch"
@@ -105,7 +105,7 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbArray
oBrwSets := HBDbBrowser():New( oWndSets:nTop + 1, oWndSets:nLeft + 1, oWndSets:nBottom - 1, oWndSets:nRight - 1 )
oBrwSets:ColorSpec := __dbg():ClrModal()
oBrwSets:Cargo := { 1, {} } // Actual highligthed row
oBrwSets:Cargo := { 1, {} } // Actual highlighted row
AAdd( oBrwSets:Cargo[ 2 ], aArray )
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| ::arrayName + "[" + hb_ntos( oBrwSets:cargo[ 1 ] ) + "]" } ) )
@@ -146,7 +146,7 @@ METHOD PROCEDURE doGet( oBrowse, pItem, nSet ) CLASS HBDbArray
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1, ;
oBrowse:getColumn( 2 ):Width, @cValue, ;
__dbgExprValidBlock(), __dbgColors()[ 2 ], 256 )
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
pItem[ nSet ] := &cValue
RECOVER USING oErr
__dbgAlert( oErr:description )

View File

@@ -46,7 +46,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "inkey.ch"
@@ -105,7 +105,7 @@ METHOD addWindows( hHash, nRow ) CLASS HBDbHash
oBrwSets := HBDbBrowser():New( oWndSets:nTop + 1, oWndSets:nLeft + 1, oWndSets:nBottom - 1, oWndSets:nRight - 1 )
oBrwSets:ColorSpec := __dbg():ClrModal()
oBrwSets:Cargo := { 1, {} } // Actual highligthed row
oBrwSets:Cargo := { 1, {} } // Actual highlighted row
AAdd( oBrwSets:Cargo[ 2 ], hHash )
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| ::hashName + "[" + HashKeyString( hHash, oBrwSets:cargo[ 1 ] ) + "]" } ) )
@@ -150,7 +150,7 @@ METHOD PROCEDURE doGet( oBrowse, pItem, nSet ) CLASS HBDbHash
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1, ;
oBrowse:getColumn( 2 ):Width, @cValue, ;
__dbgExprValidBlock(), __dbgColors()[ 2 ], 256 )
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
hb_HValueAt( pItem, nSet, &cValue )
RECOVER USING oErr
__dbgAlert( oErr:description )

View File

@@ -46,7 +46,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "inkey.ch"
@@ -54,7 +54,7 @@
#include "setcurs.ch"
CREATE CLASS HbDbInput
CREATE CLASS HBDbInput
HIDDEN:
@@ -80,7 +80,7 @@ CREATE CLASS HbDbInput
ENDCLASS
METHOD new( nRow, nCol, nWidth, cValue, cColor, nSize ) CLASS HbDbInput
METHOD new( nRow, nCol, nWidth, cValue, cColor, nSize ) CLASS HBDbInput
::nRow := nRow
::nCol := nCol
@@ -92,7 +92,7 @@ METHOD new( nRow, nCol, nWidth, cValue, cColor, nSize ) CLASS HbDbInput
RETURN Self
METHOD SetColor( cColor ) CLASS HbDbInput
METHOD SetColor( cColor ) CLASS HBDbInput
::acColor := { hb_ColorIndex( cColor, CLR_STANDARD ), ;
hb_ColorIndex( cColor, CLR_ENHANCED ) }
@@ -102,24 +102,24 @@ METHOD SetColor( cColor ) CLASS HbDbInput
RETURN Self
METHOD newPos( nRow, nCol ) CLASS HbDbInput
METHOD newPos( nRow, nCol ) CLASS HBDbInput
::nRow := nRow
::nCol := nCol
RETURN Self
METHOD getValue() CLASS HbDbInput
METHOD getValue() CLASS HBDbInput
RETURN ::cValue
METHOD setValue( cValue ) CLASS HbDbInput
METHOD setValue( cValue ) CLASS HBDbInput
::cValue := PadR( cValue, ::nSize )
::nPos := Min( ::nSize, Len( RTrim( ::cValue ) ) + 1 )
RETURN Self
METHOD display() CLASS HbDbInput
METHOD display() CLASS HBDbInput
IF ::nPos < ::nFirst
::nFirst := ::nPos
@@ -131,14 +131,14 @@ METHOD display() CLASS HbDbInput
RETURN Self
METHOD showCursor() CLASS HbDbInput
METHOD showCursor() CLASS HBDbInput
SetPos( ::nRow, ::nCol + ::nPos - ::nFirst )
SetCursor( iif( Set( _SET_INSERT ), SC_INSERT, SC_NORMAL ) )
RETURN Self
METHOD applyKey( nKey ) CLASS HbDbInput
METHOD applyKey( nKey ) CLASS HBDbInput
LOCAL lUpdate := .T.

View File

@@ -50,7 +50,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "hbmemvar.ch"

View File

@@ -50,7 +50,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
CREATE CLASS HBDbMenuItem

View File

@@ -46,13 +46,13 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "inkey.ch"
#include "setcurs.ch"
/* object message descirption */
/* object message description */
#define OMSG_NAME 1
#define OMSG_VALUE 2
#define OMSG_EDIT 3
@@ -186,7 +186,7 @@ METHOD PROCEDURE doGet( oBrowse ) CLASS HBDbObject
IF __dbgInput( Row(), oBrowse:nLeft + oBrowse:GetColumn( 1 ):width + 1, ;
oBrowse:getColumn( oBrowse:colPos ):Width, @cValue, ;
__dbgExprValidBlock(), __dbgColors()[ 2 ], 256 )
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
__dbgObjSetValue( ::TheObj, aItemRef[ OMSG_NAME ], &cValue )
RECOVER USING oErr
__dbgAlert( oErr:description )
@@ -273,7 +273,7 @@ STATIC FUNCTION __dbgObjGetValue( oObject, cVar, lCanAcc )
xResult := __dbgSendMsg( nProcLevel, oObject, cVar )
lCanAcc := .T.
RECOVER
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
/* Try to access variables using class code level */
xResult := __dbgSendMsg( 0, oObject, cVar )
lCanAcc := .T.
@@ -293,7 +293,7 @@ STATIC FUNCTION __dbgObjSetValue( oObject, cVar, xValue )
BEGIN SEQUENCE WITH {|| Break() }
__dbgSendMsg( nProcLevel, oObject, "_" + cVar, xValue )
RECOVER
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
/* Try to access variables using class code level */
__dbgSendMsg( 0, oObject, "_" + cVar, xValue )
RECOVER USING oErr

View File

@@ -51,7 +51,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "hbmemvar.ch"

View File

@@ -72,7 +72,7 @@ PROCEDURE __dbgShowWorkAreas()
LOCAL nOldArea := Select()
hb_WAEval( {|| AAdd( aAlias, { select(), Alias() } ) } )
hb_WAEval( {|| AAdd( aAlias, { Select(), Alias() } ) } )
IF Len( aAlias ) == 0
__dbgAlert( "No workareas in use" )
@@ -131,7 +131,7 @@ PROCEDURE __dbgShowWorkAreas()
oCol:ColorBlock := {|| iif( aAlias[ n1 ][ 1 ] == Select() .AND. n2 == 1, { 3, 4 }, { 1, 2 } ) }
/* Struc browse */
/* Structure browser */
aStruc := ( aAlias[ n1 ][ 1 ] )->( dbStruct() )

View File

@@ -7,11 +7,6 @@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version, with one exception:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
@@ -57,10 +52,10 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
#include "hbdebug.ch" /* for "nMode" of __dbgEntry */
#include "hbdebug.ch" /* for "nMode" of __dbgEntry() */
#include "hbgtinfo.ch"
#include "hbmemvar.ch"
@@ -499,7 +494,7 @@ METHOD PROCEDURE BuildBrowseStack() CLASS HBDebugger
::oBrwStack:Cargo := Min( Max( ::oBrwStack:Cargo, 1 ), ;
Len( ::aProcStack ) ), ::oBrwStack:Cargo - nOld }
::oBrwStack:Cargo := 1 // Actual highligthed row
::oBrwStack:Cargo := 1 // Actual highlighted row
::oBrwStack:AddColumn( HBDbColumnNew( "", {|| iif( Len( ::aProcStack ) > 0, ;
PadC( ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_FUNCTION ], 14 ), Space( 14 ) ) } ) )
@@ -721,7 +716,7 @@ METHOD PROCEDURE Colors() CLASS HBDebugger
RETURN
ENDIF
oBrwColors:Cargo := { 1, {} } // Actual highligthed row
oBrwColors:Cargo := { 1, {} } // Actual highlighted row
oBrwColors:ColorSpec := ::ClrModal()
oBrwColors:goTopBlock := {|| oBrwColors:cargo[ 1 ] := 1 }
oBrwColors:goBottomBlock := {|| oBrwColors:cargo[ 1 ] := Len( oBrwColors:cargo[ 2 ][ 1 ] ) }
@@ -1318,7 +1313,7 @@ METHOD PROCEDURE EditVar( nVar ) CLASS HBDebugger
cVarStr := ::InputBox( cVarName, __dbgValToExp( uVarValue ), __dbgExprValidBlock() )
IF LastKey() != K_ESC
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
::VarSetValue( ::aVars[ nVar ], &cVarStr )
RECOVER USING oErr
__dbgAlert( oErr:description )
@@ -2147,7 +2142,7 @@ METHOD PROCEDURE OSShell() CLASS HBDebugger
QOut( "Type 'exit' to RETURN to the Debugger" )
SetCursor( SC_NORMAL ) // standard cursor for OS shell
BEGIN SEQUENCE WITH {| objErr | Break( objErr ) }
BEGIN SEQUENCE WITH __BreakBlock()
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;
@@ -2412,8 +2407,8 @@ METHOD PROCEDURE SaveAppScreen() CLASS HBDebugger
METHOD PROCEDURE SaveAppState() CLASS HBDebugger
::nAppDirCase := Set( _SET_DIRCASE, 0 )
::nAppFileCase := Set( _SET_FILECASE, 0 )
::nAppDirCase := Set( _SET_DIRCASE, HB_SET_CASE_MIXED )
::nAppFileCase := Set( _SET_FILECASE, HB_SET_CASE_MIXED )
::nAppTypeAhead := Set( _SET_TYPEAHEAD, 16 )
::nAppLastKey := LastKey()
@@ -3065,10 +3060,13 @@ METHOD TracepointAdd( cExpr ) CLASS HBDebugger
RETURN Self
ENDIF
ENDIF
cExpr := AllTrim( cExpr )
IF Empty( cExpr )
RETURN Self
ENDIF
aWatch := { "tp", cExpr, NIL }
::RestoreAppState()
__dbgAddWatch( ::pInfo, cExpr, .T. )
@@ -3217,20 +3215,21 @@ METHOD WatchpointDel( xPos ) CLASS HBDebugger
LOCAL nPos := -1, lAll := .F.
IF ::oWndPnt != NIL .AND. ::oWndPnt:lVisible
IF Empty( xPos )
nPos := ::InputBox( "Enter item number to delete", ::oBrwPnt:cargo[ 1 ] - 1 )
IF LastKey() == K_ESC
nPos := -1
ENDIF
ELSEIF HB_ISSTRING( xPos )
DO CASE
CASE HB_ISSTRING( xPos )
IF Upper( xPos ) == "ALL"
lAll := .T.
ELSEIF IsDigit( xPos )
nPos := Val( xPos )
ENDIF
ELSEIF HB_ISNUMERIC( xPos )
CASE HB_ISNUMERIC( xPos )
nPos := xPos
ENDIF
OTHERWISE
nPos := ::InputBox( "Enter item number to delete", ::oBrwPnt:cargo[ 1 ] - 1 )
IF LastKey() == K_ESC
nPos := -1
ENDIF
ENDCASE
IF lAll .OR. ( nPos >= 0 .AND. nPos < Len( ::aWatch ) )
::oBrwPnt:gotop()
@@ -3577,6 +3576,7 @@ STATIC FUNCTION hb_LeftEqN( cLine, cStart, nMin )
FUNCTION __dbgExprValidBlock( cType )
LOCAL cTypeName
IF HB_ISSTRING( cType )
@@ -3731,7 +3731,7 @@ FUNCTION __dbgRestScreen( ... )
FUNCTION __dbgTextToArray( cString )
RETURN hb_ATokens( StrTran( cString, Chr( 13 ) ), Chr( 10 ) )
RETURN hb_ATokens( cString, .T. )
FUNCTION __dbgValToStr( uVal )

View File

@@ -85,7 +85,7 @@ End In Code window, scrolls hard right.
of line.
In other windows, does nothing.
Esc In Command window, clears command line.
Esc In Command window, clears command-line.
In other windows, does nothing.
-- Other
TAB Next window
@@ -138,7 +138,7 @@ windows:
One debugger window is active at a time. The active window
is displayed with a hilighted border. TAB and SHIFT-TAB
is displayed with a highlighted border. TAB and SHIFT-TAB
navigate among open windows.
The Window menu contains options to Move, Size, Zoom and
@@ -163,7 +163,7 @@ active.
When the Command window is active, the UP and DOWN
arrow keys can be used to recall previous commands.
-- Code
The Code window displays Clipper source code for
The Code window displays Harbour source code for
the program being debugged.
@@ -171,7 +171,7 @@ What file the Code window displays may be controlled
in the following ways:
1. By default, the Code window will contain the line
of Clipper code currently being executed.
of Harbour code currently being executed.
2. If the CallStack window is open, the code being
viewed is that of the selected call in the CallStack
@@ -186,8 +186,8 @@ in the following ways:
command, or selecting the File:View menu option.
If the Code window contains the line of Clipper code
currently being executed, that line will be hilighted.
If the Code window contains the line of Harbour code
currently being executed, that line will be highlighted.
Any lines which have Breakpoints set on them will also
be marked.
@@ -296,11 +296,11 @@ Options:
of the file onward.
Next
Search for the next occurence of the Find string,
Search for the next occurrence of the Find string,
from the cursor line onward.
Prev
Search for the previous occurence of the Find string,
Search for the previous occurrence of the Find string,
from the cursor line backward.
Goto Line...
@@ -362,7 +362,7 @@ Options:
current value of a Watchpoint is displayed in the
Watch window during debugging.
A Watchpoint may be any valid Clipper expression,
A Watchpoint may be any valid Harbour expression,
i.e.:
s // variable
@@ -581,7 +581,7 @@ LIST BP|WP|TP
the Command Window.
NEXT
Search for next occurence of FIND string.
Search for next occurrence of FIND string.
NUM ON|off
Toggle display of line numbers in Code window.
@@ -591,7 +591,7 @@ OUTPUT
PREV
Search for previous occurence of FIND string.
Search for previous occurrence of FIND string.
QUIT
Quit.

View File

@@ -46,7 +46,7 @@
#pragma -b-
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */
#define HB_CLS_NOTOBJECT /* do not inherit from HBObject class */
#include "hbclass.ch"
CREATE CLASS HBBrwText