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

@@ -45,7 +45,6 @@
*/
#include "hbcomp.h"
#include "hbmacro.ch"
#if ! defined( HB_HASH_USES_ARRAY_INDEXES )
# define HB_HASH_USES_ARRAY_INDEXES
@@ -174,7 +173,7 @@ const PHB_EXPR_FUNC hb_comp_ExprTable[ HB_EXPR_COUNT ] = {
hb_compExprUseVariable,
hb_compExprUsePostInc, /* post-operators -> lowest precedence */
hb_compExprUsePostDec,
hb_compExprUseAssign, /* assigments */
hb_compExprUseAssign, /* assignments */
hb_compExprUsePlusEq,
hb_compExprUseMinusEq,
hb_compExprUseMultEq,
@@ -1202,7 +1201,7 @@ static HB_EXPR_FUNC( hb_compExprUseArgList )
}
/* NOTE: In PUSH operation it leaves all expressions on the eval stack,
* the expresions are divided into macro compiled blocks
* the expressions are divided into macro compiled blocks
*/
static HB_EXPR_FUNC( hb_compExprUseMacroArgList )
{
@@ -1342,10 +1341,10 @@ static HB_EXPR_FUNC( hb_compExprUseArrayAt )
*/
PHB_EXPR pNew = HB_COMP_EXPR_NEW( HB_ET_NONE );
memcpy( pNew, pExpr, sizeof( HB_EXPR ) );
/* This will suppres releasing of memory occupied by components of
/* This will suppress releasing of memory occupied by components of
* the expression - we have just copied them into the new expression.
* This method is simpler then traversing the list and releasing all
* but this choosen one.
* but this chosen one.
*/
pExpr->ExprType = HB_ET_NONE;
/* Here comes the magic */
@@ -1602,7 +1601,7 @@ static HB_EXPR_FUNC( hb_compExprUseMacro )
{
/* complex macro expression: prefix&var.suffix
* all components should be placed as a string that will
* be compiled after text susbstitution
* be compiled after text substitution
*/
/* Check if macrotext variable does not refer to
@@ -1694,7 +1693,7 @@ static HB_EXPR_FUNC( hb_compExprUseMacro )
{
/* complex macro expression: prefix&var.suffix
* all components should be placed as a string that will
* be compiled after text susbstitution
* be compiled after text substitution
*/
/* Check if macrotext variable does not refer to
@@ -2358,7 +2357,7 @@ static HB_EXPR_FUNC( hb_compExprUseAliasVar )
return pSelf;
}
/* handler for expression->( exression, ... ) syntax
/* handler for expression->( expression, ... ) syntax
*/
static HB_EXPR_FUNC( hb_compExprUseAliasExpr )
{
@@ -2396,7 +2395,7 @@ static HB_EXPR_FUNC( hb_compExprUseAliasExpr )
HB_EXPR_USE( pSelf->value.asAlias.pExpList, HB_EA_PUSH_PCODE );
/* swap the two last items on the eval stack: one item is a
* value returned by evaluated expression and the second item
* is previously selected workarea. After swaping select again
* is previously selected workarea. After swapping select again
* the restored workarea.
*/
HB_GEN_FUNC1( PCode1, HB_P_SWAPALIAS );
@@ -2535,7 +2534,7 @@ static HB_EXPR_FUNC( hb_compExprUseVariable )
* operator only (if 'any_expr' is not a string) - an alias value
* is placed on the eval stack before macro compilation.
* The HB_MACRO_GEN_ALIASED flag is used to signal that we have to
* genearate alias aware pcode even if we known a variable part only.
* generate alias aware pcode even if we known a variable part only.
*/
if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_ALIASED )
HB_GEN_FUNC4( PushAliasedVar, pSelf->value.asSymbol.name, HB_FALSE, NULL, 0 );
@@ -2713,7 +2712,7 @@ static HB_EXPR_FUNC( hb_compExprUseSend )
}
else
{
/* acces to instance variable */
/* access to instance variable */
hb_compExprPushSendPush( pSelf, HB_COMP_PARAM );
HB_GEN_FUNC2( PCode2, HB_P_SENDSHORT, 0 );
}
@@ -2910,7 +2909,7 @@ static HB_EXPR_FUNC( hb_compExprUseAssign )
break;
case HB_EA_PUSH_PCODE:
/* NOTE: assigment to an object instance variable needs special handling
/* NOTE: assignment to an object instance variable needs special handling
*/
if( pSelf->value.asOperator.pLeft->ExprType == HB_ET_SEND )
{
@@ -4551,11 +4550,11 @@ static HB_BOOL hb_compExprCodeblockPush( PHB_EXPR pSelf, int iEarlyEvalPass, HB_
pExpr->pNext = pNext; /* restore the link to next expression */
}
/* Generate push/pop pcodes for all expresions except the last one
/* Generate push/pop pcodes for all expressions except the last one
* The value of the last expression is used as a return value
* of a codeblock evaluation
*/
/* NOTE: This will genereate warnings if constant value is
/* NOTE: This will generate warnings if constant value is
* used as an expression - some operators will generate it too
* e.g.
* Eval( {|| 3+5, func()} )
@@ -4624,7 +4623,7 @@ static void hb_compExprCodeblockEarly( PHB_EXPR pSelf, HB_COMP_DECL )
}
else
{
/* generate code to check if macroexpression refers to local, static
/* generate code to check if macro-expression refers to local, static
* or field variables and generate error in such case or disable
* iEarlyEvalPass when -kd (MACRODECL) switch is used.
* In the 2nd case hb_compExprCodeblockPush() returns true and generated
@@ -4741,7 +4740,7 @@ static void hb_compExprPushSendPopPush( PHB_EXPR pObj, PHB_EXPR pValue,
/* Push message */
if( pObj->value.asMessage.szMessage )
{
/* HB_TRUE used intnetionally to not push object variable in WITH OBJECT */
/* HB_TRUE used intentionally not to push object variable in WITH OBJECT */
HB_GEN_FUNC2( Message, pObj->value.asMessage.szMessage, HB_TRUE );
}
else
@@ -5476,7 +5475,7 @@ static PHB_EXPR hb_compExprReduceList( PHB_EXPR pList, HB_COMP_DECL )
{
PHB_EXPR * pExpr;
/* NOTE: During optimalization an expression on the list can be
/* NOTE: During optimization an expression on the list can be
* replaced by the new one
*/