Commit Graph

6825 Commits

Author SHA1 Message Date
Viktor Szakats
a09dc85fbe 2006-09-17 18:52 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/tests/testrpt.prg
     ! Fixed fatal typo.
2006-09-17 16:58:39 +00:00
Przemyslaw Czerpak
24159987a2 2006-09-17 18:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* xharbour/include/hbvm.h
  * xharbour/source/vm/hvm.c
    + added hb_vmPushDynSym( PHB_DYNS )
      It should allow most applications to not use [P]HB_SYMB at all.
      Removing PHB_SYMB from 3-rd party .c code may allow us to add
      freeing unused symbol tables from HVM in the future.

  * harbour/source/vm/classes.c
    * temporary restored hb_objGetpMethod()
    + added __ClsCntClasses()
    ! allocated real methods for OnError and Destructor to keep
      the same behavior in these methods as in any others, f.e.
      scoping checking or debugging.

  * harbour/common.mak
  * harbour/utils/hbtest/Makefile
  * harbour/utils/hbtest/hbtest.prg
  + harbour/utils/hbtest/rt_class.prg
    + added tests for our classy code. Now destructors and instance
      area allocating/casting. Some other in the future.
2006-09-17 16:54:04 +00:00
Przemyslaw Czerpak
ff658ccfec 2006-09-16 23:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
    * synced with recent Brian fixes in xHarbour

  * harbour/include/hbapi.h
    + added 'method' member to hb_struBlock structure

  * harbour/source/vm/hvm.c
    * initialize 'method' member in hb_struBlock structure

  * harbour/source/vm/proc.c
    * changed the name of last parameter of hb_procname() from
      bSkipBlock to fMethodName and modified to use information
      about the class of executed codeblock from new hb_struBlock
      members

  * harbour/source/vm/classes.c
    * removed hb_objGetpMethod() - I hope it's not longer used
    * added real codeblock scoping.
      In Clipper there is no information where the codeblock where
      created and what priviladges/scopes it should has.
      Class(y) to resovle this problem when codeblock is executed scans
      the HVM stack for the nearest method call and takes scopes defined
      for this method. It's a workaround which allow to break standard
      access rights though seems reasonable when it's not possible to
      store information where the block is created. I've added to block
      item structure information about class and method where code block
      was created so we can use the exact method priviladges.
      Now Harbour classy code can work exactly like Class(y) when compiled
      with -DHB_CLASSY_BLOCK_SCOPE and with real code block scoping when
      compiled with -DHB_REAL_BLOCK_SCOPE. I set the second (real code
      block scopes) as default. If you think we should be strict Class(y)
      compatible here then please inform me and I'll change default setting.

  + tests/clsscope.prg
    + added demonstration/test code for class method scoping
2006-09-16 21:24:06 +00:00
Przemyslaw Czerpak
fe3786511e 2006-09-15 21:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/arrays.c
  * harbour/source/vm/classes.c
    ! fixed multiple use of supercasted object I broke in last commit
    * removed some unused code and moved some scoping checking to
      class creation code
2006-09-15 19:14:32 +00:00
Przemyslaw Czerpak
f22f040335 2006-09-15 13:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    + added hb_vmRequestReenter() and hb_vmRequestRestore()
    + added executing destructors when some exception is active
      I forgot about it in previous commit.

  + harbour/tests/destruct.prg
    + added example/test code for object destructors
2006-09-15 11:28:48 +00:00
Przemyslaw Czerpak
a35053003b 2006-09-15 04:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/doc/destruct.txt
    + added description for object destructors in Harbour

  * harbour/include/error.ch
    + added new error code EG_DESTRUCTOR

  * harbour/source/lang/msgpl852.c
  * harbour/source/lang/msgpliso.c
  * harbour/source/lang/msgplmaz.c
  * harbour/source/lang/msgplwin.c
  * harbour/source/rtl/langapi.c
    + added desription for new error code - other language modules
      have to be updated

  * harbour/include/hbapi.h
    + added hb_gcRefCheck() and cover some hb_gc* functions by
      _HB_API_INTERNAL_ macro

  * harbour/source/vm/itemapi.c
    ! fixed possible RT error generation when some exception is active

  * harbour/include/hbapicls.h
  * harbour/include/hbclass.ch
  * harbour/include/hboo.ch
  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/arrays.c
  * harbour/source/vm/classes.c
    + added support for object destructors

  * harbour/source/vm/garbage.c
    + added support for object destructors
    + added logic to detect buggu .prg code which uses destructors
      see doc/destruct.txt for more info.
      It's also possible that this code will exploit some bugs
      in other code which uses GC allocated memory blocks.
2006-09-15 03:10:38 +00:00
Viktor Szakats
27ccee95a1 2006-09-14 15:23 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/tests/testlbl.prg
     ! use lower name in report name to work properly on case sensitive
       file systems
