Commit Graph

107 Commits

Author SHA1 Message Date
Przemyslaw Czerpak
b5d010fbeb 2007-10-01 19:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/errorapi.c
    + added protection against possible GPF when some assign methods
      were called without parameters

  * harbour/source/rdd/workarea.c
    * initialize uiFalgs also when DBS_FLAGS is not set

  * harbour/contrib/bmdbfcdx/bmdbfcdx1.c
    * fixed hb_cdxSkipFilter() declaration - it should be 'static' function

  * harbour/source/pp/ppcore.c
  * harbour/source/compiler/ppcomp.c
    + added support for changing all -k? switches by #pragma, f.e.;
         #pragma -ks+
         #pragma -kM-
         #pragma -kx1
         #pragma -kJ0

  * harbour/source/compiler/hbusage.c
    * changed -ks description

  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
    * do not generate error message for negative indexes and
      [] operators are used for simple types when -ks option
      is used

  * harbour/include/hbvmpub.h
  * harbour/include/hbapi.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/extend.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/memvars.c
    + added HB_IT_DEFAULT flags - it allows to check if item was changed

  * harbour/source/vm/memvars.c
  * harbour/include/hbvm.h
    ! fixed HB_IT_MEMOFLAG updating to be Clipper compatible. Here we are
      not Clipper compatible in one place: in clodeblock local parameters
      with memo values are marked as MEMO but if you leave function where
      codeblock were created then Clipper during detaching removes MEMO
      flag. In Harbour memo flag is kept.

  * harbour/include/hbvm.h
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    % improved speed of extended references used for SETGET methods
      and overloaded [] operators

  * harbour/include/hbapi.h
  * harbour/include/hbsetup.ch
  * harbour/source/compiler/hbcomp.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
  * harbour/source/vm/cmdarg.c
    * removed HB_COMPAT_XHB flags - only one HB_COMPAT_XHB still exist
      in HVM in hashes.c - it will be removed soon.

  * harbour/source/common/hbverdsp.c
    * removed information about xHarbour compatibility mode - it's not
      longer used. We are emulating xHarbour behavior using external
      XHB library and standard compiler/HVM features

  * harbour/contrib/xhb/xhb.ch
  * harbour/contrib/xhb/xhbfunc.c
  * harbour/source/vm/arrayshb.c
    * moved XHB_AINS(), XHB_ADEL() from XHB lib to HVM as HB_AINS(), HB_ADEL()

  * harbour/contrib/xhb/xhb.ch
    + added #pragma -ks+
    + added transaltion for hb_enumindex( <enumvar> )

  + harbour/contrib/xhb/xhbenum.c
    + added emulation for HB_EUMMINDEX()

  * harbour/contrib/xhb/xhbfunc.c
    * do not add INET*() function wrappers for DOS builds or when
      HB_NO_DEFAULT_INET macro is set

  * harbour/contrib/xhb/xhbmsgs.c
    * added comment

  * harbour/contrib/Makefile
    + added TIP and XHB

  * harbour/make_rpm.sh
  * harbour/harbour.spec
    * removed HB_COMPAT_XHB, --with tip, --with xhb
      they are not longer necessary
2007-10-01 17:43:52 +00:00
Przemyslaw Czerpak
d5a382e30d 2007-09-28 16:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * respect -ks in macrovars and array item references

  * harbour/source/vm/memvars.c
    * do not detach array items during detaching enumerator variable
      also in standard (without HB_COMPAT_XHB) build
2007-09-28 14:32:20 +00:00
Przemyslaw Czerpak
af5038b272 2007-09-28 14:08 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/garbage.c
    + added extended item references - it's universal reference which
      can be used by HVM for many different things without introducing
      new item types

  * harbour/include/hbexprb.c
    * respect -ks compiler also with <op>=, --, ++ operators

  * harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/classes.c
    + added extended references for SETGET methods used as object
      item references
    * use extended references to respect overloaded [] operator in
      object item references
    + added support for passing indexes to string item characters
      ( @cValue[n] ) by reference using extended references - extension
      enabled by -ks compiler switch and //flags:s RT switch. 
    + added hb_vmPushItemRef()

  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/usrrdd/usrrdd.c
    * use hb_vmPushItemRef()

  * harbour/contrib/xhb/xhbcomp.prg
  * harbour/contrib/xhb/xhbmsgs.c
    * overload +, -, *, %, ^, ++, -- in string and numeric scalar
      classes to emulated xHarbour behavior when 1 byte string is
      used as numeric value.
      Note: <nun> + <char1> in XHB lib gives numeric value when in
            xHarbour character. But because <nun> <anyOtherOper> <char1>
            in xHarbour gives numeric value then I guess that it's
            xHarbour bug and I should not replicate it, f.e.:
               proc main()
                  ? 1+"A", 131-"A", 33 * 2, 132 / chr(2), 133 % "C"
               return
    * overload +, - in hash scalar class to emulated xHarbour behavior
      for <hash> + <hash> and <hash> - <hash>
      Seems that now we can remove HB_COMPAT_XHB flag from HVM and keep
      Harbour compatibility only with -ks compile time switch and XHB
      library. Please make some tests with Harbour compiled without
      HB_COMPAT_XHB and xHarbour code using REQUEST XHB_LIB. It's possible
      that I missed sth but some basic test shows that our emulation is
      better then original and addresses places where xHarbour does not
      work at all or gives strange results, f.e.:

         #ifndef __XHARBOUR__
            request XHB_LIB
         #endif
         proc main()
            local h:={"ABC"=>123.45}
            ? h:abc
            h:abc+=1000   ; ? h:abc
            h["ABC"]+=1000; ? h:abc
            p(@h:abc)     ; ? h:abc
            p(@h["ABC"])  ; ? h:abc
         return
         proc p(x)
            x+=1000
         return

      or:

         #ifndef __XHARBOUR__
            request XHB_LIB
         #endif
         #include "hbclass.ch"
         proc main()
            local o:=myClass():new()
            o:setget:="ABC"; ? o:setget
            o:setget[2]:=42; ? o:setget
            o:setget[2]+=42; ? o:setget
            ? o:setget[2]+=42; ? o:setget
            ?
            o:var:="ABC"; ? o:var
            o:var[2]:=42; ? o:var
            o:var[2]+=42; ? o:var
            ? o:var[2]+=42; ? o:var
         return
         CREATE CLASS myClass
            VAR    var
            METHOD setget SETGET
         END CLASS
         METHOD setget( xNewVal ) CLASS myClass
            IF pcount() > 0
               ::var := xNewVal
            ENDIF
         RETURN ::var

  * harbour/include/hbapirdd.h
  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/workarea.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbfdbt/dbfdbt1.c
  * harbour/source/rdd/usrrdd/usrrdd.c
  * harbour/contrib/rdd_ads/ads1.c
    * changed second parameter in RELTEXT() method to PHB_ITEM
      Now RELTEXT() works like FILTERTEXT() and the size of
      expression is not limited. It's a modification I wanted
      to make for a long time and I think that now is a good
      moment to make it together with HB_FT_* modifications
    - rmoved not longer necessary HARBOUR_MAX_RDD_RELTEXT_LENGTH

  * harbour/source/rtl/gttrm/gttrm.c
    * small cleanup
2007-09-28 12:08:46 +00:00
Przemyslaw Czerpak
503c1ddf13 2007-09-02 17:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/hbgtmk.sh
  * harbour/tests/codebl.prg
  * harbour/tests/testprof.prg
  * harbour/tests/keywords.prg
  * harbour/tests/testpp.prg
  * harbour/make_rpm.sh
  * harbour/makefile.gc
  * harbour/bin/hb-mkslib.sh
  * harbour/include/hbexpra.c
  * harbour/include/hbmath.ch
  * harbour/include/hbrddntx.h
  * harbour/include/hbexprb.c
  * harbour/harbour.spec
  * harbour/contrib/dot/pp.prg
  * harbour/contrib/libct/ctwin.c
  * harbour/contrib/ole2/w32ole.c
  * harbour/contrib/hgf/win32/win32.c
  * harbour/contrib/mysql/mysql.ch
  * harbour/contrib/odbc/todbc.prg
  * harbour/contrib/odbc/sql.ch
  * harbour/contrib/hb_struc/hbstruc.ch
  * harbour/contrib/bmdbfcdx/bmdbfcdx1.c
  * harbour/contrib/msql/msql.ch
  * harbour/contrib/msql/readme.txt
  * harbour/source/pp/ppcore.c
  * harbour/source/rtl/gtdos/gtdos.c
  * harbour/source/rtl/gtxwc/gtxwc.h
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtcrs/gtcrs.h
  * harbour/source/rtl/gtalleg/gtalleg.c
  * harbour/source/rtl/gtalleg/ssf.h
  * harbour/source/rtl/gtalleg/fixedth.sfc
  * harbour/source/rtl/gtchrmap.c
  * harbour/source/rtl/itemseri.c
  * harbour/source/rtl/gtstd/gtstd.c
  * harbour/source/rtl/gtsln/gtsln.h
  * harbour/source/rtl/gttrm/gttrm.c
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/hbhex.c
  * harbour/source/rtl/tget.prg
  * harbour/source/rtl/gtcgi/gtcgi.c
  * harbour/source/rtl/hbinet.c
  * harbour/source/vm/hvm.c
  * harbour/source/debug/dbgtobj.prg
  * harbour/source/debug/dbgwa.prg
  * harbour/source/common/expropt2.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpptest/pp_test.prg
  * harbour/utils/hbpptest/pretest.prg
  * harbour/make_tgz.sh
    * converted TABs to SPACEs
