Commit Graph

134 Commits

Author SHA1 Message Date
florian
706f8085f4 * convert int64 properly to c-bools, resolves #12614
git-svn-id: trunk@12120 -
2008-11-16 13:27:59 +00:00
florian
b178b08ba7 Merged revisions 11665-11738 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/unicodestring

........
  r11665 | florian | 2008-08-30 13:30:17 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * continued to work on unicodestring type support
........
  r11666 | florian | 2008-08-30 19:02:26 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * expectloc for wide/ansi/unicode strings is LOC_CONSTANT or LOC_REGISTER now
........
  r11667 | florian | 2008-08-30 20:42:37 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * more unicodestring stuff fixed, test results on win32 are already good
........
  r11670 | florian | 2008-08-30 23:21:48 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * first fixes for unix bootstrapping
........
  r11683 | ivost | 2008-09-01 12:46:39 +0200 (Mon, 01 Sep 2008) | 2 lines
  
      * fixed 64bit bug in iconvenc.pas
........
  r11689 | florian | 2008-09-01 23:12:34 +0200 (Mon, 01 Sep 2008) | 1 line
  
  * fixed several errors when building on unix
........
  r11694 | florian | 2008-09-03 20:32:43 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * fixed unix compilation
........
  r11695 | florian | 2008-09-03 21:01:04 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * bootstrapping fix
........
  r11696 | florian | 2008-09-03 21:07:18 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * more bootstrapping fixed
........
  r11698 | florian | 2008-09-03 22:47:54 +0200 (Wed, 03 Sep 2008) | 1 line
  
  + two missing compiler procs exported
........
  r11701 | florian | 2008-09-04 16:42:34 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + lazarus project for the linux rtl
........
  r11702 | florian | 2008-09-04 16:43:27 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + set unicode string procedures
........
  r11707 | florian | 2008-09-04 23:23:02 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  * fixed several type casting stuff
........
  r11712 | florian | 2008-09-05 22:46:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  * fixed unicodestring compilation on windows after recent unix changes
........
  r11713 | florian | 2008-09-05 23:35:12 +0200 (Fri, 05 Sep 2008) | 1 line
  
  + UnicodeString support for Variants
........
  r11715 | florian | 2008-09-06 20:59:54 +0200 (Sat, 06 Sep 2008) | 1 line
  
  * patch by Martin Schreiber for UnicodeString streaming
........
  r11716 | florian | 2008-09-06 22:22:55 +0200 (Sat, 06 Sep 2008) | 2 lines
  
  * fixed test
........
  r11717 | florian | 2008-09-07 10:25:51 +0200 (Sun, 07 Sep 2008) | 1 line
  
  * fixed typo when converting tunicodestring to punicodechar
........
  r11718 | florian | 2008-09-07 11:29:52 +0200 (Sun, 07 Sep 2008) | 3 lines
  
  * fixed writing of UnicodeString properties
  * moved some helper routines to unicode headers
........
  r11734 | florian | 2008-09-09 22:38:55 +0200 (Tue, 09 Sep 2008) | 1 line
  
  * fixed bootstrapping
........
  r11735 | florian | 2008-09-10 11:25:28 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  * first fixes for persisten unicodestrings
........
  r11736 | florian | 2008-09-10 14:31:00 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  Initialized merge tracking via "svnmerge" with revisions "1-11663" from 
  http://svn.freepascal.org/svn/fpc/trunk
........
  r11737 | florian | 2008-09-10 21:06:57 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  * fixed unicodestring <-> variant handling
  * fixed unicodestring property reading
........

git-svn-id: trunk@11739 -
2008-09-10 20:14:31 +00:00
yury
8818df640f * Fixed passing of open array of wide string literals to function which expects 'array of pwidechar' parameter in case source file has utf8 encoding. Compiler thrown the following error in such case: Incompatible type for arg no. 1: Got "Array Of Const/Constant Open Array of WideString", expected "Open Array Of PWideChar".
+ Test for this issue.