2006-09-14 13:24:26 +00:00
Przemyslaw Czerpak
c35391da65 2006-09-14 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/garbage.c
    * minor cleanup

  * harbour/source/rtl/cdpapi.c
  * harbour/include/hbextern.ch
    + added HB_CDPLIST() - it returns array with all registered CODEPAGEs

  * harbour/source/rtl/set.c
    ! fixed typo in _SET_DEFEXTENSIONS

  * harbour/tests/testrpt.prg
    ! fixed syntax
    ! use lower name in report name to work properly on case sensitive
      file systems
2006-09-14 13:09:01 +00:00
Przemyslaw Czerpak
bb15806923 2006-09-13 20:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
    + added __enumStop() message for "FOR EACH" overloading
      It's guarantied that it will be sent to base item if it is an
      object with such message when FOR EACH ... NEXT will finish its job
      even if it will be interrupted by EXIT or RETURN to allow base object
      clear resources allocated for FOR EACH enumerator. The BREAK exception
      is not supported now. This is sth what I'd like to discuss soon when
      I'll add destructors. Please think now if we should allow to execute
      destructors and other cleanup user code when we are returning to
      nearest expection trap (BEGIN SEQUENCE / [ RECOVER /] END) cleaning
      the HVM stack.
2006-09-13 18:37:42 +00:00
Przemyslaw Czerpak
0e68f162e7 2006-09-13 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/genc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/harbour.c
    ! fixed number of compiled functions shown in compilation status
    ! added workaround for GPF in empty #pragma begindump/enddump
      statement
2006-09-13 12:02:57 +00:00
Przemyslaw Czerpak
77d31074e8 2006-09-13 03:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    * keep class shared data in separate array
    + added __CLS_CNTSHRDATA( hClass ) -> nSharedDatas
    % some minor optimizations

  * harbour/tests/clsscast.prg
    + added test code for shared class data allocating and casting

  * harbour/include/hbapicls.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
    + added support for FOR EACH overloading - it's work in progress
      do not create any code which may use current solution - it may
      change in the nearest future
2006-09-13 01:12:18 +00:00
Alexander S.Kresin
509d14e639 2006-09-12 14:48 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> 2006-09-12 10:50:01 +00:00
Przemyslaw Czerpak
6b15fe3ba1 2006-09-12 12:37 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed typo in adding SHARED CLASS VAR ASSIGN messages
    * some minor cleanup
2006-09-12 10:38:17 +00:00
Przemyslaw Czerpak
7463296f9e 2006-09-11 20:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.ch
    * added HB_EXPORT to public functions and some internal covered by
      _HB_API_INTERNAL_ macro

  * harbour/include/hboo.ch
    + added HB_OO_CLSTP_NONVIRTUAL and HB_OO_CLSTP_OVERLOADED

  * harbour/source/rtl/tclass.prg
    ! do not add supercast class messages - now it's done automatically
      by __clsNew() function with proper instance area offset updating
    ! enumerate instance class datas in __clsAddMsg() from 1 - inherited
      instance variables are managed internally by classy code with
      proper instance area offset updating
    ! use __CLS_CNTCLSDATA() as start offset for class data. Do not
      try to calculate it yourself - some of super classes can be ignored
      when they are appear in the inheritance tree more then once so it's
      not possible to calculate class data or instance data start offset
      using simple sum of class or instance variables in super classes.

  * harbour/source/vm/classes.c
    ! fixed instance area casting
    ! fixed class variables casting
    ! fixed multi-inheritance when the same class can apear more then
      once in super classes tree.
    ! Do not add unnecessary instance variables for the same class when
      it's inherited more then once.
    ! Do not add unnecessary class variables for the same class when
      it's inherited more then once.
    ! Do not add unnecessary initialization class and instance variables
    + added support for non virtual messages
    + added support for static and casted scoping
    + super cast messages added automatically. They are used to dynamic
      recalculation of instance are offsets and to avoid multiple inheritance
      of the same class so please do not overload them or you will have as
      result something what we have before recent modifications in the
      instance and class data area. Just simply run tests/clsccast.prg
      and tests/clsicast.prg compiled with current CVS code and last
      release code or with xHarbour and compare the results.
      Also Class(y) does not pass these tests and I do not know if any
      other dynamic OOP model in xbase languages can properly address it.
      BTW maybe I should add RT error when .prg code will try to delete
      or overwrite class cast message. For me it seems to be reasonable
      and what's your opinion?
    * make hidden class members non virtual by default. It can be disabled
      by compiling classes.c with -DHB_VIRTUAL_HIDDEN but IMHO keeping
      HIDDEN members as virtual causes that they are not really HIDDEN
      because subclasses can simply overwrite them. It also means that
      it's not possible to create class with some private data and
      methods which will never interact with any subclass code created
      by other programmers where name conflict can appear. So one of
      the most important OOP features is missing in such case.
      See tests/clsnv.prg as an example for non virtual hidden members.

  + tests/clsicast.prg
    + added test code for proper instance area allocating and casting

  + tests/clsccast.prg
    + added test code for proper class data allocating and casting

  + tests/clsnv.prg
    + added test code for non virtual hidden class members

   Now we should be able to create and class model even replicate the
   static one like in C++ using current class engine which still fully
   supports dynamic bindings. It consumes less memory and due to much
   more efficient hashing it should be faster then it was though some
   other minor optimization can be add and I'll plan to make them in
   some spare time.
   The item type verification in assignment is still missing. I'll add
   it when I'll collect some statistic informantion I'd like to ask
   [x]Harbour users. I need these information to tune some internal
   structures where I can balance between speed and memory allocation
   to statistically optimal form.

   Marek asked me to add passing object datas by reference and I'll do
   that but I'd like to ask Ryszard to add support for:
      @<oVar>:<message>
   to compiler. I'll implement all other HVM modifications. If you can
   please also add support for:
      <oVar>:&<cMsgName>[(...)]
   For this we do not need any HVM modifications or new PCODEs.
   We are supporting xBase++ macro list compilation in:
      cList:="1,2,3"
      x := aVar[ &cList ]
      aVar:={ &cList }
      func( &cList )
   But we do not support:
      <oVar>:<message>( &cList )
   IMHO it looks ugly. If we have this syntax for function call then we
   should also support it in message sending.
   Ryszard can you make necessary compiler modifications?
   I'm also thinking about adding support for variable parameters
      func myfunc(...)
      [...]
      return xVar
   In few cases it will help to encode some function much more efficient
   then now.

   I'll add Class(y) compatible functions used in class(y) header files
   so it will be possible to use original class(y) .ch files in Harbour
   though it will not be the most efficient because we have @func() operator
   which gives better performance then using codeblocks. Anyhow classy
   create separate meta class for each class with CLASS members and
   <clasName>() function always return such meta class object so for full
   Class(y) compatibility we need to generate differ .prg code.
   But all such modifications now can be done on preprocessor and
   .prg level and they will not need .c code modification.
   We should make them to give user interface for our new OOP features.

   Now I'm waiting for reports about any problems with current classy
   code.