2007-09-02 15:28:05 +00:00
Przemyslaw Czerpak
c775f56f50 2007-08-20 15:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * do not generate error for QSELF()[...] - Clipper allows such
      operation and because some valid Clipper code needs it then
      I disabled error message.

  * harbour/common.mak
  * harbour/source/rtl/Makefile
  + harbour/source/rtl/einstvar.prg
    + added undocumented CA-Cl*pper function _eInstVar() used to validate
      variable type in assign messages.

  * harbour/include/hbapi.h
  * harbour/source/vm/arrays.c
    * changed 'char *' to 'const char *' in hb_arraySetC() and hb_arraySetCL()

  * harbour/source/rdd/dbcmd.c
    * cleaned DBSKIPPER() code

  * harbour/source/rtl/browdb.prg
    * use written in C DBSKIPPER() function instead of static .prg Skipped()
      when HB_COMPAT_XPP macro is enabled

  * harbour/source/rtl/browse.prg
    ! fixes in BROWSE() function:
      ! displaying box characters
      + added CL53 compatible mouse actions
      + added mouse wheel actions
      + added support for deleting records (K_DEL)
      + added support for edit mode
      + added support for append mode
2007-08-20 13:50:18 +00:00
Przemyslaw Czerpak
20719c1cf1 2007-07-31 21:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * disable CTOD("") optimization when -kc switch is used

  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.y
    * fixed typo reported by Mindaugas

  * harbour/source/vm/classes.c
    * fixed typo reported by Lost
2007-07-31 19:01:07 +00:00
Przemyslaw Czerpak
cc578600c5 2007-06-04 22:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbzlib/include/stdafx.h
  * harbour/contrib/hbzlib/include/ziparchive.h
    * cleaned some warnings

  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt2.c
    * restored Mindaugas code for UPPER optimization and added logic to
      optimize UPPER for strings with only Latin letters, digit and spaces
      just like in Clipper. Now code like:
         ? Upper( chr(65)+chr(66)+chr(67)+"0123 QWE asd " ) + "ZXC"
      is fully optimized at compile time to single string expression.
    % optimized hb_compExprReduceCHR() by eliminating memory allocation
      for new string
    ! fixed typo in my previous commit
2007-06-04 20:42:33 +00:00
Przemyslaw Czerpak
973468286a 2007-06-04 20:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt2.c
    % added compile time optimization for CTOD("")
    % added compile time optimization for - used forconstant string values,
      f.e.:
         ? "Harbour   " - " Compiler"

  * harbour/source/vm/hvm.c
    % added optimization for string resizing in cVal1 - cVal2

  * harbour/source/rtl/dateshb.c
    % minor optimization - removed one not necessary ISCHAR()
2007-06-04 18:11:04 +00:00
Mindaugas Kavaliauskas
c8c4a3986e 2007-06-04 19:11 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/include/hbexprop.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt2.c
     - removed UPPER("") optimisation because of ... ?
2007-06-04 16:11:07 +00:00
Mindaugas Kavaliauskas
caec86d5d5 2007-06-03 23:03 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/include/hbexprop.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt2.c
     * added UPPER("") optimisation. The side effect of this modification
       is that Harbour becomes Clipper bug compatible in calculation of
       AT(UPPER(""), "test"). Though this optimisation does not introduce
       any buggy behaviour itself.
2007-06-03 19:59:39 +00:00
Przemyslaw Czerpak
defb63f5f2 2007-05-30 01:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
    ! fixed bug in operator precedence - seems that it existed from
      beginning and partially were fixed in xHarbour. This code exploits
      the problem:
            #define EOL chr(13)+chr(10)
            #command ? [<x,...>] => [outstd( <x> );]outstd(EOL)
            #command TEST <exp> => BEGIN SEQUENCE     ;
                                 ;   ? <exp>          ;
                                 ; RECOVER USING oErr ;
                                 ;   ? "Error:", oErr:subCode, ;
                                       oErr:description, oErr:operation ;
                                 ; END
            proc main()
            local oErr, s1:="X", s2:="Y", t:=.T.
            errorBlock({|oErr|break(oErr)})
            TEST t != s1 $ s2
            TEST t == s1 $ s2
            TEST t =  s1 $ s2
            TEST t <  s1 $ s2
            TEST t <= s1 $ s2
            TEST t >  s1 $ s2
            TEST t >= s1 $ s2
            TEST s1 $ s2 != t
            TEST s1 $ s2 == t
            TEST s1 $ s2 =  t
            TEST s1 $ s2 >  t
            TEST s1 $ s2 <  t
            TEST s1 $ s2 >= t
            TEST s1 $ s2 <= t
            return
2007-05-29 23:04:09 +00:00
Przemyslaw Czerpak
2f0189d34f 2007-05-12 10:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/include/hbpp.h
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbmain.c
  * harbour/source/pp/ppcore.c
    + added support for extended multiline codeblocks:
         { |<params,...>| <EOL>
            <statement1>
            ...
            <statementN>
            return <val>
         }
      Such codeblocks allow nested definitions. They can also have their
      own variable declarations (local, static, field, memvar, parameters,
      private, public) and visibility of declared variables is similar to
      nested function in Pascal but please note that there is one limitation
      which exists also for normal codeblocks (Clipper compatible behavior):
      internal codeblock local parameters and local variables cannot be
      used in nested codeblocks, f.e. such code:
            eval( { |p| eval( {|| qout( p + 1 ) } ) } )
      is illegal in Clipper and Harbour. This limitation also can be
      eliminated but but it will be necessary to make deeper modifications
      in code for local detaching changing the method of generating
      codeblocks local variables in nested blocks so unlike the above
      also some modifications in HVM will be necessary.
      Please test.
2007-05-12 08:48:12 +00:00
Przemyslaw Czerpak
91ec7b23a5 2007-05-11 22:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbmain.c
    * changed code used for variable scoping - now it's much more
      simple (only one function) and allows to use declarations in
      nested functions/codeblocks with visibility similar to Pascal
    ! fixed parsing FILED <fields,...> IN <alias>
      we were accepting code like:
         FIELD f1, f2 IN db1, f3 IN db2 IN db3
      and for all fields the last alias (db2 in this example) was used
    ! fixed calculating number of static variables with -b (debugger)
      compilation (number of file wide statics were doubled)
    ! fixed generation of static variable names for debugger when declared
      with array dimensions, f.e.:
         static sVar[3]

  * harbour/source/rtl/hbffind.c
    * minor cleanup *nix version

  * harbour/contrib/bmdbfcdx/bmdbfcdx1.c
    ! fixed casting for C++ compilation

  * harbour/source/rdd/dbfdbt/dbfdbt1.c
    * updated for some old API modifications (this library is not used now
      but if we keep it in CVS then I think it should be updated)
2007-05-11 20:51:04 +00:00
Przemyslaw Czerpak
74adc6f86c 2007-04-23 18:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
    ! reverted fix for unnecessary -W2 warning:
         Function '...' does not end with RETURN statement
      in code like:
            func f(v)
            if v
               return "TRUE"
            else
               return "FALSE"
            endif
      Sorry but I had to make it because this fix was wrong and causes
      that code like:
            func f(v)
            if v
               ? v
            else
               return "FALSE"
            endif
      was compiled without any warnings but wrong PCODE was generated.
      In some spare time I'll try to implement valid RETURN detection,
      now simply add RETURN NIL at the end of such functions - it will
      be removed by dead code eliminator.
    ! fixed memory leak when more then one .prg file was given as compiler
      parameter
    + cleaned some code for future modifications

  * harbour/source/macro/macro.y
    + added small hack for two BCC/OW warnings
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
    * regenerated with modified Bison version which should give code
      without BCC warnings - I cannot promise I'll keep it in the
      future but I will try.

  * harbour/source/rdd/dbcmd.c
    ! use default RDD instead of current one in COPY TO and APPEND FROM

  * harbour/source/vm/classes.c
    * added support for (@func()):eval(...)