git-svn-id: trunk@11581 -
2008-08-14 18:55:10 +00:00
florian
1fa70f7a0a * proper support for tobject.getinterface with raw/corba interfaces, resolves #6798 and #6036
git-svn-id: trunk@11497 -
2008-08-01 15:27:58 +00:00
tom_at_work
6958bbfdda * allow explicit conversion of enumeration values (in addition to integers) to object references in Delphi mode
git-svn-id: trunk@11398 -
2008-07-18 15:30:20 +00:00
florian
467aeb3446 * avoid ie 99080501 when overloading procedures with open arrays of widechar, resolves #11543
git-svn-id: trunk@11266 -
2008-06-23 18:50:51 +00:00
florian
e265393d7a * make stringconstn => open array of char a l1 conversion as it was earlier, resolves #10727
git-svn-id: trunk@10984 -
2008-05-17 18:18:51 +00:00
Jonas Maebe
85b9c65f51 * fixed support in macpas mode for anonymous procedure/function types
in parameter lists after r9484 (mantis #11254)

git-svn-id: trunk@10885 -
2008-05-05 11:59:35 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
yury
801837f60d * Fixed bug #10681.
+ Test.

git-svn-id: trunk@9879 -
2008-01-23 10:24:04 +00:00
Jonas Maebe
08ccb30e3b * perform real "exactness" checking for open array parameters
git-svn-id: trunk@9624 -
2008-01-04 12:54:47 +00:00
Jonas Maebe
719c29cf86 + new cpo_openequalisexact parameter comparison option which
treats equal open arrays, open strings and arrays of const
    (implicitly also open) as exactly matching (since you
     cannot declare such types on their own, so they will
     never match exactly)
  * require that forward declared procedures match the
    implementation exactly for both the parameters (with
    the above modification) and result type (mantis
    #10425 and the related webtbf/tw10425a.pp)

git-svn-id: trunk@9484 -
2007-12-16 22:22:11 +00:00
florian
5c96c4a671 + first part of support for an unicodestring type
git-svn-id: trunk@9382 -
2007-12-02 16:39:13 +00:00
Jonas Maebe
e716ac6b6b * give ord->formaldef again a higher precedence than ord->floatdef
(last convert level that is added, needs a more structural
     solution)

git-svn-id: trunk@9057 -
2007-11-02 11:17:11 +00:00
Jonas Maebe
82a0749970 * prefer non-matching orddef conversions to orddef-to-pointer conversions
(mantis #10002) and also to orddef-to-real conversions
    (delphi-compatible). More tests and fixes will follow later.

git-svn-id: trunk@9015 -
2007-10-31 17:20:37 +00:00
Jonas Maebe
5bc156efea * always demote type conversions which cannot represent part of the
source value to convert_l3, instead of only those with a destination
    type whose size is < source size (like Delphi) + test -> fixes
    toperator6 along with a host of wrong tordconst typeconversions in
    the compiler sources themselves (although most are harmless)

git-svn-id: trunk@8323 -
2007-08-28 19:38:40 +00:00
daniel
6e0a7bb0eb * Nil constants that are type converted to a method procvar are now
properly converted. The conversion is done at runtime to generate
    a two pointer memory reference as result location, something
    which the code generator can handle very well, which minimizes
    the chance of side effects.

git-svn-id: trunk@7978 -
2007-07-07 20:57:05 +00:00
florian
76a3d55199 * allow enum => pointer type casts in delphi mode, resolves #8465
git-svn-id: trunk@7905 -
2007-07-01 14:43:46 +00:00
daniel
504d845e86 * Consider conversion from integer to integer te_equal, if the base types
are equal and the range of the from type fits in the to type. I.e.
    conversion from -10..10 to shortint is considered equal. This is correct
    because in this case, the from type can be used wherever the to type is
    used, i.e. the compiler never needs to do conversion at compile or run
    time.

git-svn-id: trunk@7814 -
2007-06-25 20:57:21 +00:00
florian
70284da435 * allow <any ordinal>(class/interface) type casts likewise it is allowed for class references and pointers
git-svn-id: trunk@7811 -
2007-06-25 20:08:34 +00:00
Jonas Maebe
ba95cc22ee * only allow automatic type conversions of array constructors of
char to pchar/array of char, rather than of arbitrary array
    constructors (mantis #9085)

git-svn-id: trunk@7670 -
2007-06-15 17:16:44 +00:00
florian
c7037df254 + classrefdef is assignment compatible to pointers in delphi mode
git-svn-id: trunk@7648 -
2007-06-13 20:21:33 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
Jonas Maebe
6555f37cff * do not search variant operators when looking for an overloaded
operator for a non-variant type (was already intended that way,
    but checks didn't work) (mantis #7070) + tests
  * some tab->spaces in defcmp.pas

git-svn-id: trunk@7359 -
2007-05-16 13:59:35 +00:00
florian
45cda67f3f + first basically working (not all node types yet) dfa implementation determining life information
git-svn-id: trunk@7294 -
2007-05-06 21:33:39 +00:00
florian
9a0f769b2f * cleaned up set conversion
* fixed conversion of var sets

git-svn-id: trunk@6644 -
2007-02-25 16:29:39 +00:00
peter
f7a6c1e2ee * only allow pointer(integer) in fpc modes
git-svn-id: trunk@6598 -
2007-02-22 07:01:47 +00:00
peter
9a37c04131 * cardinal-cardinal is calculated using int64
* support pointer(int64) for all modes, this is needed to
    support pointer(cardinal+longint) and pointer(cardinal-cardinal)

git-svn-id: trunk@6586 -
2007-02-21 11:52:06 +00:00
yury
48e46f1c2e * Fixed error "Incompatible type for arg no. X: Got "Array Of Char", expected "Array Of PChar"" when passing values like ['1','2','3'] for "array of PChar" parameter.
+ Test added.

git-svn-id: trunk@6495 -
2007-02-15 19:43:35 +00:00
florian
a2ec2e72b6 * better hint about abstract methods (fixes 5098)
+ code generation for invoking dispinterface methods
* small dispinterface problems fixed

git-svn-id: trunk@5798 -
2007-01-03 19:14:31 +00:00
Jonas Maebe
2b9bdf2155 * fixed mantis 6631, 7322 and 7989: check parameters and return
types of interface methods implemented in a class

git-svn-id: trunk@5686 -
2006-12-22 19:50:52 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
Jonas Maebe
d87f03eef5 - removed automatic int-string, string-int and int-array conversion for
macpas after discussion on macpascal mailing list. The only thing left
    is automatic conversion of constant strings of length 4 to 32 bit ints.
  * adapted tests to this
  * fixed FOUR_CHAR_CODE and FCC functions in MacPas unit for little
    endian
  + FourCharArray type in macpas unit wich can be used to typecast
    int's "back" to an array[1..4] of char (though the characters
    will be in reverse on little endian systems in that case)

git-svn-id: trunk@5154 -
2006-11-01 16:34:37 +00:00
peter
136d3e8d46 * refactor implemented interfaces
git-svn-id: trunk@5134 -
2006-10-31 22:38:49 +00:00
florian
5c9b39549a * fixed olevariant -> variant conversion
git-svn-id: trunk@5131 -
2006-10-31 19:45:08 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
Jonas Maebe
2dd6a91a9f + allow implicit type conversions of 4 byte integers to strings for
parameter matching in macpas mode

git-svn-id: trunk@4957 -
2006-10-18 18:14:54 +00:00
peter
6fa1b27add * openarray to openarray should still be equal for parameters
git-svn-id: trunk@4755 -
2006-09-30 10:21:18 +00:00
peter
0ddab0c161 * add cdo_parameter option for def_compare_ext that indicates that we
are comparing parameter lists
  * openarray and normal array are not compatible anymore when comparing
    parameters

git-svn-id: trunk@4754 -
2006-09-30 09:59:46 +00:00
Jonas Maebe
47eb589d54 * allow implicit conversions from/to packed char arrays under the
same conditions as from/two regular char arrays (since a packed
    char array is the same as a string in ISO Pascal)

git-svn-id: trunk@4468 -
2006-08-20 15:14:07 +00:00
florian
9e66674ff9 + first part of qwordbool implementation
git-svn-id: trunk@4462 -
2006-08-19 23:16:17 +00:00
Jonas Maebe
eccbc78e04 + support for bitpacked arrays:
+ use {$bitpacking on/+} to change the meaning of "packed"
      into "bitpacked" for arrays. This is the default for MacPas.
      You can also define individual arrays as "bitpacked", but
      this is not encouraged since this keyword is not known by
      other compilers and therefore makes your code unportable.
    + pack(unpackedarray,index,packedarray) to pack
      length(packedarray) elements starting at
      unpackedarray[index] into packedarray.
    + unpack(packedarray,unpackedarray,index) to unpack
      packedarray into unpackedarray, with the first
      element being stored at unpackedarray[index]
  * todo:
    * "open packed arrays" and rtti for packed arrays are not
      yet supported
    * gdb does not properly support bitpacked arrays

git-svn-id: trunk@4449 -
2006-08-19 12:54:12 +00:00
peter
ac673f392c * typo in previous commit
git-svn-id: trunk@4392 -
2006-08-07 21:14:16 +00:00
peter
4bde345009 * fix check for openarray and single element
git-svn-id: trunk@4390 -
2006-08-07 20:36:18 +00:00
peter
a704cbf048 * never prefer conversion to formaldef
git-svn-id: trunk@4387 -
2006-08-07 19:50:52 +00:00
peter
38c0ae73da Merged revisions 2775,2788-2789 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2775 | peter | 2006-03-05 22:43:30 +0100 (Sun, 05 Mar 2006) | 2 lines

  * merge ppu changes to keep ppus the same

........
r2788 | peter | 2006-03-06 12:59:14 +0100 (Mon, 06 Mar 2006) | 2 lines

  * Add TFPList and TFPObjectList

........
r2789 | peter | 2006-03-06 13:01:37 +0100 (Mon, 06 Mar 2006) | 2 lines

  * fix powerpc

........

git-svn-id: trunk@2790 -
2006-03-06 12:04:44 +00:00
Jonas Maebe
92c389aaeb * fixed web bug #4778 (explicit type casting of float to int in tp/delphi
keeps the bit pattern instead of converting)

git-svn-id: trunk@2509 -
2006-02-10 11:05:47 +00:00
peter
45176ea2a8 * split tstringtype for stringdef and stringconstnode
to prevent wrong typecasts

git-svn-id: trunk@2276 -
2006-01-13 17:20:27 +00:00
peter
95879fe8a7 * basic support for generic classes
git-svn-id: trunk@2020 -
2005-12-21 10:11:15 +00:00