2006-09-11 18:14:41 +00:00
Alexander S.Kresin
e10df29fdd 2006-09-11 20:30 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> 2006-09-11 16:31:10 +00:00
Alexander S.Kresin
eee1c71e5e 2006-09-05 16:40 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> 2006-09-11 12:42:06 +00:00
Przemyslaw Czerpak
45033c962e 2006-09-10 14:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    * cleaned BCC warning
2006-09-10 12:29:25 +00:00
Przemyslaw Czerpak
8d11bf8235 2006-09-10 14:02 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
    ! added missing changelog entry about __MVPUT() fix

  * harbour/source/vm/itemapi.c
    * removed redundant pItem->type = HB_IT_NIL (thanks for Manu Exposito)
2006-09-10 12:04:22 +00:00
Przemyslaw Czerpak
43d20b8eb6 2006-09-10 13:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/arrays.c
    * moved static base offset from hb_struBlock structure
      to HB_CODEBLOCK structure
    + added hclass member to hb_struBlock - it will be used in
      the future for checking codeblock scope in classy so we will
      real scope checking also for messages sent from codeblocks.
    - removed supercast and superoffset members from hb_struArray
      structure.

  * harbour/include/hbclass.ch
    * added class(y) like
         @:<MessageName>([<MsgParams,...>])
      send operator. It's not exactly the same as in class(y) where
      this operator is hardcoded to executing function directly,
      needs method name instead of message name and is linked statically.
      In Harbour this operator uses message name so can be used also for
      instance variables and make dynamic casting to the class from which
      current method is inherited. In short words sending messages to @:
      instead of :: causes that they work like non-virtual messages in
      C++ mode.
      If you do not use the same method body in different classes
      then you can also use explicitly self casting:
         ::<myclass>:<msgname>[(...)]
      and it will be a little bit faster

  * harbour/include/hboo.ch
    + added: HB_OO_MSG_ASSIGN, HB_OO_MSG_ACCESS,
             HB_OO_MSG_CLSASSIGN, HB_OO_MSG_CLSACCESS
      They should be used insted of HB_OO_MSG_DATA and HB_OO_MSG_CLSDATA
      This resolves problems with name conflicts when we were detecting
      type of message (ACCESS/ASSIGN) by checking the first character
      in message name. F.e. now it's possible to create exported instance
      variable called __WithObject and it will be used in all WITH OBJECT
      statement instead of the base object value. It's simple and effective
      WITH OBJECT overloading.
      I kept backward compatibility for HB_OO_MSG_DATA and HB_OO_MSG_CLSDATA
      but I strongly suggest to update code to use new constants.
    + added HB_OO_MSG_REALCLASS

  * harbour/source/rtl/objfunc.prg
  * harbour/source/rtl/tobject.prg
  * harbour/source/rtl/tclass.prg
    * use HB_OO_MSG_[CLS]{ASSIGN,ACCESS} instead of HB_OO_MSG_[CLS]DATA

  * harbour/source/rtl/tclass.prg
    + added REALCLASS message to creted classes - it's used for @: operator

  * harbour/source/vm/classes.c
    * updated for above modifications
    * calculate instance area offset in supercasting dynamically - it
      will allow to eliminate multiple instance area allocating when
      in the inheritance tree the same class exists more then once and
      also quite easy add support for non-virtual messages.
    ! fixed GPF in __CLSINSTSUPER() class function generate HVM exception
    % do not inherit unaccessible inline blocks
    * some other minor optimization, fixes and code cleanups

  * harbour/source/rdd/usrrdd/usrrdd.c
    ! fixed HB_TRACE message

  * harbour/source/rtl/errorapi.c
    ! generate internal error if ErrorNew() function does not return an object