2007-04-23 16:27:57 +00:00
Przemyslaw Czerpak
759c045f73 2007-03-30 15:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    % optimize PCODE generated for IIF() used as statement

  * harbour/include/hbpp.h
    * fixed typo in comment

  * harbour/source/pp/ppcore.c
    * fixed .ppo output in some string expressions inside []

  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
    + added some missing DBOI_* actions

  * harbour/source/rtl/hbregex.c
    + added comment

  * harbour/source/vm/hashes.c
    * set autoadd by default when compiled with HB_COMPAT_XHB macro

  * harbour/source/debug/debugger.prg
  * harbour/source/rdd/dbstrux.prg
  * harbour/source/rtl/tbrowse.prg
    * removed unnecessary NIL in in IIF() statements
  * harbour/utils/hbtest/rt_misc.prg
    * removed unnecessary ::cValue in in IIF() statements
2007-03-30 13:16:10 +00:00
Przemyslaw Czerpak
88cda3200d 2007-03-22 12:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
    * updated for new files - please check

  * harbour/harbour.spec
    * added compiler library

  * harbour/bin/pack_src.sh
  * harbour/bin/hb-func.sh
    * updated for new files and libraries

  * harbour/config/w32/mingw32.cf
  * harbour/config/w32/watcom.cf
  * harbour/config/w32/xcc.cf
    * added winsock libraries

  * harbour/include/hbapicdp.h
  * harbour/source/rtl/cdpapi.c
    + added hb_cdpicmp() - not case sensitive version of hb_cdpcmp()

  * harbour/include/hbapiitm.h
  * harbour/source/vm/itemapi.c
    + hb_itemStrICmp(), hb_itemCopyFromRef(), hb_itemMoveFromRef()

  * harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpcode.h
  * harbour/include/hbvmpub.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/Makefile
  * harbour/source/vm/arrays.c
  * harbour/source/vm/asort.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/eval.c
  * harbour/source/vm/garbage.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/macro.c
  + harbour/source/vm/hashes.c
  + harbour/source/vm/hashfunc.c
    + added hash items, f.e.:
         local h1 := {=>}, h2 := { "a"=>1.234, "b"=>2.345 }
         ? h2[ "a" ], h2[ "b ]
    + added support for DYNAMIC function declaration - it allow to define
      functions which are lately bound at runtime, f.e.:
         /*** t01.prg ***/
         dynamic func1
         proc main()
         local h:=__hrbload("t02.hrb")
         ? func1()
         return

         /*** t02.prg ***/
         func func1
         return "Hello!!!"

    % use new FUNCALL structure to hold EXTERNAL and DYNAMIC functions,
      it reduce memory usage, FUNCALL is much smaller then FUNCTION
    % use symbol scope bits when possible instead of making some linear scan
    + added new enumarator message: __ENUMKEY - it allow to access
      key value when hash item is base enumerator value, f.e.:
         proc main()
         local v, h:={"a"=>1.000,"b"=>2.000,"c"=>3.000}
         heval( h, { |k,v,i| qout( k, v, i ) } ); ?
         for each v in h
            ? v, "=>", v:__enumKey(), v:__enumValue(), v:__enumIndex(), ;
                       valtype(v:__enumBase())
            v += 0.123
         next
         ? ;heval( h, { |k,v,i| qout( k, v, i ) } )
         return
    + added C level hb_hash*() functions
    + added support for full HASH item cloning and updated array cloning
      to also clone nested hashes - please note that xHarbour does not do
      that, in xHarbour ACLONE() clones _ONLY_ nested arrays and HCLONE()
      _DOES_NOT_ clone _ANY_ nested items.

  * harbour/include/hbextern.ch
    + added hash functions HB_H*()
    * changed INET*() functions to HB_INET*()
    + added hash functions H*() and socket functions INET*() when
      HB_COMPAT_XHB is set

  * harbour/include/hbtypes.h
    + added missing HB_EXTERN_BEGIN / HB_EXTERN_END

  * harbour/include/hbpp.h
  * harbour/source/pp/ppcore.c
    ! added protection against automatic word concatenation in some cases
    ! fixed preprocessing expressions when match marker matches ';' token

  * harbour/source/rtl/Makefile
  + harbour/source/rtl/itemseri.c
    + added functions for item serialization: HB_SERIALIZE() and
      HB_DESERIALIZE() - these function are not binary compatible
      with xHarbour functions with the same names but make very
      similar job with the exception to serialization of codeblock
      and object variables - Harbour does not allow to serialize
      codeblocks and serialize objects as arrays.
      In most cases these functions can replace the xHarbour ones
    + added HB_DESERIALBEGIN() and HB_DESERIALIZE() functions covered
      by HB_COMPAT_XHB macro - this functions are only for compatibility
      with existing xHarbour code, In Harbour HB_DESERIALBEGIN() is
      dummy function which returns first parameter and HB_DESERIALNEXT()
      is a simple wrapper to HB_DESERIALIZE() so it's not necessary to
      use them.

  * harbour/source/rtl/hbinet.c
    * changed INET*() functions to HB_INET*() and enable them for default
      build
    + added INET*() functions wrappers covered by HB_COMPAT_XHB macro

  * harbour/source/rtl/hbrandom.c
    + added HB_RANDOMINT() - xHarbour compatible

  * harbour/source/rtl/len.c
    + added support for HASHes

  * harbour/source/rtl/valtype.c
    + added support for HASHes
    + added set of HB_IS*() functions - they are a little bit faster then
      calling VALTYPE( v ) == <cVal>
    - removed HB_ISBYREF() - this function cannot longer work, it was using
      a Clipper incompatible anomalies in passing variables by reference I
      fixed so it has to stop to work. If it will be realy necessary to
      implement HB_ISBYREF() function then please inform me - it will have
      to be done at compiler level or with some much deeper HVM stack
      checking.

  * harbour/source/vm/extend.c
    ! fixed hb_extIsArray() and hb_extIsObject() to work well with
      parameters passed by reference.
      Please note that now hb_extIsArray() return TRUE only for pure arrays
      not object values.

  * harbour/contrib/Makefile
  + harbour/contrib/tip/Changelog
  + harbour/contrib/tip/Makefile
  + harbour/contrib/tip/atokens.c
  + harbour/contrib/tip/base64x.c
  + harbour/contrib/tip/cgi.prg
  + harbour/contrib/tip/client.prg
  + harbour/contrib/tip/credent.prg
  + harbour/contrib/tip/cstr.prg
  + harbour/contrib/tip/encb64.prg
  + harbour/contrib/tip/encmthd.c
  + harbour/contrib/tip/encoder.prg
  + harbour/contrib/tip/encqp.prg
  + harbour/contrib/tip/encurl.prg
  + harbour/contrib/tip/ftpcln.prg
  + harbour/contrib/tip/hbhex2n.c
  + harbour/contrib/tip/httpcln.prg
  + harbour/contrib/tip/mail.prg
  + harbour/contrib/tip/popcln.prg
  + harbour/contrib/tip/smtpcln.prg
  + harbour/contrib/tip/tip.ch
  + harbour/contrib/tip/url.prg
  + harbour/contrib/tip/utils.c
    + added TIP library - code borrowed from xHarbour



   Please test - a lot of above code is not well tested, also some peaces
   were written over year ago for different things (f.e. serialization for
   NETRDD) and now I collected them and committed.
   The TIP library was not tested at all. It can be compiled but I cannot
   say if it works - I hope that people familiar with it can make necessary
   test and fixes.
   It's also not the final version of low level HASH item code. I'm working
   on more efficient structure which uses binary tries but I cannot say when
   I'll finish it (maybe in this weekend or maybe in next year) so I committed
   working version now even if I'm not happy with overall performance (BTW
   not worser then in xHarbour)
2007-03-22 12:28:14 +00:00
Przemyslaw Czerpak
4f10cc035a 2007-03-12 14:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
    * emulate xHarbour HB_ENUMINDEX() inside FOR EACH loop when
      HB_COMPAT_XHB macro is set
      It's only for compatibility - I strongly suggest to use
            <unumvar>:__enumIndex()
      which is more flexible and allow to chose the enumerator
      variable not only the one from last loop

  * harbour/include/hbexprb.c
    * added comment removed from hbexpra.c

  * harbour/source/compiler/hbmain.c
    ! fixed GPF which can appear when -b option is used in line numbering
      inside codeblocks
2007-03-12 13:37:49 +00:00
Przemyslaw Czerpak
8ce0d03aa0 2007-03-09 04:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/bin/hb-func.sh
  * harbour/config/global.cf
  * harbour/include/error.ch
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  - harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/source/Makefile
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  - harbour/source/compiler/exproptc.c
  - harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbgenerr.c
  + harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  - harbour/source/macro/macroc.c
  + harbour/source/main/Makefile
  + harbour/source/main/harbour.c
  * harbour/source/vm/macro.c
    * resolved name conflicts between compiler and macro compiler.
      Now new compiler library is created.
      There are some things which can be improved and cleaned yet
      but it's enough to create single binaries with compiler+HVM+RTLs.
      I updated non GNU make files but I cannot tested the modifications
      - please check and fix me if necessary
