* contrib/hbwin/tests/testsvc.prg
+ added some lines to test parameter passing
* include/hbdefs.h
* deprecated HB_TCHAR_*() macros with HB_LEGACY_LEVEL4
Everyone pls move on to Str API calls and hbwinuni.h
macros.
* include/hbexpra.c
* include/hbexprb.c
* include/hbwmain.c
* applied uncrustify fixes
* harbour/src/compiler/complex.c
! fixed lexer to correctly recognize ::msg as FOR iterator
* harbour/include/hbexprb.c
! fixed compile time GPF in code like:
QOut( @1-VAR )
* harbour/include/hbexprb.c
! fixed typo in function IDs.
HB_I18N_NGETTEXT_STRICT() and HB_I18N_NGETTEXT_NOOP() were not
recognized as i18n gettext functions
* harbour/doc/cmpopt.txt
! fixed HB_I18N_NGETTEXT_NOOP*() syntax used in examples
* harbour/src/common/expropt2.c
* harbour/doc/cmpopt.txt
+ added compile time optimizations for expressions like
<exp> = <lVal>
<exp> == <lVal>
<exp> != <lVal>
<lVal> = <exp>
<lVal> == <exp>
<lVal> != <exp>
They are reduced to <exp> or !<exp>. Because it may disable
some runtime errors so it's not Clipper compatible optimization
and is enabled when -ko compiler switch is used.
* harbour/src/compiler/hbgenerr.c
! do not generate some warnings like:
Meaningless use of expression '%s'
when -w harbour compiler option is not used
* harbour/src/rtl/gtxwc/gtxwc.c
! indenting
* harbour/include/hbexprb.c
* harbour/include/hbcomp.h
* harbour/include/hbcompdf.h
* harbour/src/compiler/hbusage.c
* harbour/src/compiler/harbour.yyc
* harbour/src/compiler/harbour.y
* harbour/src/compiler/ppcomp.c
* harbour/src/compiler/hbmain.c
* harbour/src/compiler/cmdcheck.c
* harbour/doc/cmpopt.txt
* harbour/doc/xhb-diff.txt
+ added new harbour compiler switch:
-kd => accept macros with declared symbols
This switch allows to use declared symbols like LOCALs, STATICs
and FIELDs in macros and macrocodeblocks (every evaluated).
; Please do not confuse different things. Above modification
does not mean to that such variables are visible for macro
compiler. It only allows to write code like:
cbVar := {|| &cLocal + cPrivate }
or:
cbVar := {|| &cLocalPref.func&cPriv1( cPriv2 ) }
or:
? &cLocalPref.func&cPriv1( cPriv2 )
etc.
If possible then for macrocodeblocks Harbour compiler tries to
generate early eval code in which macros are expanded when codeblock
is created. Otherwise macros are expanded each time codeblocks are
evaluated.
For more information look at harbour/doc/xhb-diff.txt section:
MACROS WITH DECLARED SYMBOLS
* harbour/include/hbexprb.c
! fixed hb_arrayToParams() used in array index context
( var[ hb_arrayToParams() ] ) unintentionally disabled by
2010-11-08 23:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/hvm.c
+ added __vmItemId() function.
* harbour/src/rtl/valtoexp.prg
+ added support for array, object and hash references to hb_valToExp().
Now this function works correctly also for items with cyclic
references.
* include/hbcompdf.h
* include/hbexprop.h
* include/hbexprb.c
* src/common/funcid.c
* src/common/expropt2.c
+ added compile-time optimization for HB_BCHAR()
and HB_BCODE().
* contrib/hbct/hbct.hbp
* contrib/hbct/hbct.hbx
+ contrib/hbct/ctscan.ch
+ contrib/hbct/kxlat.prg
* contrib/hbct/ctdummy.prg
* contrib/hbct/dummy.c
+ added CT compatiblity functions: SETKXLAT(), GETKXLAT(),
SETKXTAB(), GETKXTAB(). Former two replaces existing
dummy implementations. Check CT documentation for syntax.
NOTES: - KS_PAD[0-9] and KS_PAD_DECIMAL are not supported in
Harbour, because they have no corresponding inkey.ch
value.
- Harbour uses HB_GTI_INKEYFILTER to implement these
functions, and due to this, they will gracefully
fail if the application has already set
HB_GTI_INKEYFILTER to a custom value.
+ added:
HBCT_GETKXLAT( <nOrgKey>[, <nNewKey> ] ) -> <lAccepted>
HBCT_GETKXTAB( <nOrgKey> ) -> <nNewKey>
HBCT_SETKXLAT( <hTrs> ) -> <lAccepted>
HBCT_SETKXTAB() -> <hTrs>
Same as above, but they use standard inkey() values.
; USE AT YOUR OWN RISK. NO GUARANTEES.
* contrib/hbct/showtime.prg
* contrib/hbct/screen2.c
* internal fn renamed: _HB_CTDSPTIME() -> __HBCT_DSPTIME()
* harbour/include/hbexprb.c
+ enabled o:var += <cString> optimization when -ko switch is used
I added this optimization few years ago but I haven't enabled it
so far.
+ harbour/tests/speedstr.prg
+ added test code for <exp> += <cString> optimization
Try this code compiled with -kc switch (disabled += optimization)
without any -k? switches (default, += optimized for all expressions
except <obj>:<msg>) and finally with -ko switch (+= optimized for
all expressions)
(Warning for larger string non optimized code begins to be _very_
slow, i.e. for '#define N_LOOP 1000000' it needs fee minutes to
pass single test)
* harbour/include/hbexprb.c
! allow to use variable in parenthesis as lvalue when -kc switch
is used - Clipper compatibility
* harbour/contrib/hbfoxpro/misc.prg
+ __FOX_ARRAY( <dims,...> ) which returns array initialized
with .F. values - it can be used to initialize arrays declared
using FP syntax
* harbour/contrib/hbfoxpro/hbfoxpro.ch
+ added some new PP rules for FP array declarations
+ added DISPLAY FIELDS ... command
! allow to assign to variable in parenthesis in compiler when -kc switch
is used (Clipper compatibility), i.e.:
(var) := 1
Please remember that Clipper does not accept such syntax in
macrocompiler and Harbour replicates this behavior when -kc
compile time switch is used.
* harbour/include/hbcompdf.h
* harbour/include/hbexprb.c
* harbour/src/common/expropt1.c
+ added protection against pushing series of parameters on HVM
stack by hb_arrayToParams() function used in wrong contects,
i.e.:
var := hb_arrayToParams( { 1, 2, 3 } )
Possible TODO: add compile time warning in such case.
* harbour/contrib/hbexpat/3rd/expat/_hbconf.h
* harbour/contrib/hbexpat/3rd/expat/expat.hbp
* harbour/contrib/hbexpat/3rd/expat/xmltok.c
* harbour/contrib/hbexpat/3rd/expat/xmlrole.c
* harbour/contrib/hbexpat/3rd/expat/xmlparse.c
* updated to define endian setting using information from hbdefs.h
* harbour/contrib/hbexpat/3rd/expat/xmltok.c
! added missing members in structure initializations
* harbour/include/hbpp.h
* harbour/include/hbmacro.h
* harbour/include/hbcomp.h
* harbour/include/hbcompdf.h
* harbour/include/hbexprb.c
* harbour/src/pp/ppcore.c
* harbour/src/compiler/hbmain.c
* harbour/src/vm/macro.c
! fixed code used to decide about early and late macro
evaluation in codeblocks to be exactly Clipper compatible.
Now if codeblock contains at least one macro variable
(i.e.: &var, any&var, any&var.2) then it's always early
evaluated.
Please remember that codeblocks which contains only simple
macro variable ( &var[.] ), i.e.:
{|| &var }
are modified during compilation by Clipper and Harbour compilers to:
&( "{||" + var + "}" )
and then PCODE is generated. It allows to use LOCALs, STATICs and
FIELDs as 'var' in such expressions. In xHarbour above functionality
was extended to work also with macrotext variables, i.e.:
{|| &var.2 }
If you think it's important extension then I can make the same
in Harbour or I can even implement it for all codeblock expressions
with macros using declared non memvar symbols, i.e.
{|| &var + 1 }
what should effectively eliminate E0047 compile time error
! fixed compile time error E0042 "Macro of declared symbol..."
to be generated with the same conditions as in Clipper.
! fixed compile time error E0047
"Code block contains both macro and declared symbol references..."
to be generated with the same conditions as in Clipper.
Note: -km switch disables macro text evaluation so also above errors
unless macro is not used in codeblock
Warning: above modifications can cause compile time errors in some
code which was not Clipper compatible and in such case they
will have to be updated.
* harbour/utils/hbtest/rt_math.prg
! updated code with Clipper incompatible code exploited by above
modifications
* include/hbcomp.h
* include/hbcompdf.h
* include/hbexpra.c
* include/hbexprb.c
* include/hbexprop.h
* include/hbmacro.h
* src/common/expropt1.c
* src/common/expropt2.c
* src/compiler/genc.c
* src/compiler/gencc.c
* src/compiler/harbour.y
* src/compiler/harbour.yyc
* src/compiler/hbdbginf.c
* src/compiler/hbdead.c
* src/compiler/hbident.c
* src/compiler/hblbl.c
* src/compiler/hbmain.c
* src/compiler/hbopt.c
* src/compiler/hbpcode.c
* src/vm/macro.c
+ Adding Win64 support for compiler/macro subsystems.
* HB_ULONG -> HB_SIZE where applicable.
* HB_LONG -> HB_ISIZ where applicable.
* Some now unnecessary cast deleted.
* hb_compExprAsStringLen() return value changed to HB_SIZE from int.
* hb_compNOOPfill() 3rd parameter changed to HB_ISIZ from int.
- Deleted unused hb_compExprMacroListLen().
; TOFIX: Use '$<lNumber>$' (or maybe newly added sNumber)
instead of '$<iNumber>$' in .y code.
Przemek, what do you think?
* src/compiler/Makefile
* C files sorted.
* src/vm/hvm.c
! hb_vmStaticsCount() changed to use HB_SIZE instead of
HB_ULONG. Fixing pending warnings.
* include/hbapi.h
* Changed hb_struEnum.offset structure member from HB_LONG
to HB_ISIZ, fixing one more pending Win64 type mismatch
problem. The change doesn't modify HB_ITEM size.
Please verify me.
* src/vm/classes.c
! Using size API after above change.
; QUESTION: In itemapi asEnum.offset is stored using
hb_itemPutNInt(). Should this be changed to
hb_itemPutNS()?
* contrib/hbct/ctstr.c
+ Cleaned away some HB_ULONG casts and using HB_PFS format
strings instead.
* contrib/hbct/tab.c
! Fixed regression from 2010-06-20 12:34 UTC+0200 Viktor Szakats,
by deleting now unnecessary casts. Shown by mingw64 4.6.0exp.
I'd appreciate if someone could check me!!
* src/vm/macro.c
* src/vm/estack.c
* src/vm/dynsym.c
* src/vm/hvm.c
* src/vm/set.c
* src/rdd/wafunc.c
* src/compiler/hbmain.c
* src/compiler/cmdcheck.c
* src/compiler/genc.c
* src/compiler/gencc.c
* src/compiler/harbour.yyc
* src/compiler/harbour.y
* include/hbexprb.c
+ Added strlen() casts to pacify msvc64 warnings
* src/vm/cmdarg.c
! Readded one '( void * )' cast. (I've only tested C++ mode
on Windows, this fell into *nix code). Thanks for checking it.
* src/rtl/hbgtcore.c
+ HB_SIZE -> HB_UINT, plus added necessary casts. Signaled by warnings
* contrib/hbmisc/spd.c
+ HB_SIZE -> HB_UINT, plus added necessary casts. Signaled by warnings
; In case of this function it'd be probably better to make it fully
HB_SIZE compatible, instead of stepping back like this.
* src/rdd/sdf1.c
* src/rdd/delim1.c
+ Added casts to pacify some msvc64 warnings
* src/rdd/hsx/hsx.c
! HB_SIZE -> HB_LONG. Resolves msvc64 warnings.
* harbour/src/rtl/Makefile
* harbour/src/rtl/hbznet.c
+ harbour/src/rtl/hbinetz.c
* moved HB_INETCOMPRESS() function to separate file
* harbour/include/hbexprb.c
! fixed my very bad C&P typo (2010-02-04 19:14 UTC+0100) which caused
that dummy value was left on HVM stack after post decrementation used
as statement. This dummy value could break construciton like FOR EACH,
WITH OBJECT, BEGIN SEQUENCE. Here is self contain example which can
be used to exploit the problem:
proc main()
begin sequence
p()
end sequence
return
proc p()
local nTemp := 0
begin sequence
nTemp--
end sequence
return
Many thanks to Heinz Bergen who reduced his code to similar small
example.
* harbour/include/hbcomp.h
* harbour/include/hbcompdf.h
* harbour/include/hbexprop.h
* harbour/include/hbexpra.c
* harbour/include/hbexprb.c
* harbour/src/common/expropt1.c
* harbour/src/compiler/hbcomp.c
* harbour/src/compiler/harbour.y
* harbour/src/compiler/harbour.yyc
* harbour/src/macro/macro.y
* harbour/src/macro/macro.yyc
* harbour/src/macro/macro.yyh
+ added new type of expression: SETGET
% eliminated reference counter in expressions
(this code was never fully safe because expression optimizer was not
respecting multiple references)
% replaced all HB_COMP_EXPR_DELETE() macro usage with HB_COMP_EXPR_FREE()
and deleted HB_COMP_EXPR_DELETE() macro
- removed not longer used hb_compExprClone()
Above modifications reduce a little bit total memory consumed by
compiler and macrocompiler giving also some minor speed improvement.
* harbour/ChangeLog
* marked TODO for above modification as DONE.
* harbour/include/hbcomp.h
* harbour/include/hbcompdf.h
* harbour/include/hbmacro.h
* harbour/include/hbexpra.c
* harbour/include/hbexprb.c
* harbour/src/common/funcid.c
* harbour/src/common/expropt1.c
* harbour/src/compiler/hbmain.c
* harbour/src/compiler/harbour.y
* harbour/src/compiler/harbour.yyc
* harbour/src/compiler/harbour.yyh
* harbour/src/vm/macro.c
+ added all reserved and restricted in Clipper functions to
hb_compGetFuncID()
+ extended hb_compGetFuncID() to expand short names of reserved functions
+ extended hb_compGetFuncID() to set function flags
* store expanded function name, ID and flags in HB_ET_FUN* expressions
% modified compiler and macrocompiler code to use function flags and
expanded names set by hb_compGetFuncID(). It allowed to eliminate
calling hb_compReservedName() for function call expressions giving
some small but noticeable speed improvement i.e. in macrocompiler.
* harbour/src/vm/macro.c
* minor simplification
* harbour/src/common/reserved.c
* minor cleanup
* harbour/src/vm/eval.c
* inherit execution context (OOP scope) in HB_EXECFROMARRAY() function
* harbour/include/hbcomp.h
* harbour/include/hbcompdf.h
+ harbour/src/common/funcid.c
* harbour/src/common/Makefile
+ added new [macro]compiler function: hb_compGetFuncID() which can be
used for function name hashing reducing strcmp() comparisons
* harbour/include/hbexpra.c
* harbour/include/hbexprb.c
% use hb_compGetFuncID() to improve code for HB_ET_FUNCALL expressions
* harbour/include/hbapifs.h
* harbour/src/rtl/filebuf.c
* harbour/contrib/hbmemio/memio.c
* harbour/contrib/hbnetio/netiocli.c
+ added new method:
void Flush( PHB_FILE pFile, HB_BOOL fDirty );
to replaceable RDD IO structure (HB_FILE)
+ added new function:
void hb_fileFlush( PHB_FILE pFile, HB_BOOL fDirty );
* harbour/src/rdd/dbfntx/dbfntx1.c
* harbour/src/rdd/dbfnsx/dbfnsx1.c
* harbour/src/rdd/dbfcdx/dbfcdx1.c
* harbour/src/rdd/dbffpt/dbffpt1.c
* use hb_fileFlush()
* harbour/src/vm/hvm.c
* harbour/include/hbxvm.h
! fixed hb_xvm{Local,Static,Module}Name() to use 'const char *'
instead of 'char *' - modifications by Xavi (jarabal)
* harbour/include/hbapi.h
* harbour/include/hbxvm.h
* harbour/include/hbmacro.h
* harbour/include/hbcompdf.h
* harbour/src/vm/hvm.c
* harbour/src/vm/macro.c
* harbour/src/vm/memvars.c
* replaced some 'BYTE' types with 'unsigned char' or 'int' types
* cleanup some other casting and types to reduce conversions
between function calls
* harbour/src/common/expropt1.c
; updated comments
* harbour/include/hbpp.h
* harbour/include/hbexprop.h
* harbour/include/hbexpra.c
* harbour/include/hbexprb.c
* eliminated HB_EXPR_PCODE?() macros
! fixed potential GPF trap during compilation of _GET_() functions
which can be exploited by strange code using some special expressions
as get variable.
TODO: eliminate hb_compExprClone() used in hb_compExprSetGetBlock(),
our optimization module does not care about shared expressions
so it can be source of serious problems in the future if someone
use this functions for non optimized expression which will be
reduced later.
* emulate clipper behavior for codeblock optimizations and do
not optimize all codeblocks if -kc switch is used and codeblocks
is inside non optimized part of code like (Clipper has such
places)
% simplified and optimized some functions like hb_compExprReduceList()
* harbour/include/hbexprb.c
! always optimized ASC() and LEN() functions (was disabled by -kc switch).
These optimizations are not Harbour extensions - Clipper also optimize
above functions
* harbour/doc/cmpopt.txt
* updated optimization description
* harbour/doc/pp.txt
+ added information about new lexer
* harbour/include/hbvmpub.h
! fixed default size macro used in HB_ITEM_PUT_LONGRAW()
* harbour/include/hbexprb.c
* enable ("alias")-> optimization only when -ko harbour compiler
option is used - it changes RT error.
* harbour/include/hbmacro.h
* harbour/source/macro/macro.yyc
* harbour/source/macro/macro.y
* hb_macroIdentNew() made public
* harbour/include/hbexprb.c
! use hb_macroIdentNew() instead of hb_compIdentifierNew()
in code compiled for macrocompiler
* harbour/include/hbexprb.c
* minor modification
* harbour/source/common/expropt2.c
+ added compile time optimization for expression like ("alias")->var
and ("alias")->(<exp>)
* harbour/include/hbexpra.c
% reduce macro expressions used in POP operation.
It allows to use code like: &("((M->VAR))") := 1
* harbour/include/hbexprb.c
+ added support for iif() used in macro expressions passed by references:
proc MAIN()
local s := "IIF( lVar, xVar1, xVar2 )"
M->xVar1 := 1
M->xVar2 := 2
M->lVar := .T.
? M->xVar1, M->xVar2
P( @&s )
? M->xVar1, M->xVar2
proc P(x)
x+=1000
* harbour/source/vm/hvm.c
! fixed possible assign value lost in extended references
* harbour/source/macro/macro.y
* harbour/source/macro/macro.yyc
* harbour/source/compiler/harbour.y
* harbour/source/compiler/harbour.yyc
% reduced INASSING definition - thanks to Xavi for information
* harbour/source/compiler/hbopt.c
! fixed stupid bug in logical expression optimization - thanks to Randy
for self contain example
* harbour/include/hbapi.h
* harbour/include/hbmacro.h
* harbour/include/hbexprb.c
* harbour/source/vm/macro.c
* harbour/source/vm/hvm.c
* harbour/source/macro/macro.y
* harbour/source/macro/macro.yyc
+ added direct support for pushing references to macro expressions.
It resolves the problem with Clipper compatibility (thanks to Alex
for information and example) in code like:
m->var := {0}
&("var[1]") += 10
and also many other things, f.e. now Harbour can cleanly compile
and execute this code:
proc main
local s
m->o := errorNew()
s:="o:tries"
? m->o:tries
? &s
? &(s+"+=2")
? m->o:tries
? &(s+":=3")
? m->o:tries
?
&s := 4
? m->o:tries
&s -= 2
? m->o:tries
&s++
? m->o:tries
?
s := "o"
m->o := 1
? &s
&s := &s + 4
? &s
? &s += 5
? --&s
?
s := "o[2]"
m->o := { 1, 2 }
? &s
&s := &s + 4
? &s
? &s += 5
? --&s
return
* harbour/utils/hbtest/Makefile
* force hbtest compilation with line numbers - information about line
numbers is important part of this test.
* harbour/contrib/gtwvg/wvgwin.c
! fixed wrongly used & operator
* harbour/source/rtl/hbproces.c
* added TODO warning in OpenWatcom Linux builds
* harbour/make_gnu.sh
! fixed test_param() function definition - it has to be defined it's
before use
* harbour/include/hbexpra.c
* harbour/include/hbexprb.c
* harbour/source/common/expropt1.c
* harbour/source/rtl/round.c
* removed unnecessary <math.h>
* harbour/source/vm/hvm.c
* harbour/source/common/expropt2.c
* harbour/contrib/hbct/ctmath.h
* harbour/contrib/hbclipsm/num.c
* harbour/contrib/hbclipsm/numfloor.c
* harbour/contrib/hbclipsm/numceil.c
* use "hbmath.h" instead of <math.h> to avoid possible desynchronization
between used math libraries and header files
* harbour/source/pp/Makefile
! fixed real DOS compilation - replaced Windows only hack by wildcard
function usage
* harbour/config/dos/dir.cf
* removed intermediate sh call from executed commands
* harbour/source/vm/Makefile
* disabled HB_HVM_ALL in all Watcom builds - it works but the compilation
time is very huge so user who wants to use it should set envvar
HB_HVM_ALL=yes
* enabled HB_HVM_ALL for DJGPP builds
* include/hbexprb.c
+ Allowing user defined 'gettext' functions to be used
under the names hb_i18n_gettext[_strict|_noop]_*(),
where * is a function name postfix.
* harbour/include/hbexprb.c
! modified := optimization to keep alive original LValue name
used in the assign expression. It fixes FOR / NEXT loops which
in which such optimized expression were used, f.e.:
FOR n := n + 1 TO 10; ? n; next
In fact it's only workaround for potentially bigger problem with
multiple references to single expression which we probably have to
resolve if we extend the compiler to not generate PCODE online
for each compiled statement but only after preprocessing and
optimizing at least whole function or procedure.