2006-09-10 11:16:43 +00:00
Viktor Szakats
076082265a 2006-09-05 15:51 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/include/hbset.h
   * harbour/include/set.ch
   * harbour/source/pp/pptable.c
   * harbour/source/rtl/set.c
     + Added Set( _SET_DEFEXTENSIONS, <logical: .T./.F.> )
       Default value is .T. (CA-Cl*pper compatible). If set to .F.,
       Harbour runtime/RDD code will never attempt to add a
       default extension to the filename arguments. Commands/functions
       where this setting makes a difference are:
       - SET ALTERNATE TO / Set( _SET_ALTFILE_, ... )
       - SET PRINTER TO / Set( _SET_PRINTFILE_, ... )
       - Set( _SET_EXTRAFILE, ... )
       - SAVE TO / __mvSave()
       - RESTORE FROM / __mvRestore()
       - LABEL FORM
       - REPORT FORM
       - COPY TO ... DELIMITED
       - COPY TO ... SDF
       - LIST / __dbList()
       - USE / dbUseArea()
       - dbCreate()
       - SET INDEX TO / ordListAdd() (not yet implemented)
       - __HRBLOAD(), __HRBRUN()
     ; Notes:
       - From now on, it possible to create/load files using the
         above functions/commands which have no extension. This
         might be desirable in a few platform and/or situations.
         For example on Win32, it's possible to directly print
         to a shared Windows printer queue, using these commands:
             lOldValue := Set( _SET_DEFEXTENSIONS, .F. )
             SET PRINTER TO \\myserver\myprinter
             Set( _SET_DEFEXTENSIONS, lOldValue )
         Or, it is possible to open a dbf file which has no extension:
             dbUseArea(.T., NIL, "dbf_filename_with_no_extension", "w_DATA", .F., .F.)
       - Compiler is (of course) not affected by this setting.
       - Preprocessor (PP) lib flavour is not affected by this setting.
       - Support is not full in the RDD code yet.

   * harbour/source/rdd/dbf1.c
   * harbour/source/rdd/dblist.prg
   * harbour/source/rdd/delim1.c
   * harbour/source/rdd/sdf1.c
   * harbour/source/rtl/tlabel.prg
   * harbour/source/rtl/treport.prg
   * harbour/source/rtl/set.c
   * harbour/source/vm/memvars.c
   * harbour/source/vm/runner.c
     + Honoring _SET_DEFEXTENSIONS setting all over the code.
2006-09-08 12:47:27 +00:00
Przemyslaw Czerpak
26de328b8d 2006-09-07 16:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/memvars.c
    ! fixed memvar creation in __MVPUT()
2006-09-07 14:06:30 +00:00
Przemyslaw Czerpak
2a268eef9e 2006-09-07 01:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/dbcmd.c
    ! always initialize all members in RDD structures to avoid GPF when
      some RDD will try to access uninitialized data

  * harbour/source/rdd/usrrdd/usrrdd.c
    ! added some additional validation in RDD structures <-> item conversions
2006-09-06 23:55:31 +00:00
Przemyslaw Czerpak
95732edd48 2006-09-06 14:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/itemapi.c
    * modified hb_itemClear() to be reentrant safe - the new version
      can be also better optimized by C compiler so should be also faster

  * harbour/source/rdd/dbcmd.c
    ! initialize lpdbOrdCondInfo in DBORDERINFO structure before
      passing to ORDCREATE()

  * harbour/source/vm/fm.c
    ! fixed typo in memset() when HB_PARANOID_MEM_CHECK enabled

  * harbour/source/vm/hvm.c
    ! fixed item type used for iterator
2006-09-06 12:50:46 +00:00
Chen Kedem
ddbcddbd00 2006-09-06 12:02 UTC+0300 Chen Kedem <niki@actcom.co.il> 2006-09-06 09:02:19 +00:00
Alexander S.Kresin
d721da3612 2006-09-05 16:10 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> 2006-09-05 12:08:23 +00:00
Viktor Szakats
2c45c34bb4 2006-09-05 12:44 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/source/debug/debugger.prg
     ! Fixed and made multiplatform the filename extension handling parts.

   * harbour/source/vm/memvars.c
     ! Comment minor fixes.

   * harbour/harbour.spec
   * harbour/make_xmingw.sh
   * harbour/make_bsd.sh
   * harbour/make_drw.sh
     ! xharbour -> harbour