2007-03-09 03:44:42 +00:00
Przemyslaw Czerpak
61800e95cc 2007-03-05 23:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/source/compiler/hbgenerr.c
    * do not generate warnings about meaningless expression usage
      in code optimized by short logical expression evaluation, f.e.:
         proc main()
         (f1() .or. (f2(), .t.))
         return
2007-03-05 22:30:50 +00:00
Przemyslaw Czerpak
d4f042a2a5 2007-02-27 12:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbmacro.h
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/common/hbdate.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbopt.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/rtl/abs.c
  * harbour/source/rtl/at.c
  * harbour/source/rtl/chrasc.c
  * harbour/source/rtl/datec.c
  * harbour/source/rtl/dateshb.c
  * harbour/source/rtl/diskspac.c
  * harbour/source/rtl/disksphb.c
  * harbour/source/rtl/gtfunc.c
  * harbour/source/rtl/left.c
  * harbour/source/rtl/len.c
  * harbour/source/rtl/math.c
  * harbour/source/rtl/minmax.c
  * harbour/source/rtl/mod.c
  * harbour/source/rtl/philes.c
  * harbour/source/rtl/philesx.c
  * harbour/source/rtl/replic.c
  * harbour/source/rtl/round.c
  * harbour/source/rtl/set.c
  * harbour/source/rtl/space.c
  * harbour/source/rtl/strcase.c
  * harbour/source/rtl/strpeek.c
  * harbour/source/rtl/transfrm.c
  * harbour/source/rtl/trim.c
  * harbour/source/rtl/type.c
  * harbour/source/rtl/val.c
  * harbour/source/rtl/word.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
    * added some PCODEs to cover all possible combination of ++, --, <op>=
      operations in the same way and keep Clipper compatible RT errors.
    * added some other PCODEs to optimize some commonly used expressions/
      statements
    * use HB_ERR_ARGS_BASEPARAMS instead of hb_paramError()
    * some other cleanups and minor optimizations
  * harbour/utils/hbtest/rt_math.prg
    * update expected result for MOD() - it was not Clipper compatible and
      it will be hard to make it compatible without introducing some Clipper's
      side effects
2007-02-27 11:03:59 +00:00
Przemyslaw Czerpak
71acb177c3 2007-01-24 10:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/w32/bcc32.cf
  * harbour/include/hbexprb.c
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/rtl/set.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/vm/hvm.c
    * recent fixes from Beta1

  * harbour/contrib/libct/Makefile
  - harbour/contrib/libct/bit1.c
  - harbour/contrib/libct/bit2.c
  - harbour/contrib/libct/bit3.c
  + harbour/contrib/libct/bitnum.c
    ! rewritten bit functions

  * harbour/contrib/libct/addascii.c
    * cleanup

  * harbour/contrib/odbc/Makefile
  * harbour/contrib/odbc/odbc.c
  * harbour/contrib/odbc/sql.ch
  - harbour/contrib/odbc/sql.h
  - harbour/contrib/odbc/sqlext.h
  - harbour/contrib/odbc/sqltypes.h
  * harbour/contrib/odbc/todbc.prg
    ! synced with xHarbour

  * harbour/contrib/rdd_ads/ads1.c
    ! fixed typo in DBI_GETHEADERSIZE

  * harbour/contrib/rdd_ads/adsfunc.c
    + added ADSDDREMOVEINDEXFILE - borrowed from xHarbour

  * harbour/source/rtl/alert.prg
    * minor cleanup

  * harbour/source/rtl/gtfunc.c
    * use HB_ERR_ARGS_BASEPARAMS in error messages

  * harbour/source/rtl/transfrm.c
    * casting
2007-01-24 09:27:02 +00:00
Przemyslaw Czerpak
c13da799ef 2007-01-17 03:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/libct/ctc.c
  * harbour/contrib/libct/files.c
  * harbour/contrib/libnf/ftattr.c
  * harbour/contrib/libnf/n2color.c
    * cleaned some BCC warnings

  * harbour/include/hbapi.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbsetup.ch
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/common/hbver.c
  * harbour/source/common/hbverdsp.c
  * harbour/source/compiler/hbcomp.c
  * harbour/source/vm/arrays.c
  * harbour/source/vm/arrayshb.c
  * harbour/source/vm/cmdarg.c
  * harbour/source/vm/hvm.c
    ! fixed Harbour support for accessing string characters with array
      index operators []
    + added support for #define HB_COMPAT_XHB - it's disabled by default.
      When set it enables some of xHarbour features like negative array
      indexes calculated from tail, accessing string characters with []
      operators (warning it's not compatible with default Harbour version
      enabled by -ks during compilation and //flags:s at runtime - in
      xHarbour compatibility mode "ABC"[2] returns "B" when in Harbour 66)
      and some other minor features.

  * harbour/source/compiler/cmdcheck.c
    * added support for optional setting C output type in -go switch
      Now it accepts optional digit [0123] after -go in the same way
      as -gc, f.e.: -go3

  * harbour/source/compiler/harbour.c
    * call hb_compExprLstDealloc() only when errors appeared during
      compilation - it disable automatic freeing all allocated expressions
      in clean compilation. I make it intentionally for easier detecting
      problems one some expressions are not freed. So far the final cleanup
      code always deallocated expressions what can hide some real bugs.

  * harbour/source/vm/hvm.c
    ! fixed very serious bug in HVM closing. The s_uiActionRequest flag
      was not cleared before hb_rddShutDown() so when RDD buffers were
      hot and flushing required some PCODE evaluation (f.e. index KEY
      or FOR expression) then they were not properly evaluated.

  * harbour/source/vm/macro.c
    * minor improvement

  * harbour/utils/hbtest/rt_misc.prg
    ! fixed one of expected result, it was neither Harbour nor Clipper
      result (I've just made some test with Clipper), I do not know why
      it existed
2007-01-17 02:55:14 +00:00
Przemyslaw Czerpak
071fef7612 2007-01-13 14:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/adsfunc.c
  * harbour/source/rdd/workarea.c
    * formatting

  * harbour/include/hbapi.h
  * harbour/source/vm/extend.c
    + added missing hb_storptrGC()

  * harbour/include/hbapicdp.h
  * harbour/source/rtl/cdpapi.c
    + added parameter to unicode translation function to protect control
      code translation
    * formatting

  * harbour/source/rtl/gtsln/kbsln.c
  * harbour/source/rtl/gtxwc/gtxwc.c
    * use new unicode translation function format. It also fixes problem
      with space translation in GTLSN used in UTF8 mode

  * harbour/include/hbapiitm.h
  * harbour/source/vm/itemapi.c
    + added hb_itemCopyToRef(), hb_itemMoveToRef(), hb_itemMoveRef(),
      hb_itemUnRefWrite()

  * harbour/include/hbexprb.c
    ! use HB_P_DUPLUNREF instead of HB_P_DUPLICATE when assign is used in
      push context - Clipper compatible behavior, see:
         x:=10
         f(y:=iif(.t.,@x,))
         ? x, y
         func f(x)
         x+=100
         return nil

  * harbour/include/hbver.h
  * harbour/source/common/hbver.c
    * changed status to "devel"

  * harbour/source/common/expropt2.c
    * disabled setting NIL when iif(.t.,,sth()) is optimized to avoid
      warning when iif() is used as statement - to fix number of parameters
      passed to function in code like f(iif(.t.,,sth())) we will need a
      little bit deeper modification

  * harbour/source/compiler/complex.c
    * added hack for potential problems caused by WITH OBJECT syntax, f.e.
      in code like:
         proc p(obj,x)
         case:=myCaseClass():new()
         retu:=myCaseClass():new()
         WITH OBJECT obj
            do case
               case x==nil
               case:value()
               case:action()
                  retu:sth()
            end
         END
         case:action()
         retu:sth()
         return
      case:action(), case:value(), retu:sth() can means two different things
      and compiler cannot guess which one should use. It cannot be fixed
      because it's caused by bad WITH OBJECT syntax. In xHarbour constractions
      like case:value() or retu:sth() are always used as in  WITH OBJECT
      context what is not Clipper compatible. I do not want to introduce
      such limitations. We have two choices: change WITH OBJECT syntax or
      add some hack to "hide" the problem a little bit. Now I intorduce
      ugly hack which check number of spaces between ':' so
         case :action()
      is compiled as case condition using WITH OBJECT message and
      case:action() as sending message to object in case variable

  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    + added support for passing base value to FOR EACH by reference.

  * harbour/source/vm/arrays.c
    * use hb_itemMoveRef() in AINS()/ADEL() to avoid creation of cyclic
      reference chains

  * harbour/source/vm/debug.c
  * harbour/source/vm/memvars.c
    * use hb_itemCopyToRef() to avoid creation of cyclic reference chains

  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    * use hb_itemMoveToRef() to avoid creation of cyclic reference chains
    + added support for for writable string enumerators, f.e.:
         proc main()
         local s, c
         s:="abcdefghijklmnopqrst"
         for each c in @s
            if c$"aeio"
               c:="*"
            endif
         next
         ? s // "*bcd*fgh*jklmn*pqrst"
         return
2007-01-13 13:18:35 +00:00
Przemyslaw Czerpak
3fd903247e 2007-01-07 05:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbusage.c
  * harbour/source/compiler/ppcomp.c
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/vm/macro.c
  * harbour/source/vm/memvars.c
  * harbour/source/vm/memvclip.c
    * keep prefix definition for bison public symbols in *.y files instead
      of passing them as bison arguments to avoid possible mistakes during
      *.yy[hc] file generation
    ! fixed iif() reduction when used as single function parameter
    + add -kM compiler switch - turn off macrotext substitution
    * updated <string> + <string> optimization and other macrotext usage
      to keep more Clipper compatible behavior
    ! fixed typo in expression type checking in IIF() reduction - it was
      working because wrongly used macros has the same values as the valid
      ones
    - removed compiler switches and macros for old HB_INLINE() syntax - it
      was not supported after last months modifications. Only:
         HB_INLINE([params,...]) { C code }
      is supported.
    ! fixed passing parameters by reference in IIF() statement and macro
      compiler. The following valid Clipper code:
         &("myfunc(<exp>, @var1, @var2)")
      was not supported
    ! do not allow to use references or empty expressions in expression list
      AFAIK it's Clipper compatible. If I'm wrong then please fix me but
      Clipper allows to use references only as function arguments, 2-nd and
      3-rd IIF() argument and as directly created array items ( {...@var...} )
      DO ... WITH ... is a special case of function call.
    ! Changed grammar rules to accept only Clipper compatible parameters.
    ! fixed typo in macro name in hb_memvarNewParameter() function.
    * use HB_FUNC_EXEC(...) instead of HB_FUNCNAME(...)()
2007-01-07 04:09:09 +00:00
Przemyslaw Czerpak
386c27f01f 2007-01-05 16:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * make function call optimizations only when hb_compFunCallCheck()
      do not report errors

  * harbour/source/common/reserved.c
    + added VALTYPE to list of reserved words and shortcuts (Clipper
      compatible)

  * harbour/source/compiler/hbfunchk.c
    * checking for number of parameters in FILE() function call is Harbour
      extension - do not enable it when HB_C52_STRICT macro is set

  * harbour/source/rtl/filehb.c
    * formatting
2007-01-05 15:01:11 +00:00
Przemyslaw Czerpak
9d263b1141 2007-01-05 08:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
     + added comment

  * harbour/include/hbexpra.c
     * change expression type for <exp> = <exp> from HB_EO_EQUAL
       to HB_EO_ASSIGN in hb_compExprGenStatement() function so
       later we can safely make all optimization in hb_compExprUseEqual()
       during reduce process - optimization only when PCODE is generated
       is too late and causes that expressions like:
         iif( 1 = 1, <exp>, <exp> )
       are not reduces (Clipper reduce them)
     * do not execute hb_compFunCallCheck() in hb_compExprNewFunCall()
       to avoid repeating the same error message in hb_compExprUseFunCall()

  * harbour/include/hbexprb.c
     * enabled reduction for hb_compExprUseEqual() and generate errors
       when it's used as statement

  * harbour/source/common/expropt2.c
     * added some missing reductions for expressions like: NIL == NIL

  * harbour/source/common/reserved.c
     % very basic optimization: use binary search instead of linear
       scanning for reserved words and shortcuts - it gives noticeable
       speed improvement in macro compiler

  * harbour/source/compiler/complex.c
     * changed the order of special keywords to keep alphabetic sorting

  * harbour/source/compiler/harbour.c
     % some minor optimizations in aliased expressions
     ! added protection in hb_compIsJump() to avoid possible problems
       when this function is executed after replacing some code with
       jumps by series of NOOPs in optimizations process

  * harbour/source/compiler/hbfix.c
     * better optimization of PCODE generated for logical expressions

  * harbour/source/compiler/hbfunchk.c
     % use binary search instead of linear scan

  * harbour/source/rtl/minmax.c
     ! fixed GPF when MIN() or MAX() function is called with less then
       two parameters

  * harbour/source/vm/itemapi.c
     * minor optimization and formatting
2007-01-05 07:41:20 +00:00
Przemyslaw Czerpak
647e9281bf 2006-12-30 22:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/macro.c
    * final grammar cleanup: removed unused and/or unnecessary grammar
      expressions in *.y files, fixed some differences between compiler
      and macrocompiler, fixed some other bugs, typos, clipper
      incompatibilities, etc.
      It's end of year, it's late and sorry but I'd like to begin making
      something absolutely differ then creating detail description ;-)
      If you will have any questions then I'll answer in new year.

  * harbour/source/rdd/dbffpt/Makefile
    * small hack for XCC compilation

best regards and happy new year,
Przemek
2006-12-30 21:51:33 +00:00
Przemyslaw Czerpak
40999edb49 2006-12-28 16:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbpcode.h
  * harbour/include/hbpp.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
    * changed HB_P_MACROPUSHINDEX PCODE behavior - now it does not evaluated
      macro expression
    * eliminated HB_ET_MACRO_INDEX - HB_ET_MACRO_LIST can be used instead
    * accept ... in codeblocks only when codeblocks parameters are defined
      as variables, f.e: {|a,b,...|qout(a+b,...)}
    ! fixed error in a[&s]:=100
    + added support for a[...] - now ... can be used in the same context as
      xbase++ like multivalue macro (a[&s])
    * disabled ++, --, <op>= optimizations when -kc (strict Clipper
      compatibility mode) compiler switch is used
2006-12-28 15:44:41 +00:00
Przemyslaw Czerpak
88716ffc11 2006-12-27 21:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
    * removed not longer used pFunCall from asMacro expression.
      This item was used only in a very old s:="1,2";f(&s) implementation.

  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    * a little bit more simple implementation of passing optional arguments
      and simplified some code. Now they can be used in any place in argument
      list (also repeated). It's also possible to create arrays using "..."
      as array element(s), f.e.: func f(...); return { "{", ..., "}" }
      If you think it will be usable then I can also add support for accessing
      array items with optional parameters, f.e.: ? a[ ... ]
      so it can be used in the same context as xbase++ like macro lists
      but for this I will need new PCODE so I'd like to hear your opinion
      ASAP - I'm closing any extensions today.
2006-12-27 20:17:22 +00:00
Przemyslaw Czerpak
7a13cae5e3 2006-12-27 15:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/vm/hvm.c
    + added support for passing optional parameters to called function, f.e.:
         proc p( a, b, ... )
         qout( a, b, "X", ... )
    * forbid creating function pointer when function is used with parameters,
      f.e.: x:=@f1(1,2,3)

  * harbour/source/compiler/complex.c
    * cleaned all restrictions on reserved words I've found - if I missed
      sth then please inform me. The previous behavior and some error
      messages are used with -kc compiler switch

  * harbour/source/rtl/symbol.prg
  * harbour/source/rtl/tobject.prg
    ! eliminated limitations in number of constructor parameters
      (new syntax with passing optional parameters used)