2006-09-05 10:51:43 +00:00
Przemyslaw Czerpak
22b6c06fce 2006-09-04 19:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/TODO
    + added simpler example for memory leak in macro compiler:
         ? type("user input")

  * harbour/source/macro/macro.y
    * replaced TABs with SPACEs

  * harbour/source/vm/classes.c
    * added some TRACE() messages
    + added support for executing functions with <symItem>:EXEC()
      registered dynamically after creating <symItem>

  * harbour/source/vm/hvm.c
    * minor modification
2006-09-04 17:45:53 +00:00
Viktor Szakats
f4fac06d3f 2006-09-04 18:10 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu)
* harbour/source/rtl/tlabel.prg
   * harbour/source/rtl/treport.prg
     ! Made the logic multiplatform where it's decided whether to
       add a default extension to the loaded filename.
       C:\PATH.A\MYFILE didn't get the default extension while
       C:\PATH\MYFILE did.
2006-09-04 16:23:47 +00:00
Przemyslaw Czerpak
a55606d726 2006-09-04 11:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprc.c
    ! fixed bug in wrong integer negating, f.e.:
         proc main(); local i:=0; i-=-32768; ? i; return
    ! fixed PCODE generated for +=, -=, /=, *= expressions when right side
      of expression is undefined variable - it's possible that it will be
      field and we will have RT error. It fixes tt4.prg example form TODO
      file.

  * harbour/TODO
    - removed tt4.prg example from TOFIX

  * harbour/source/vm/classes.c
    ! fixed supercast message validation

  * harbour/source/vm/hvm.c
    ! fixed very bad typo in hb_vmMinus() which can cause wrong
      results when on 64-bit integer overflow
2006-09-04 09:40:43 +00:00
Przemyslaw Czerpak
7e6acbd5ff 2006-09-04 09:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
  + harbour/ChangeLog.016
    ! added ChangeLog.016 and updated number - mistake in my previous commit

  * harbour/source/vm/classes.c
    * stronger parameters validation and fixed some possible problems
      in hb_objGetMethod()
    + added support for assigning enumerator value by:
         <enum>:__enumValue(<newVal>)
      and enumerator index by:
         <enum>:__enumIndex(<newIndex>)
      It's a work in progress - please do not create any code which may
      need such functionality yet

  * harbour/source/vm/debug.c
  * harbour/source/vm/hvm.c
    * minor code cleanup
2006-09-04 07:44:04 +00:00
Przemyslaw Czerpak
30d4efb954 2006-09-03 18:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
  * harbour/tests/overload.prg
    + added support for overloading [] in assignment operation
2006-09-03 17:01:55 +00:00
Przemyslaw Czerpak
21f53fd548 2006-09-03 16:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
  + harbour/ChangeLog.015
    * new ChangeLog file created
2006-09-03 14:33:28 +00:00
Przemyslaw Czerpak
69503c8a2b 2006-09-03 16:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hboo.ch
    + added HB_OO_CLSTP_PERSIST and HB_OO_MSG_INITIALIZED

  * harbour/include/hbapi.h
  * harbour/include/hbvmpub.h
  * harbour/source/vm/dynsym.c
    % changed HB_HANDLE hArea to USHORT uiArea to reduce HB_DYNS size.
      RDD code internally uses USHORT as area number so it's not
      necessary to keep it as HB_HANDLE value.

  * harbour/source/vm/arrays.c
    * modified internal static function name

  * harbour/source/vm/itemapi.c
    + added missing HB_TRACE in hb_itemClone()

  * harbour/source/vm/classes.c
    ! moved initialization values to separate structure not bound with
      methods. We can inherit the same method names from more then one
      object so we will store only the first one but we are inheriting
      whole instance area which is accessible with super casting (last
      fixes) so we have to properly initialize it even if methods does
      not exist. This modification also fixes some possible memory leaks.
    % replaced bIsPersistent by HB_OO_CLSTP_PERSIST in uiScope in method
      definition
    ! added basic parameter validation to __CLSADDMSG() to avoid some
      possible strange behavior at runtime when broken messages are
      defined.
    * updated __OBJHASMSG() and __OBJSENDMSG() to accept SYMBOL items
      too (@funcName()). Using symbol items it faster then strings.
      Also added support to use non array parametes. F.e. now
         __OBJHASMSG( {||NIL}, "EVAL" )
      returns TRUE
    * some other fixes, reduced memory consumption and speed optimizations