2006-12-27 14:01:52 +00:00
Przemyslaw Czerpak
3df896f666 2006-12-24 16:54 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbcomp.c
    - removed not longer used fExternal from compiler structure
    * allow to pass array items by reference ( func(@a[1]) ) and some
      cleanups in reference rules. Probably we should also block using:
         @func(param1 [,param2,[,...paramN]])
      and accept only @func()
    ! fixed using statements in codeblocks used to initialize static
      variables and some other cleanups (f.e. allow to use as static
      initializers any functions which are later eliminated by expression
      optimizer.
2006-12-24 16:12:13 +00:00
Przemyslaw Czerpak
4efdbba99b 2006-12-23 06:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    * do not generate HB_P_FUNCPTR - it's not longer necessary
    + added optimization for <exp> + 1, <exp> - 1 - disabled by default
      because it changes error messages in hbtest, code like NIL + 1
      generates 'argument error ++' instead of 'argument error +'. I'd like
      you will decide what you prefer - faster code or strict Clipper error
      messaged.

  * harbour/source/common/expropt2.c
    + added optimizations for <num> + <date>
    + added ooptimizations for <exp> + 0, 0 + <exp>, <exp> - 0
      This is also sth what may interact with operators overloading in object
      system. When we will have strong typing then we should think about an
      option which will optionally disable some optimizations - someone may
      want to define arithmetic where <obj> + 0 gives differ then <obj>
      results.

  * harbour/include/hbcomp.h
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
    + added hb_compStatmentStart()
    ! restrict MEMVAR and FIELD usage - now they have to be located before
      executable statements like in Clipper.
    ! generate error when PARAMETERS is used as file wide declaration.
    ! generate errors when different executable statements are used before
      first procedure - now such code was simply ignored without any errors.
    ! generate valid error messages when some declarations are used in
      wrong places
    ! fixed setting begin of executable statement flag in different .prg
      constructions.
2006-12-23 05:00:33 +00:00
Przemyslaw Czerpak
2cdb32d6c3 2006-12-22 11:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/adsfunc.c
    * do not use hb_param( pItem, HB_IT_BYREF ) but ISBYREF() macro

  * harbour/include/hbdefs.h
    * formatting

  * harbour/include/hbexprb.c
    ! fixed code generated for logical expressions when shortcutting
      is enabled to be Clipper compatible

  * harbour/source/compiler/cmdcheck.c
    ! added missing break in -z compiler switch decoding

  * harbour/source/compiler/hbfix.c
    % added optimizations for code generated for logical expressions,
      it strips a chain of HB_P_DUPLICATE -> HB_P_JUMP[TRUFALES] ->
      HB_P_DUPLICATE -> HB_P_JUMP[TRUFALES] -> ...
      In fact it should not be done here but because we do not have
      any metacode level where such optimizations should be done and
      PCODE is generated online then it will have to be here. Maybe
      in the future we will add metacode.

  * harbour/source/rdd/dbcmd.c
    * make "M" alias Clipper compatible. After some thoughts I decided
      that in some cases it can be usable so now "M" will set WA number
      to 65535 like in Clipper.

  * harbour/source/rdd/dbf1.c
    * allow to open VFP DBFs with _NullFlags system command

  * harbour/source/rdd/delim1.c
  * harbour/source/rdd/sdf1.c
    ! updated field size calculation for some some extended types.

  * harbour/source/rdd/workarea.c
    * generate RT error when CREATEFIELD() method does not accept some
      parameters to avoid silent DBCREATE() failing.

  * harbour/source/vm/macro.c
    * removed hb_compMemvarCheck() - this function was not dooing
      anything - only slows the TYPE() by calling hb_dynsymFind()
      one or two times.
    + added TODO note: memvars create by TYPE() have PUBLIC scope
      in Clipper. Clipper also always tries to evaluate valid expressions
      inside TYPE even if the contain UDF. UDF only stops evaluation
      so:
         TYPE( "(val:=1) + f() + (val2:=2)" )
      creates in clipper public variable VAL but not VAL2.
2006-12-22 10:07:21 +00:00
Przemyslaw Czerpak
cc4f5d5b59 2006-12-19 22:47 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
    + added hb_compExprParamListLen()

  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
    * use hb_compExprParamListLen()

  * harbour/include/hbexprc.c
    * generate error message for syntax like:
         o:var()++ or o:var()+=10
      only:
         o:var++ and o:var+=10
      is supported, just like for @o:var

  * harbour/include/hbapi.h
  * harbour/source/common/hbstr.c
    + hb_numDecConv() used to convert double value to/from binary integer
      fields with fixed number of decimal places

  * harbour/common.mak
  * harbour/include/hbapicdp.h
  * harbour/source/codepage/Makefile
  + harbour/source/codepage/cptrdos.c
  + harbour/source/codepage/cptrwin.c
  * harbour/source/lang/Makefile
  + harbour/source/lang/msgtrdos.c
  + harbour/source/lang/msgtrwin.c
    + added Turkish CPs and MSGs created by Bicahi Esgici
  + harbour/source/codepage/uc1254.c
  + harbour/source/codepage/uc857.c
    + added unicode tables for Turkish CPs

  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/workarea.c
    + added support for decimal places in binary integer fields ("I")
    ! fixed currency field decoding ("Y") - it's integer binary value
      not IEEE758 double. Warning: on write the value is rounded not
      truncated like in VFP.
2006-12-19 21:48:45 +00:00
Przemyslaw Czerpak
f63975287b 2006-12-18 19:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/w32/bcc32.cf
    * cleanup
  + harbour/config/w32/xcc.cf
    + added XCC support

  * harbour/contrib/btree/hb_btree.c
    * use hb_vmAtInit()/hb_vmAtExit() instead of INIT/EXIT functions defined
      from C code

  * harbour/contrib/libct/tab.c
    * casting

  * harbour/contrib/odbc/odbc.c
    ! removed #include <malloc.h> - it should not be used with new C
      compilers
      I think that we should replace this library with hbodbc from xHarbour.

  * harbour/contrib/ole/ole2.c
    * updated for XCC

  * harbour/include/hbdefs.h
    * include stdint.h if available

  * harbour/source/compiler/complex.c
    ! fixed yet another stupid mistake in WITHOBJECT token

  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/vm/hvm.c
    + added HB_P_SWAP <n> PCODE

  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
    ! fixed GPF during compilation of @:var, @:&var, @o:&var
    + added support for @o:&var and @:var, @:&var inside WITH OBJECT
      statement
    * changed PCODE generated of ++,--,+=,-=,...
      Now left side expression is evaluated _ONLY_ once and when object
      messages are used it's guarantied that exactly the same object
      variable will be used. It also fixes some problems which exists
      in Clipper. This optimization is enabled by -kh flag (by default)
      and can be disabled with -kc.
    % optimize ald macros in ++,--,+=,-=,... operations
    * add automatically "_" prefix when macro message is used in assignment
      context, f.e.:
         s:="osCode"
         o:=errorNew()
         ? o:&s
         o:&s := 100
         ? ++o:&s
         ? o:&s *= 5

  * harbour/include/hblang.ch
    - removed #xtranslate - this file is included by C code and some C
      compiler do not like unknown directives

  * harbour/utils/hbtest/rt_math.prg
    + added test code for <op>assign and (pre/post)(inc/dec)rementation,
      macro messages and WITH OBJECT

  * harbour/source/compiler/harbour.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rtl/errorapi.c
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtdos/gtdos.c
  * harbour/source/rtl/gtos2/gtos2.c
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/rtl/gtstd/gtstd.c
  * harbour/source/rtl/gtwin/gtwin.c
    * casting and warning cleanup

  * harbour/utils/Makefile
    + added $(HB_UTILS)

  - harbour/utils/hbpp/hbpp.h
  + harbour/utils/hbpp/hbppdef.h
  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/hbpptbl.c
  * harbour/utils/hbpp/pragma.c
    * renamed hbpp.h to hbppdef.h to avoid possible conflict with hbpp.h
      in include directory
    * casting and warning cleanup
2006-12-18 18:34:44 +00:00
Przemyslaw Czerpak
bdb38dde43 2006-12-15 16:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbdefs.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/common/hbstr.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/rtl/console.c
  * harbour/source/rtl/isprint.c
  * harbour/source/rtl/left.c
  * harbour/source/rtl/right.c
  * harbour/source/rtl/strtran.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
    * general PCODE cleanup and address most of TODO/TOFIX notes in
      source code:
      ! fixed GPF traps when too long string or codeblock is generatd
      + added support for 16MB codeblocks and strings
      ! removed macrocompiler limitation for jumps range
      ! fixed GPF when more then 255 local variables is used and added
        support for 2^15 locals
      ! removed all strtok() functions
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is variable or array item
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is object method and updated ++, --
        for new code. It's still disabled until we will not add support
        for late evaluated reference items to HVM
      ! fixed a[++i]++ and similar operations (a[++i]*=2, ...). Now ++i is
        executed only once. It's not Clipper compatible but it was in
        TODO note in source code. It can be disabled by -kc option
      * finished support to xHarbour like #pragma TEXTHIDDEN(1)
      ! fixed local add int optimization when PARAMETERS used after
        optimization changed local variable number over 255
      ! fixed GPF trap when in HB_P_<op>EQ PCODEs when executed for
        direct values
      * others
    ! fixed problems reported by Chen
    * optimized strtran(), left(), right() to not create new string copy
      when the same value is returned
2006-12-15 15:54:28 +00:00
Przemyslaw Czerpak
22159d57b5 2006-12-13 18:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/console.c
    * pacify false CG error messages - Chen Kedem modifications (sizeof(int)
      in #if replaced by hardcoded 4 for compilers which does not allow to
      use sizeof() in #if directives)

  * harbour/TODO
    - removed console.c cleanup note from TOFIX

  * harbour/include/hbcomp.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/source/common/expropt1.c
    * minor code cleanup
2006-12-13 17:46:43 +00:00
Przemyslaw Czerpak
4dfc616250 2006-12-01 18:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/pack_src.sh
    + added packing *.yy[ch] files

  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbpp.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/pp/ppcore.c
    + added hb_comp prefix to grammar/lexer compiler public functions to
      reduce possible conflict with 3-rd party code which may use default
      yy prefix.
    ! do not use bison destructors for expressions. Internal bison logic
      cannot properly detect if expression was used or not in some of our
      grammar rules and it's possible that some expressions will not be freed
      and some other freed twice.
    ! added protection against multiple destructors execution for CBSTART
      and LITERAL tokens
    * added small garbage collector for deallocating expressions which were
      not freed (such situation can happen in syntax errors)
    % some optimizations in used structures to reduce their sizes
    + added protection against execution PCODE optimizations for functions
      which were not cleanly compiled.

  * harbour/source/rtl/idle.c
    * use const in nanosec() timeout declaration
2006-12-01 18:00:53 +00:00
Przemyslaw Czerpak
33ccad6661 2006-11-27 02:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/tests/codebl.prg
  * harbour/tests/langmsg.prg
  * harbour/utils/hbpptest/pp_test.prg
  * harbour/utils/hbpptest/pretest.prg
  * harbour/samples/pe/license.txt
    * removed carriage return (\r) characters

  * harbour/include/hbcomp.h
  * harbour/include/hbapi.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/vm/macro.c
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/ppcomp.c
    * separated HB_COMP and HB_MACRO definitions and added HB_COMMON
      structure used when HB_COMMON_SUPPORT macro is set
    * hide HB_MACRO internal definitions in hbapi.h when HB_MACRO_SUPPORT
      is not set
    These modifications should help in future compiler and macro compiler
    integration into single binary.

    + added clipper compatible error message in unclosed structures
      In general we should cleanup rules to make error reporting more
      user friendly and Clipper compatible
    % eliminated unnecessary allocations
    + added int mode member to common part of HB_COMP and HB_MACRO
      structure. It's initialized to HB_MODE_MACRO or HB_MODE_COMPILER
    + add TOFIX note about memory leaks in cParamTypes and pParamClasses
      members of COMDECLARED structure. It's a part of unfinished strong
      typing code. I do not know what Ryszard plan to do with it so I'm
      leaving it as is. The part of strong typing which were operating
      on emulated HVM stack has been removed.
    * removed static variables from genjava.c. Also gencli.c and genobj32.c
      should be fixed but this will not make this code working so I haven't
      touched it.
    * changed 3-rd parameter of hb_compIdentifierNew() from BOOL to int.
      Now it can have the following values: HB_IDENT_STATIC, HB_IDENT_FREE,
      HB_IDENT_COPY. This modification will allow in the future using common
      for static and dynamic symbol hash table without additional source code
      changes. I also plan to use identifier hash table in PP the reduce
      number of memory allocations and speed-up preprocessing by using
      second level hashing for hash keys.

  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
    * changed HB_MACRO_SUPPORT to HB_COMMON_SUPPORT to automatically detect
      possible conflicts between compiler and macro compiler
    ! removed first detected conflict which existed for long time
    + added hb_compExprMacroAsAlias() function to convert HB_ET_VARIABLE
      expression to HB_ET_ALIAS.

  * harbour/source/macro/macro.y
    ! fixed using prefix&macro-> and &macro.sufix-> when macro cannot be
      substituted by compiler, f.e.:
         M->v := NIL
         x := "&v.1->fld"
         M->v := "v"
         M->v1:= "data"
         ? &x
    ! fixed memory leak in macro substituted expression compilation

  * harbour/source/vm/macro.c
    ! fixed initialization of some HB_MACRO members
    ! fixed value returned for type("&V->F") when alias does not exist
    - removed not longer used hb_comp_bShortCuts global variable
2006-11-28 01:10:34 +00:00
Przemyslaw Czerpak
a9fd83033c 2006-11-25 20:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
    ! fixed parenthesis in expression

  * harbour/source/pp/ppcore.c
    ! fixed code block tokens stringify
2006-11-25 19:01:59 +00:00
Przemyslaw Czerpak
74deff4644 2006-11-25 19:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/macro/macro.y
    + added support for strings with with ASCII NUL character
      Strings with ASCII NUL character are not stored with hash table
      but dynamically allocated/deallocated
    ! fixed compilation of strings with ASCII NUL character which
      can appear in escaped strings e"..." or after compiler chr(0)
      optimization
    % removed some not longer necessary memory allocations

  * harbour/source/vm/macro.c
    ! fixed GPF caused by HB_MACRO structure double freeing
    - removed some code which was added as workaround for the old
      behavior of HVM QUIT and false FM stat memory leak reports.
      It's not longer necessary in current HVM.

  * harbour/source/common/hbstr.c
    ! fixed final string size calculation in extended strings

  * harbour/source/compiler/gencli.c
    * cleaned BCC warning
2006-11-25 18:33:28 +00:00
Przemyslaw Czerpak
e6a3baea64 2006-11-24 19:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/bsd/gcc.cf
  * harbour/config/darwin/gcc.cf
  * harbour/config/dos/djgpp.cf
  * harbour/config/dos/owatcom.cf
  * harbour/config/hpux/gcc.cf
  * harbour/config/linux/gcc.cf
  * harbour/config/linux/owatcom.cf
  * harbour/config/os2/gcc.cf
  * harbour/config/sunos/gcc.cf
  * harbour/config/w32/bcc32.cf
  * harbour/config/w32/gcc.cf
  * harbour/config/w32/mingw32.cf
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbver.h
  * harbour/source/common/hbstr.c
  * harbour/source/common/hbver.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.c
  - harbour/source/compiler/harbour.simple
  - harbour/source/compiler/harbour.slx
  - harbour/source/compiler/harbour.sly
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbgenerr.c
  - harbour/source/compiler/hbslex.c
  - harbour/source/compiler/hbstrong.c
  * harbour/source/compiler/hbusage.c
  - harbour/source/compiler/simplex.c
  * harbour/source/macro/Makefile
  - harbour/source/macro/macro.slx
  - harbour/source/macro/macroslx.c
  * harbour/source/pp/ppcore.c
  * harbour/utils/hbpp/hbppcomp.c
    - removed SIMPLEX references
    ! fixed memory leak in request _GET_
    * use hb_compIdentifiersNew() in INLINE and AUTOOPEN structures
      members
    * eliminated all internal exit() calls. Now hb_compGenError() with
      fatal errors does not interrupt application but only sets
         HB_COMP_PARAM->fExit = TRUE;
      What should cause silent clean application close.
      Please keep it in mind making future modifications and do not
      introduce and exit() function call.
    + added support for \x<hex> and \<oct> quoting in extended strings
      (just like in C). Warning !!!. Embedded 0 bytes are supported by
      PP, lexer and expression optimizer but not by bison. To make them
      working it will be necessary to change Literal terminal symbol
      holder and add length field in bison rules and also change the hash
      table used to hold identifiers, literals and macros to store and use
      real string length. If someone will try to use strings with embedded
      0 now then they will be cut but nothing worser should happen.
2006-11-24 18:10:07 +00:00
Przemyslaw Czerpak
9cd2098d6d 2006-11-23 20:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  + harbour/include/hbcompdf.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpp.h
  * harbour/include/hbvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genjava.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbcomp.c
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbfunchk.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/ppcomp.c
  * harbour/source/macro/macro.y
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
  * harbour/source/vm/cmdarg.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/fm.c
  * harbour/source/vm/macro.c
  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbpp.h
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/pragma.c
    * changed the internal compiler API to be MT safe.
      All global and static non constant variables replaced by
      HB_COMP structure which have all compiler context settings.
      It's possible to allocate simultaneously many compiler contexts
      and compile code. Only constant/read only variables are shared.
      In macro compiler HB_COMP is replaced by HB_MACRO.
      In source code I everywhere used to macros: HB_COMP_DECL and
      HB_COMP_PARAM which are equivalents of old HB_MACRO_DECL and
      HB_MACRO_PARAM definitions.
      We will only have to change compiler FATAL errors support to
      not execute exit() for non batch systems.
    * make macro compiler fully MT safe
    * removed not longer used definitions and variables
    ! add direct accessing to PP line number information - it fixes missing
      line numbers reported recently
    ! added generating .ppo files when tokens are teken directly by compiler
      - it fixes empty .ppo file problem
    ! clear hb_stack internall variables after removing hb_stack to avoid
      possible GPF if application still works and try to access unexsiting
      hb_stack
    ! do not allocate new memory block when final FM statistic report is
      generated - it fixes problem with GPF when application compiled with
      FM statistic exits and CLIPPER envvar is set.
    ! fixed memory leak hb_cmdargCheck()
    ! added to harbour.y symbol destructors - it should fixes memory leaks
      in syntax errors but it uses quite new bison feature which is not
      fully supported yet. Unfortunately it's also not MT safe and the
      destructors implementation in 1.875c does not respect %parse-param.
      Bison documentation says that it should so I hope it will be fixed
      soon (or maybe even already is in the newest bison versions) before
      I'll add multi context compilation support. If not then I will have
      to add some workaround. I can pass compiler context pointer inside
      YYSTYPE using hack in a lexer but it will force really huge number
      modifications in existing bison rules so probably it will be much
      easier to fix bison or write a small tool to update generated parser.
    * other modifications - the total size of patch is nearly 1MB and
      detail description will have to take me few days.
2006-11-23 18:57:54 +00:00
Przemyslaw Czerpak
0cada37011 2006-11-21 03:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
  * harbour/source/compiler/Makefile
  * harbour/include/hbcomp.h
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.slx
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hbident.c
  * harbour/source/compiler/ppcomp.c
  + harbour/source/compiler/complex.c
    + added new PP based compiler lexer - it's smaller, MT safe and a
      little bit faster then then the FLEX version.
    + added HB_COMP structure to hold compiler data in future MT version
    + added global variable HB_COMP_PTR hb_comp_data to make conversion
      to MT easier - now it holds only PP and lexer data.
    * update PP related code in compiler to be MT safe
    + added %pure-parser, %parse-param and %lex-param for bison to generate
      MT safe grammar parser.
    * updated FLEX to work with recent compiler modifications and pure-parser
      bison API

  * harbour/makefile.bc
  * harbour/makefile.vc
  * harbour/source/macro/Makefile
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
  * harbour/source/macro/macrolex.c
    * use hb_macro prefix instead of hb_comp in bison/flex parser/lexer
      used in macro compiler to avoid possible conflicts in the future
    * separated lexer data

  * harbour/include/hbapi.h
  * harbour/include/hbpp.h
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
  * harbour/source/vm/macro.c
    * removed not used members from HB_MACRO structure to make it
      cleaner before creating common to compiler and macro compiler
      structure
    + added new token HB_PP_TOKEN_EPSILON
    + added void * cargo parameters passed to executed user functions
    + hb_pp_tokenGet(), hb_pp_tokenToString(), hb_pp_tokenBlockString()
      functions for new PP based compiler lexer

  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbpp.h
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/pragma.c
    * updated to compile with recent compiler header file modifications


    PP, new lexer and most of grammar parser should be MT safe. Now we should
    update all compiler functions to pass pointer to HB_COMP data structure
    where we should all current global variables. This structure as first
    member should have HB_CMPCOMMON structure which will hold common to
    compiler and macro compiler data. Ryszard I think you are the best person
    to define this structure.

    We have new lexer which is MT safe but please note that it has to be
    extensively tested so I would like to ask everybody to compile as much
    as possible different code and check if the final programs work as
    expected. Working on new code I removed some limitations existing in
    FLEX though not all. At the beginning I tried to replicate the exact
    FLEX behavior but I've found that in few places it does not work as
    it should so I begin to encode rules in a way which remove some
    limitations. In fact now it's much easier to control some things.
    I kept the FLEX code working and made all necessary modifications
    so it still can be used but keeping FLEX working cost us IMHO too
    much. It's not possible to introduce some improvements to grammar
    parser. All identifiers, keyword and macros returned by new lexer
    are converted to upper letters, do not have to be freed by hb_xfree()
    and is guarantied that will be always accessible. So from grammar file
    we can remove all hb_compIdentifierNew( hb_strupr($1), TRUE ) what
    should give noticeable speed improvement but will break the FLEX code.
    Ryszard and other you will have to decide if we will support FLEX in
    the future. We can also clean the code and remove most of other
    redundant hb_strupr() and hb_strdup() used in many places. BTW only
    one terminal symbol can be returned with lower letters: DOIDENT
    and I make it intentionally so it's possible to use:
         DO prog1 WITH "sth"
    on case sensitive file systems so this symbol should be cloned in
    upper cases as function symbol but used without modification as
    file name. It's current behavior but I'm not sure you will want
    to keep it. Maybe compiler switch to always convert file names
    created from
         DO <id> [WITH <params,...>]
    to lower cases will be better. Please think about it.
2006-11-21 02:29:33 +00:00
Przemyslaw Czerpak
403fd7f29e 2006-11-18 15:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macrolex.c
    * do not allocate separate memory in macro compiler for terminal
      symbols which needs string representation - it fixes some set
      of memory leaks and increase a little bit macro compilation
    ! fixed accessing freed memory in:
         private cMacro := "cEarly", cEarly := {"Early"}
         @ 12,10 GET &cMacro[1]
    ! fixed GPF in:
         p:=@left()
      and similar expressions

  * harbour/source/common/expropt2.c
    % minor modification

  * harbour/source/compiler/harbour.c
    ! fixed HB_TRACE message
2006-11-18 14:37:18 +00:00
Przemyslaw Czerpak
c448973306 2006-11-15 14:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
    + added
         void * pLex;
      member to HB_MACRO structure - it will be necessary for MT safe
      macro parser

  * harbour/include/set.ch
  * harbour/include/hbexprb.c
  * harbour/source/macro/macro.l
  * harbour/source/macro/macro.y
    * indenting, formatting and converting tabs to spaces

  * harbour/include/hbpp.h
  * harbour/source/compiler/ppcomp.c
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
    * make HB_PP_TOKEN structure public for other code and changed
      public PP API to not force including static rules by programs
      which does not need them.
    + added basic API for using PP as lexer
    * divided HB_PP_TOKEN_MACRO to HB_PP_TOKEN_MACROVAR and
      HB_PP_TOKEN_MACROTEXT and mark
         [<keyword>][&<keyword>[.[<nextidchars>]]]+
      as HB_PP_TOKEN_MACROTEXT not pair HB_PP_TOKEN_KEYWORD and
      HB_PP_TOKEN_MACRO
      It allows easier integration PP as (macro)compiler lexer and
      fixes preprocessing [<keyword>][&<keyword>[.[<nextidchars>]]]+
      in some patterns.

  * harbour/utils/hbtest/Makefile
    + added PP library to linked library list

  * harbour/source/macro/macro.y
    + added seaport to use PP as lexer. It's disabled by default and
      can be enabled using by defining HB_PP_MACROLEX. It eliminates
      using FLEX or SIMPLEX lexer in macro compiler. Now it emulates
      the behavior of FLEX lexer because I wanted to minimize the
      modification but in fact because parsed token are freed when
      macro compiler finish its job then we can resolve RT memory
      leaks which apear during parsing wrong expressions. It will be
      enough to drop allocating memory for new terminal symbols and
      using them as is like in compiler. It will also quite nice
      simplify include/hbexpr*.c code and will allow to move some
      functions to COMMON library. I want to make also pure compiler
      code MT safe so I will have to add passing pointer to a structure
      with compiler context just like in macro compiler. It means that
      if we define a structure which will be common to compiler and macro
      compiler with local (not common) data stored in other structure for
      which will will keep only a pointer then we will be able to move most
      of include/hbexpr*.c code to common library. But I do not want to
      make farther modification without consultation without Ryszard.
      Also to make PP default lexer some farther modifications should
      be done in core PP code and include/hbexpr*.c files to not reduce
      the speed. Now using HB_PP_MACROLEX for sure will have to cause
      speed reduction in macro compiler. But if we make necessary
      modifications then we should keep at least the same speed or
      probably reach noticeable better results.
2006-11-15 13:21:20 +00:00
Przemyslaw Czerpak
b560fd5a77 2006-11-14 13:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/TODO
    * removed to resolved problems from TODO/TOFIX list

  * harbour/include/hbexprb.c
    * indenting and tab to spaces conversion

  * harbour/source/compiler/ppcomp.c
    ! fixed typo which cased that dump buffer was not ended
      with \0 character
2006-11-14 12:51:34 +00:00
Ryszard Glab
64509ea871 + added support for passing methods as macro
eg:
         o:&send()
         o:&send.end()
         o:&(expr)()
         o:&var++
         o:&var := 0
         o:&(expr)++
         WITH OBJECT obj
            ++:&var
            :&var += :&(var2+"oo")
         END

   NOTICE:
   For simple assigments (=,:=), compound assignments (+=,-=,*=,/=)
   and for pre/post increment operators( ++,--) the macro should
   evaluate to a symbol that starts with underscore '_'.
     To access a variable the macro should evaluate to a symbol
   with no '_' char.
2006-09-29 08:59:17 +00:00
Ryszard Glab
5ba81a153a 2006-09-26 17:00 UTC+0100 Ryszard Glab <rglab//imid.med.pl>
* include/hbexprb.c
   * source/compiler/exproptb.c
   * source/compiler/harbour.y
      *added support for passing the reference to object's variable
      e.g.
      foo( @obj:var )
2006-09-26 14:43:20 +00:00
Viktor Szakats
3ef6c5f724 2006-09-20 23:17 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/include/hbexprb.c
   * harbour/include/hbexprop.h
   * harbour/source/common/expropt2.c
     % Compile-time optimization added for expressions below:
       SToD(""), SToD(), HB_SToD(<cDate>), HB_SToD(""), HB_SToD()
     ! Tabs converted to spaces.

   * harbour/source/common/hbdate.c
   * harbour/source/rtl/dates.c
     * Copyright cosmetic cleanup.
2006-09-20 21:26:13 +00:00