2006-09-03 14:30:26 +00:00
Chen Kedem
ac7105cbb9 2006-09-03 16:37 UTC+0300 Chen Kedem <niki@actcom.co.il> 2006-09-03 13:37:12 +00:00
Przemyslaw Czerpak
8363f1e978 2006-09-01 23:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/source/codepage/uckam.c
    + added missing in my previous commit file

  * harbour/include/hbvmpub.h
  * harbour/source/vm/dynsym.c
    + added USHORT uiSymNum to HB_DYNS structure - I will need it for MT
      as index for thread local HB_DYNSYM values for MT version in the
      future but now I use it as perfectly efficient continuous hash
      value for all symbols. Of course PHB_DYNS address is also perfectly
      good hash value and in classes code can be used but it does not
      guaranties that all messages will cover well whole 16bit area used
      as message pool without dynamic bucket size modification.

  * harbour/source/vm/classes.c
    * changed hashing method. Now it uses really unique base hash key
      values which can cover whole 16 bit area so mathematically it's
      not be possible to break it by any combination of method names
      as long as our dynamic symbol table will be limited to 2^16 symbols.
      It still consumes more memory then necessary and I'll change it in
      the future but it's much less then before.
      The BUCKET size is smaller (4) and all calculations are done only
      with bit shifts so it should be also faster.
    * use ULONG instead of USHORT to calculate maximum number of methods
      to avoid possible overflow problems if it reach 2^16 (rather
      impossible in normal application - it will have to create more then
      2^15 symbols)
    ! some other fixes and code cleanup

  * harbour/source/vm/hvm.c
    * minor modifications
2006-09-01 21:28:02 +00:00
Przemyslaw Czerpak
dc736274c7 + harbour/source/codepage/uckam.c
+ added missing in my previous commit file
2006-09-01 19:27:28 +00:00
Przemyslaw Czerpak
f07d1b6ce5 2006-09-01 10:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/lang/msgcs852.c
  * harbour/source/lang/msgcsiso.c
  * harbour/source/lang/msgcskam.c
  * harbour/source/lang/msgcswin.c
    * typo fixed (Vojtech Obrdlik <vobrdlik centrum.cz>)
  * harbour/include/hbapicdp.h
  * harbour/source/codepage/Makefile
  + harbour/source/codepage/cpcs852.c
  + harbour/source/codepage/cpcsiso.c
  + harbour/source/codepage/cpcskam.c
  + harbour/source/codepage/cpcswin.c
  + harbour/source/codepage/uckam.c
  * harbour/doc/en/lang.txt
  * harbour/common.mak
    + added czech codepage support (Vojtech Obrdlik <vobrdlik centrum.cz>)
      Vojtech many thanks.
      We will have to fix our CDP code to work well with characters
      with the same wight - now sorting with such codepages does not
      work correctly, f.e. in CSISO:
        CHR(65)+CHR(204) > CHR(65)+CHR(201)
      but:
        CHR(65)+CHR(201) >= CHR(65)+CHR(204)
      as you can see comparison depends on string order:
        s1 > s2 but not s2 < s1
      It means that such codepages cannot be used in any sorting
      systems like indexes until we will not fix internal CPD logic.
      Alexander can you look at it?
      If not then please inform me and I'll work on it in some spare
      time.


  * harbour/source/rtl/do.c
    * minor RTE message simplification

  * harbour/source/rtl/gtos2/gtos2.c
    * casting

  * harbour/source/vm/dynsym.c
    + added __DYNSN2SYM( <cName> ) -> symbolItem

  * harbour/include/hbapi.h
  * harbour/source/vm/arrays.c
    + added supercast and superoffset members to hb_struArray structure

  * harbour/source/vm/classes.c
  * harbour/source/rtl/tclass.prg
    ! fixed calculation of instance area offsets
    ! fixed accessing instance variables with super casting
    + added selfclass casting
    + added support for sending 'exec' and 'name' messages to
      symbol items, f.e.:
         funcSym := (@funcName())
         ? "Exacuting:", funcSym:name
         funcSym:exec( param1, param2, ... )
    * changed __CLASSNAME() to be Clipper compatible
    * changed __CLSINST()/__CLASSINSTANCE() now accepts as third paramter
      function name - Clipper compatible
    ! fixed GPF trap in __OBJGETCLSNAME() when executed with wrong parameter
    * some other fixes and small speed improvement
2006-09-01 08:27:40 +00:00
Marek Paliwoda
2b8e68f5ea 2006-08-31 21:45 UTC+0100 Marek Paliwoda (mpaliwoda at interia pl)
* harbour/makefile.bc
   * harbour/makefile.vc
     * Changed console output of "install" rule to inst_$(CC_DIRNAME).log
2006-08-31 19:43:14 +00:00
Przemyslaw Czerpak
1d39228e0b 2006-08-29 10:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    + added Class(y) compatible scoping - please test and report any
      possible problems
2006-08-29 08:27:38 +00:00
Przemyslaw Czerpak
5f696874dc 2006-08-28 12:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed __SENDER() function to work with non-inline methods
    ! respect super casting in ClassName(), ClassH(), ClassSel() methods
    % some optimizations
2006-08-28 10:42:28 +00:00
Przemyslaw Czerpak
61b4f5ac8e 2006-08-27 20:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed bug in super casting introduced in my last commit
2006-08-27 18:55:41 +00:00
Chen Kedem
4dc8d459d6 2006-08-24 10:02 UTC+0300 Chen Kedem <niki@actcom.co.il> 2006-08-24 07:02:04 +00:00
Przemyslaw Czerpak
d4af3b201b 2006-08-23 23:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbrdddbf.h
  * harbour/source/rdd/dbf1.c
  * harbour/contrib/rdd_ads/ads1.c
    * synced with xHarbour

  * harbour/include/hbapi.h
    + added uiClass and uiMethod to HB_STACK_STATE structure
    - removed puiClsTree from HB_BASEARRAY structure

  * harbour/include/hbvmpub.h
    ! fixed typo in HB_ARRAY_OBJ() declaration

  * harbour/source/vm/arrays.c
    - removed puiClsTree from HB_BASEARRAY structure

  * harbour/source/vm/classes.c
    - removed static variable s_pMethod to make classes code MT safe
    * store information about current method index and supercasting on
      HVM stack in HB_STACK_STATE structure
    ! changed hb_objGetRealClsName() to not use puiClsTree - this functions
      was never working as it should when object was supercasted.
      Now it simply returns name of class where method was defined and
      inherited.
    - removed hb_objPopSuperCast() and changed last parameter in
      hb_objGetMethod() from BOOL * to PHB_STACK_STATE
      hb_objPopSuperCast() is not longer necessary
    - removed hb_mthRequested() and first parameter from hb_mthAddTime()
    + added char * hb_clsName( USHORT uiClass );
    + added TOFIX notes in hb___msgGetData() and hb___msgSetData()

  * harbour/source/vm/estack.c
    + added uiClass and uiMethod to HB_STACK_STATE structure

  * harbour/source/vm/hvm.c
    * updated for above modifications

  * harbour/source/vm/proc.c
    ! do not use hb_objGetRealClsName() anymore but retrieve information
       about _REAL_ class form HVM stack
2006-08-23 21:13:42 +00:00
Przemyslaw Czerpak
8bef490815 2006-08-19 01:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
    * moved HB_STACK_STATE declaration from hbstack.h to hbapi.h
      it's covered by _HB_API_INTERNAL_ macro so it should not
      effect 3-rd party code
    * modified hb_struSymbol structure:
         LONG stackbase
      replaced by:
         PHB_STACK_STATE stackstate
      this modification allows to keepadditional information bound with
      function call stack accessible from different HVM modules.
      Now it's used by memvars code to keep/update PRIVATE variables
      stack pointers. I plan to store in HB_STACK_STATE structure
      information additional information for classes code like super
      casting or instance variables offsets in new OOP model I'm working on.
      It can be also used by debugger code to retrieve some informations
      about executed functions without active updating by main HVM loop.
    + added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
      variables
    + added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
      offset so PRIVATE variables created in current function/procedure
      will not be removed when it returns
    - removed hb_memvarsRelease() and hb_memvarValueNew()

  * harbour/include/hbstack.h
    + added hb_stackClearMevarsBase() - helper function for hb_memvarsClear()
      clears PRIVATE stack offsets in executed functions
    * changed to static offset from int to long - in different places we
      were using int or long in HVM so I cleaned the HVM code to always
      operate on the same type

  * harbour/source/vm/estack.c
    * set/restore PRIVATE stack base offset in hb_stackNewFrame()/
      hb_stackOldFrame()
    * updated for new HB_IT_SYMBOL structure

  * harbour/source/vm/hvm.c
    ! removed setting/restoring PRIVATE stack base offset in hb_vmExecute()
      It make code like:
         eval(&("{||VAR:=1}"))
      Clipper compatible
    * updated for new HB_IT_SYMBOL structure
    * changed order of execution exit procedures for clean memvars removing
      and future destructors execution. I'll describe it better when I'll
      add destructors.

  * harbour/source/vm/memvars.c
    ! fixed CLEAR MEMORY - now this function should be safe in Harbour
      It's not exactly compatible with Clipper because I intentionally
      didn't replicated some Clipper bugs like possible memory corruption.
    + added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
      variables
    + added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
      offset so PRIVATE variables created in current function/procedure
      will not be removed when it returns
    ! fixed releasing PUBLIC and PRIVATE variables which were passed by
      reference and are still active on HVM stack or in codeblocks as
      detached locals (see: hb_memvarDetachDynSym())
    * modified hb_memvarFindSymbol() to be more Clipper compatible
    % optimized hb_memvarRelease() to operate or PHB_DYNS instead of
      string comparison and not make linear dynamic symbol scan for
      PUBLIC or not existing symbols
    - removed hb_memvarReleasePublic()

  * harbour/include/hbvmpub.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/gencc.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/debug.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/pcount.c
  * harbour/source/vm/proc.c
  * harbour/source/vm/pvalue.c
    * updated for the above modifications

  * harbour/source/rtl/memvarbl.prg
  * harbour/source/rtl/menuto.prg
    * use __mvEXIST( cMemvar ) instead of __mvSCOPE( cMemvar ) > HB_MV_ERROR
      __mvEXIST() is much faster function

  * harbour/source/rtl/type.c
    * execute hb_memvarUpdatePrivatesBase() after macro type checking.
      This should not be necessary but we are not Clipper compatible here
      and this is work around for difference in our TYPE() implementation.
      Clipper for:
         ? TYPE("VAR:=1")
      create PUBLIC variable VAR when [x]Harbour PRIVATE one.
      Should we try to make it Clipper compatible?

   The above should fix problems reported with memvars. We are not 100%
   Clipper compatible but unlike in Clipper we cannot break VM internals
   using some operation on references to memvars and detached locals
   and/or RELEASE.../ CLEAR MEMORY. This modifications should be intensively
   tested. If you will find any problems with current code please inform me.
   I'd like to hear your opinions about memvars created by TYPE() (see above).
   Should we change it? It may not be very easy operation - we will have to
   change macro compiler and add new PCODE for that.
2006-08-18 23:12:38 +00:00
Przemyslaw Czerpak
68cb7f510b 2006-08-17 12:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
  * harbour/include/hbapi.h
  * harbour/include/hbapigt.h
  * harbour/include/hbapiitm.h
  * harbour/include/hbdefs.h
  * harbour/include/hbrdddbf.h
  * harbour/include/hbstack.h
  * harbour/include/hbsxfunc.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/hbstr.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/hbident.c
  * harbour/source/pp/ppcore.c
  * harbour/source/rdd/hbdbsort.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/hbsix/sxcompr.c
  * harbour/source/rtl/hardcr.c
  * harbour/source/rtl/inkey.c
  * harbour/source/rtl/isprint.c
  * harbour/source/rtl/math.c
  * harbour/source/rtl/mtran.c
  * harbour/source/rtl/natmsg.c
  * harbour/source/rtl/gtcrs/chrmap.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/rtl/gtsln/gtsln.h
  * harbour/source/rtl/gtsln/kbsln.c
  * harbour/source/rtl/gtsln/keytrans.c
  * harbour/source/rtl/gtsln/mousesln.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/extend.c
  * harbour/source/vm/runner.c
  * harbour/utils/hbver/hbverfix.c
    * general code cleanup, public functions declared in header files,
      local changed to static, added mising void for functions without
      parameters, etc.
      We still have some public functions which are not used by core code
      and not declared in header files, like:
         hb_memvarValueBaseAddress(), hb_memvarGetVarHandle(),
         hb_memvarGetValueByHandle(), hb_clsCreate(), hb_clsAdd(),
         hb_clsAssociate(), hb_hashTableDel(), hb_hashTableSize(),
      I haven't touched them yet though we will have to keep in mind that
      we should make sth with them.
2006-08-17 11:05:09 +00:00
Przemyslaw Czerpak
f9e7bd0314 2006-08-16 18:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/bsd/gcc.cf
  * harbour/config/darwin/gcc.cf
    * strip lib prefix from CONTRIBS library list

  * harbour/source/codepage/cp_tpl.c
    * removed redundant ;
2006-08-16 16:52:06 +00:00
Przemyslaw Czerpak
ae466d178d 2006-08-16 15:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
  * harbour/source/codepage/Makefile
  + harbour/source/codepage/cpfrdos.c
  + harbour/source/codepage/cphr1250.c
  + harbour/source/codepage/cphr437.c
  + harbour/source/codepage/cphr852.c
  + harbour/source/codepage/cpit437.c
  + harbour/source/codepage/cpit850.c
  + harbour/source/codepage/cpitisb.c
  + harbour/source/codepage/cpitiso.c
  + harbour/source/codepage/cpltwin.c
  + harbour/source/codepage/cpua866.c
  + harbour/source/codepage/cpuakoi.c
  + harbour/source/codepage/cpuawin.c
    + added codepages from xHarbour

  * harbour/source/vm/garbage.c
  * harbour/source/vm/hvm.c
    * formatting and code cleanup
2006-08-16 13:25:27 +00:00
Przemyslaw Czerpak
8210adba05 2006-08-16 12:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/source/vm/estack.c
    + added:
      int hb_stackCallDepth( void )
      LONG hb_stackBaseProcOffset( int iLevel )

  * harbour/source/vm/arrays.c
  * harbour/source/vm/proc.c
   * use hb_stackBaseProcOffset()

  * harbour/source/vm/hvm.c
   - removed s_ulProcLevel used by HB_DBG_PROCLEVEL() - count the call
     stack dynamically using stack data - a little bit slower but it's
     not widely used function, now is MT safe and we eliminated some
     small overhead in each function call so statistically we improved
     overall performance
2006-08-16 10:53:50 +00:00
Przemyslaw Czerpak
9526552410 2006-08-14 14:22 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/TODO
    - removed eliminating hb_stackTopItem() from TOFIX - Done.

  * harbour/include/hbexprc.c
    * restore original expression type after *POPEQ optimization

  * harbour/source/compiler/harbour.c
    * removed some commented code

  * harbour/source/compiler/harbour.y
    % optimized PCODE generated for FOR/NEXT statement - it eliminates
      one unconditional jump inside the loop - Ryszard if you can please
      check me.
2006-08-14 13:03:42 +00:00
Przemyslaw Czerpak
21ea15cf61 2006-08-14 10:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/fserror.c
    + added translation error code for ENMFILE

  * harbour/source/rtl/hbffind.c
    * set FERROR() code when FILE() faild - Clipper compatibility
2006-08-14 08:14:44 +00:00