Commit Graph

2150 Commits

Author SHA1 Message Date
svenbarth
81fa0924d8 * an exception does not need to inherit from Exception, so declare that as such for the thread queue entry for the sake of clarity
git-svn-id: trunk@40652 -
2018-12-25 23:30:38 +00:00
svenbarth
3e0da1ef1c * fix for Mantis #34640: don't access the thread queue entry directly after it was added to the queue if it's a Queue()d entry instead of a Synchronize()d one
git-svn-id: trunk@40651 -
2018-12-25 23:30:35 +00:00
michael
93ec37a4bc Added overloads UintToStr for Delphi compatbibility (bug ID 0034690)
git-svn-id: trunk@40529 -
2018-12-12 08:29:24 +00:00
nickysn
da5868b668 + added method TBits.CopyBits for fast copying
git-svn-id: trunk@40524 -
2018-12-11 15:52:09 +00:00
michael
863ede7dc6 * Add QWord version of Max (Delphi compatibility, bug ID #34364)
git-svn-id: trunk@39995 -
2018-10-20 12:28:56 +00:00
michael
ab159c638c * Move consts to stdconv
git-svn-id: trunk@39994 -
2018-10-20 12:18:16 +00:00
michael
407753ea10 * Add constants for powers of 10 and 2. use integer/int64 where possible
git-svn-id: trunk@39992 -
2018-10-20 10:40:12 +00:00
florian
edd72ca6d2 * few inline directives added to types, resolves #34424
git-svn-id: trunk@39984 -
2018-10-18 19:35:56 +00:00
michael
a7278c1806 * Fix split, last term of length 1 is sometimes missed
git-svn-id: trunk@39843 -
2018-09-30 09:18:21 +00:00
marco
7833dbf6a4 * uppercase relative_P_ath. Mantis #34262
git-svn-id: trunk@39743 -
2018-09-12 11:24:19 +00:00
svenbarth
a076677336 * instead of a flags field generate a table with all Initialize operators of all fields (nested or not, parent class or not) for class types; objects and records don't use this (yet)
git-svn-id: trunk@39690 -
2018-08-29 19:21:35 +00:00
svenbarth
2e1327b6b2 * use pooled constant references for the parameter locations as more often than not they're equal between multiple methdos (e.g. the Self argument is always the same)
* using this the TypInfo unit can navigate interface methods and VMT method parameters much more quickly as the latter have a constant size now

git-svn-id: trunk@39686 -
2018-08-29 19:20:31 +00:00
svenbarth
029ec93df6 * use pooled constant references for the names of VMT methods in the RTTI
git-svn-id: trunk@39685 -
2018-08-29 19:20:27 +00:00
svenbarth
228d3252cc * use pooled constant references for the parameter names of VMT methods in the RTTI
git-svn-id: trunk@39684 -
2018-08-29 19:20:24 +00:00
svenbarth
e110d90127 + implement FileGetSymLinkTarget() based on patch by Serge Anvarov in Mantis #32370
git-svn-id: trunk@39671 -
2018-08-24 15:34:04 +00:00
svenbarth
09e5f463dc + add Delphi-compatible FileGetSymLinkTarget functions to all platforms (currently returns False on all platforms); this also includes TSymLinkRec variants for both RawByteString and UnicodeString
git-svn-id: trunk@39669 -
2018-08-24 15:33:45 +00:00
svenbarth
92dcdd8b5b + add Delphi compatible FollowLink parameter (default is True) to FileExists and DirectoryExists; support for it is up to each target
git-svn-id: trunk@39668 -
2018-08-24 15:33:09 +00:00
marco
15fcd0ab61 * remove old ifdefs
git-svn-id: trunk@39642 -
2018-08-19 14:54:58 +00:00
florian
a825a66d01 * IntPower inverts the base first for negative exponents and multiplies then, resolves #34124
git-svn-id: trunk@39621 -
2018-08-16 20:45:35 +00:00
michael
ab84f09591 * Fix bug #39521. Generic functions only in trunk
git-svn-id: trunk@39525 -
2018-07-29 21:43:03 +00:00
michael
1e3f44965f * Added generic IfThen, as proposed by Thaddy de Koning, bug id #34012
git-svn-id: trunk@39521 -
2018-07-29 09:35:54 +00:00
svenbarth
38c30a557d * deprecate MaxGListSize; it's no longer used by the generic types
git-svn-id: trunk@39465 -
2018-07-17 19:30:29 +00:00
svenbarth
2ec7a5acff * change declaration of TTypeList from a static array to a pointer to T as the static array might breach the
limits for static arrays if the used type is too large (especially on 32-bit systems); as FPC supports indexing
of typed pointers like arrays this should be mostly backwards compatible

git-svn-id: trunk@39464 -
2018-07-17 19:30:26 +00:00
michael
53e10c99d4 * Fix bug #33984, fix for correct string definition in unicodestringreplace
git-svn-id: trunk@39452 -
2018-07-14 16:27:52 +00:00
michael
844a9b0ca6 * Actually observe TStringStream.OwnsEncoding in destructor
git-svn-id: trunk@39379 -
2018-07-04 11:03:21 +00:00
svenbarth
ddb501bddf * use a TObject constraint for TFPGObjectList and TFPGObjectMap to ensure that only TObject and its descendants
are used (allows for a better error message)

git-svn-id: trunk@39363 -
2018-07-03 18:34:41 +00:00
michael
a9205c9fba * Fix bug ID #32837, correct Mantissa and Fraction in float helpers, patch from Bart Broersma
git-svn-id: trunk@39346 -
2018-06-29 20:51:32 +00:00
michael
58b480e0b2 * Fix bug ID #33860
git-svn-id: trunk@39330 -
2018-06-28 12:41:49 +00:00
svenbarth
8536abce8a * as the management operator feature is not platform specific using a specific define for it aside from a
version check is unnecessary, thus remove the FPC_HAS_MANAGEMENT_OPERATOR define and instead check for VER3_0

git-svn-id: trunk@39257 -
2018-06-20 19:00:24 +00:00
svenbarth
ac0322c323 + add a flags field to the record init RTTI which declares whether
a) the current record contains a field with non-trivial initialization
    b) and of the parents contains such a field (only relevant for objects and classes)

git-svn-id: trunk@39255 -
2018-06-20 19:00:17 +00:00
florian
400861a907 * fixed TBits.NotBits, it is just an Xor operation, resolves #33706
git-svn-id: trunk@39243 -
2018-06-19 20:38:15 +00:00
svenbarth
8a195c44ba + add overloads of IsInfinite() for Single and Extended (compatible with Delphi)
git-svn-id: trunk@39135 -
2018-05-28 15:36:18 +00:00
pierre
dfcb34aef2 * Ansi2UnicodeMove:
- Avoid calling Utf8ToUnicode with only three parameters,
  as this is not reliable if the ansitring contains embedded #0 chars.
  Use explicit high(SizeUInt) or allocated length explicitly.
  - Change destLen type to SizeUInt.
  * UpperAnsiString, LowerAnsiString:
  Also avoid call to Utf8ToUnicode with only three parameters.
  Change type of slen and ulen local variables to SizeUInt.
  * CompareStrAnsiString:
  Fix sign of return value if l2=0 (was returning negative value)

git-svn-id: trunk@38972 -
2018-05-11 12:12:37 +00:00
pierre
26cc97745a Fix wrong starting index in CompareStrAnsiString function
git-svn-id: trunk@38963 -
2018-05-09 23:14:45 +00:00
michael
7aa7f1b96f * Fix bug #33681
git-svn-id: trunk@38896 -
2018-05-03 07:09:05 +00:00
michael
e4ef17b5c0 * Use SizeInt, let StartsWith/EndsWith handle #0 characters (bug ID 33559)
git-svn-id: trunk@38769 -
2018-04-14 12:06:48 +00:00
florian
add418db0e * properly define Min/Max values of Native*Int helpers, resolves #33543
git-svn-id: trunk@38664 -
2018-04-02 21:31:23 +00:00
michael
8b19eddd13 * Remove scrollh again, Lazarus solved it another way
git-svn-id: trunk@38658 -
2018-04-01 08:19:17 +00:00
michael
616d8073f2 * Implement flushbuffer abstract method in TFiler (part 2) (bug ID 33062)
git-svn-id: trunk@38656 -
2018-04-01 07:19:34 +00:00
michael
a137486439 * Implement flushbuffer abstract method in TFiler (bug ID 33062)
git-svn-id: trunk@38655 -
2018-04-01 07:16:34 +00:00
michael
6d49a7b93f * Put Collection.Assign loop in beginupdate/endupdate (bug ID 33517)
git-svn-id: trunk@38628 -
2018-03-26 19:02:51 +00:00
michael
31a354a3bc * Fix bug #33516
git-svn-id: trunk@38627 -
2018-03-26 16:31:28 +00:00
pierre
921b406c05 Fix for webtbs/tw11006.pp and test/tbs/tb0632.pp instability.
* Add ThreadQueueLockCounter variable to
  postpone call to DoneCriticlSection to the last thread
  that decrements back the counter to zero.
  * CommonCleanup:
  Protect ThreadQueue emptying within
  a Enter/Leave-CriticalSection to avoid access y other
  threads at the same time.

git-svn-id: trunk@38626 -
2018-03-25 20:32:25 +00:00
michael
e46b89c8bb * Patch from Ondrej Pokorny to fix camelcase (bug ID 4b46872)
git-svn-id: trunk@38619 -
2018-03-24 14:39:56 +00:00
michael
16ba47be46 * Patch from Ondrej Pokorny to convert unit names to CamelCase (bug ID 33481)
git-svn-id: trunk@38616 -
2018-03-23 22:06:36 +00:00
michael
bf3e437dd6 * Fix bug #33475, add AddPair for Delphi compatibility, modified patch by Silvio Clecio
git-svn-id: trunk@38587 -
2018-03-21 10:30:02 +00:00
pierre
31620a9c94 Add ESigQuit Exception class and use it in exceptmap
git-svn-id: trunk@38586 -
2018-03-21 10:28:33 +00:00
pierre
250e924ad3 + Add RTE 236 for thread errors:
inc/systemh.inc and java/jsystemh.inc:
    + Add reThreadError (and also reNoDynLibsSupport) to TRuntimeError.
    * Add new values to RuntimeErrorExitCodes after extension of TRuntimeError
  inc/system.inc and java/jsystem.inc:
    * use RTE 236 in fpc_threaderror.
  objpas/sysconst.pp and objpas/sysutils/stre.inc:
    + Add SThreadError string constant.
  objpas/sysutils/sysutilh.inc:
    + Add EThreadError class.
  objpas/sysutils/sysutils.inc
    + Add 236 to EThreadError conversion to exeptmap.

git-svn-id: trunk@38584 -
2018-03-21 10:19:04 +00:00
michael
a877616dd5 * Fix bug #33441 (patch from Silvio Clécio)
git-svn-id: trunk@38539 -
2018-03-17 00:01:51 +00:00
florian
8a2cf56d51 * fixed operator mod for floats as proposed by wp in #33167, resolves #33167
git-svn-id: trunk@38332 -
2018-02-24 18:23:06 +00:00
michael
77caa28bab * Fix bug #33204
git-svn-id: trunk@38327 -
2018-02-24 11:12:11 +00:00
svenbarth
640480272f * adjust TThread.Synchronize so that it also works correctly if the passed in thread instance is not the instance of the current thread
+ added test

git-svn-id: trunk@38124 -
2018-02-05 21:50:00 +00:00
svenbarth
2d52536460 * only check for the method if one is given at all (otherwise everything would be skipped)
git-svn-id: trunk@38115 -
2018-02-04 20:20:32 +00:00
michael
56fae4697a * Accidentally removed keyword virtual from loadfromfile
git-svn-id: trunk@37966 -
2018-01-14 11:52:13 +00:00
michael
cbc50c5fe6 * Restore signature of loadfromstream/loadfromfile, make default delphi compatible
git-svn-id: trunk@37965 -
2018-01-14 10:11:56 +00:00
michael
5c1df42fa4 * Fix bug #32871
git-svn-id: trunk@37962 -
2018-01-13 18:21:44 +00:00
michael
f6a08a2c74 * Patch from Ondrej Pokorny to allow correct nodefault/stored for strings
git-svn-id: trunk@37954 -
2018-01-13 10:22:16 +00:00
marco
af85960d62 * East Asian locales era patch from Mantis #33003
git-svn-id: trunk@37944 -
2018-01-11 10:29:32 +00:00
marco
acf6fde3cf * fix widestringreplace, shared routine missed some *sizeof(srchar) here and there.
patch from Cyrax, Mantis #32649

git-svn-id: trunk@37882 -
2017-12-30 15:51:53 +00:00
marco
b20dd5cdbb * fpslist.deleterange mantis #32807
git-svn-id: trunk@37871 -
2017-12-29 18:05:13 +00:00
michael
e160d4c530 * Fix bug ID #32889, handle ReadInterfaceRaw in TReader
git-svn-id: trunk@37856 -
2017-12-29 10:54:14 +00:00
michael
5e40444272 * Free component on error (bug ID 32626)
git-svn-id: trunk@37851 -
2017-12-29 09:37:57 +00:00
michael
fb7d2d9ebd * Patch from Anton Shepelev to fix variance and standard deviation calculation (bug ID 32804)
git-svn-id: trunk@37791 -
2017-12-24 10:02:02 +00:00
pierre
29b52824cf Try to fix TRect problem for wince
git-svn-id: trunk@37783 -
2017-12-22 11:50:59 +00:00
pierre
ec45d8617c Fix wince rtl compilation (fix for bug report 32859)
git-svn-id: trunk@37778 -
2017-12-21 17:45:20 +00:00
nickysn
532ff65e87 + enabled compilation of unit types for win16
git-svn-id: trunk@37736 -
2017-12-15 17:55:29 +00:00
nickysn
5409450195 + ported and enabled compilation of unit sysutils for win16
git-svn-id: trunk@37734 -
2017-12-15 16:58:49 +00:00
florian
b41cb26727 + write selected features in ppu of the system unit and load them further on
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set

git-svn-id: trunk@37708 -
2017-12-10 16:32:56 +00:00
marco
a5487d327f * intmean, patch by Bart. Bug #32661
git-svn-id: trunk@37688 -
2017-12-06 10:30:02 +00:00
florian
7741b495bd - duplicate defintion of TBoundArray removed, resolves #32530
git-svn-id: trunk@37627 -
2017-11-26 21:03:52 +00:00
marco
fb57fd7324 * patch from Mattias fixing save/restore ancestorpos in twriter. Mantis #32607
git-svn-id: trunk@37513 -
2017-10-24 13:23:26 +00:00
michael
3f09294aab * Functions to see whether a published property is readable or writeable
git-svn-id: trunk@37497 -
2017-10-20 19:41:56 +00:00
michael
a3bcefd78c * Use pointer get/set methods
git-svn-id: trunk@37496 -
2017-10-20 19:17:11 +00:00
michael
3d3bbcfa9c * Raise error if property cannot be written (Enhanced patch from Ondrej Pokorny, bug ID #32586)
git-svn-id: trunk@37495 -
2017-10-20 18:44:35 +00:00
svenbarth
7e3ad42f33 + add types for the VMT's message table (the names are Delphi compatible, even if TVmtMethodEntry has no Len field)
git-svn-id: trunk@37489 -
2017-10-18 19:38:03 +00:00
svenbarth
e6b39ebf15 + add methods for easier enumeration of the fields in a class' field table
git-svn-id: trunk@37484 -
2017-10-17 21:07:32 +00:00
svenbarth
0ba1073615 + add new type TVmtFieldClassTab for the class table of the field table (Delphi compatible)
git-svn-id: trunk@37483 -
2017-10-17 20:54:38 +00:00
svenbarth
530213711f * change the class references in a class' field table to indirect references
git-svn-id: trunk@37482 -
2017-10-17 20:34:21 +00:00
svenbarth
1ae344394a + add data record for easier access to a class' data
git-svn-id: trunk@37420 -
2017-10-07 21:40:42 +00:00
svenbarth
81a0f88d8c + add Delphi compatible TThread.ForceQueue() which enqueues the method also for the main thread (at least if the RTL is in multi threading mode, otherwise it's still executed right away - whether this is Delphi compatible needs to be tested as I only have a 10.1 currently which does not yet support TThread.ForceQueue())
+ added test

git-svn-id: trunk@37359 -
2017-09-29 21:19:45 +00:00
michael
3d17111e2f * Remove double inline; chokes fpdoc (2nd occurrence)
git-svn-id: trunk@37349 -
2017-09-28 12:32:17 +00:00
michael
809a096232 * Remove double inline; chokes fpdoc
git-svn-id: trunk@37348 -
2017-09-28 12:13:38 +00:00
michael
52fe038b53 * use system.HMOdule when available
git-svn-id: trunk@37302 -
2017-09-22 15:29:09 +00:00
michael
aabc5dc217 * Add AddList to list classes (bug ID 32447)
git-svn-id: trunk@37268 -
2017-09-20 14:21:52 +00:00
pierre
07ba4f8cca Add FSem and FSuspendedExternal private fields for BeOS
git-svn-id: trunk@37260 -
2017-09-20 08:50:08 +00:00
marco
b6824290fc * initial fileflush, mantis #15824
git-svn-id: trunk@37135 -
2017-09-03 16:41:32 +00:00
svenbarth
5c97248f85 + also write the set's size to the RTTI as that simplifies handling in Invoke()
git-svn-id: trunk@37090 -
2017-08-31 19:23:12 +00:00
pierre
e325284160 Fix compilation failure for systems that do not have dynlibs
git-svn-id: trunk@37056 -
2017-08-25 07:28:35 +00:00
michael
a4c4ce1764 * Capture result in SafeLoadLibrary
git-svn-id: trunk@37050 -
2017-08-24 09:27:49 +00:00
michael
b6700f68b8 * Fix bug #32314 (SafeLoadLibrary does nothing on other platforms than windows)
git-svn-id: trunk@37049 -
2017-08-24 08:46:07 +00:00
svenbarth
8b5461367b * move TTypeKind from TypInfo unit to System unit as it's necessary for the future GetTypeKind() intrinsic
* also adjust (P)Byte usages to (P/T)TypeKind where necessary/approbiate

git-svn-id: trunk@36873 -
2017-08-11 20:37:36 +00:00
michael
3a046bda5f * Fix bug ID #31647: added new shift state: ssScrollH
git-svn-id: trunk@36768 -
2017-07-23 09:10:11 +00:00
michael
ab0c29e54f * Rename RawByteString version of TstringStream constructor, compiler cannot decide for empty string
git-svn-id: trunk@36759 -
2017-07-21 18:02:26 +00:00
michael
2b1bb6a5f5 * TStringStream now observes encoding, bug ID #30508
git-svn-id: trunk@36758 -
2017-07-21 17:02:37 +00:00
michael
547f08e6ea * Add TimeStamp property to TSearchRec (reworked patch from Ondrej Pokorny, bug ID #32165)
git-svn-id: trunk@36750 -
2017-07-20 07:35:51 +00:00
michael
63b4a1b7e0 Stream PPI data only when needed (Patch from Ondrej Pokorny)
git-svn-id: trunk@36749 -
2017-07-20 07:31:16 +00:00
michael
32cdee6f5d * Fix bugs 30950 & 29781
git-svn-id: trunk@36740 -
2017-07-17 16:24:05 +00:00
michael
c788256fc9 * Added AddEnumElementAliases/TypInfo.RemoveEnumElementAliases (bug ID 30961)
git-svn-id: trunk@36719 -
2017-07-10 10:00:17 +00:00
michael
bb79ab787e * Fix FULLVERSION check for randomfrom
git-svn-id: trunk@36718 -
2017-07-10 09:58:36 +00:00
michael
162b938409 * Patch from Thaddy De Koning to add generic RandomFrom
git-svn-id: trunk@36706 -
2017-07-09 10:11:01 +00:00
michael
f247a66c90 * Fix bug ID #31975, LastIndexOf string helper copy&paste error
git-svn-id: trunk@36703 -
2017-07-09 08:43:01 +00:00
michael
e9a3a807d0 * Fix overflows in intstrtodate (bug ID 32098)
git-svn-id: trunk@36687 -
2017-07-08 19:52:54 +00:00
pierre
4882b802ae Fix compilation of RTL classes unit for msdos OS target
git-svn-id: trunk@36629 -
2017-07-03 16:21:15 +00:00
Károly Balogh
ea635bfda5 typinfo: push/pop doesn't save packrecords. also, always use AlignTypeData on m68k, which might have less than pointer sized (word, 2 byte) alignments in the typeinfo, because on most systems C compilers also use 2 byte alignments, so we need that for compatibility
git-svn-id: trunk@36594 -
2017-06-24 23:18:12 +00:00
nickysn
ab0b07e7c6 * fixed off by one error in fpwidestring.Unicode2AnsiMove, which caused an
extra #0 character to the appended to the result, when converting to UTF-8

git-svn-id: trunk@36498 -
2017-06-13 23:49:28 +00:00
nickysn
5e4937fd3f * fallback to the default ansistring comparison (when doing ansistrings
comparisons), when fpwidestring is included, but no default collation has been
  set

git-svn-id: trunk@36461 -
2017-06-08 23:49:51 +00:00
nickysn
fce5fbd726 + added cp3021 (Bulgarian MIK) code page support
git-svn-id: trunk@36444 -
2017-06-07 13:19:20 +00:00
nickysn
9e74f05343 + added cp856, iso-8859-10, iso-8859-11, iso-8859-14 and iso-8859-16 to the
CodePageNames and CodePageHashes translation tables in the SysUtils unit

git-svn-id: trunk@36443 -
2017-06-07 11:55:54 +00:00
michael
f406d7cbef * Fix bug #31947: upgrade natve unicode implementation to version 9 and CLDR 30 (Patch from Inoussa)
git-svn-id: trunk@36407 -
2017-06-03 16:10:39 +00:00
nickysn
958d74e41c - removed the "else" in math.EnsureRange, because this way the compiler
generates entirely branchless code (via CMOVxx) on Pentium II or later (when
  compiling with -CpPENTIUM2)

git-svn-id: trunk@36305 -
2017-05-23 13:17:28 +00:00
marco
f0a02cdaf9 * reengineered utf8-less fix for #0031257
git-svn-id: trunk@36293 -
2017-05-22 13:58:43 +00:00
florian
69f41a776e * jump-free Ceil*/Floor* implementations
git-svn-id: trunk@36283 -
2017-05-21 12:34:31 +00:00
michael
06227c9557 * Fix bug ID #31814, StrToDateTimeDef with FormatSettings parameter
git-svn-id: trunk@36214 -
2017-05-15 13:10:56 +00:00
michael
e11821f558 * Patch from Ondrej Pokorny to make Datamodule DPI aware (bug ID 31813)
git-svn-id: trunk@36212 -
2017-05-15 07:13:37 +00:00
pierre
78343902bf Allow objpas classes and sysutils units to compile with threading support disabled
git-svn-id: trunk@36107 -
2017-05-04 22:13:11 +00:00
marco
5d317a4e46 * manual CSE for fcomponents[i] in FindComponent, mantis #31628
git-svn-id: trunk@35946 -
2017-04-25 11:34:25 +00:00
michael
e4184e0561 * Patch from Denis Kozlov to fix find in case of non-sorted list
git-svn-id: trunk@35942 -
2017-04-24 20:52:41 +00:00
michael
ac207e867b * Fix bug ID #30952
git-svn-id: trunk@35900 -
2017-04-22 12:40:51 +00:00
michael
5cd12a2521 * Better m/mm format specifier docs (bug ID 31449)
git-svn-id: trunk@35892 -
2017-04-22 10:02:29 +00:00
michael
c213a4187a * Fix bug ID #21458
git-svn-id: trunk@35607 -
2017-03-16 13:48:38 +00:00
marcus
824cabd203 Fixed textractquote regression after r35598
git-svn-id: trunk@35604 -
2017-03-16 08:04:38 +00:00
michael
e2d704cc8d * Small optimization in CompareStr as suggested in bug ID #30777
git-svn-id: trunk@35601 -
2017-03-15 21:30:19 +00:00
michael
0ee31963ed * explicit check for Nil in AnsiExtractQuotedString (bug 31212)
git-svn-id: trunk@35598 -
2017-03-15 18:05:39 +00:00
michael
4f02942b55 * Fix bug #31526, missing FixedInt FixedUInt from Delphi Berlin
git-svn-id: trunk@35560 -
2017-03-11 09:26:57 +00:00
marco
6166215174 * make istream signedness equal to MSDN and modern delphi. Denis Kozlov,
mantis #31473

git-svn-id: trunk@35542 -
2017-03-08 15:05:11 +00:00
michael
cc81abdd83 * Patch from Michal Gawrycki to implement streaming interface properties (IComponent) Bug ID
git-svn-id: trunk@35474 -
2017-02-22 21:14:35 +00:00
maciej-izak
3900ccf260 * Rename RecordOp to ManagementOp (more relevant name)
git-svn-id: trunk@35453 -
2017-02-19 18:06:54 +00:00
maciej-izak
af8e0efe57 * Rtti info about Management Operators (MO) in init table for records. Note: commit contains minimal changes for RTL (for proper "make") no functional changes. More RTL changes for fully functionally MO in next commits.
compiler/ncgrtti.pas
  + write_record_operators procedure which fills simple VMT like table for MO.
  * recorddef_rtti save MO (if exists)
  * objectdef_rtti_fields save nil pointer/entry for objects rtti (have same RTL parts like for records)

compiler/options.pas
  + new define FPC_HAS_MANAGEMENT_OPERATORS

compiler/symconst.pas
  + new item itp_init_record_operators for tinternaltypeprefix enum
  + new entry '$init_record_operators$' in internaltypeprefixName

rtl/inc/rtti.inc
  + new field RecordOp (pointer to MO VMT table) in TRecordInfoInit
  + new types to handle MO VMT: TRTTIRecordOpVMT, PRTTIRecordOpVMT, TRTTIRecCopyOp, TRTTIRecVarOp

rtl/objpas/typinfo.pp
  + RecordOp field for TRecInitData record

git-svn-id: trunk@35445 -
2017-02-19 00:22:59 +00:00
svenbarth
870bffc70d * provide access to the method table for raw interfaces (it is written even though $M is not respected by such interfaces currently)
git-svn-id: trunk@35411 -
2017-02-10 16:03:57 +00:00
svenbarth
fd1047c715 * use the correct alignment for the field following the unit name of an interface (raw or not doesn't matter)
git-svn-id: trunk@35410 -
2017-02-10 16:02:23 +00:00
michael
c3e50a36cc * Move fpdoc block after uses clause
git-svn-id: trunk@35398 -
2017-02-05 09:51:43 +00:00
michael
8d7fd39282 * Fix isNan, isInfinity, IsPositiveInfinity
git-svn-id: trunk@35356 -
2017-01-29 11:58:22 +00:00
svenbarth
060cb62f2a * correctly handle alignment for TParameterLocations
git-svn-id: trunk@35355 -
2017-01-28 16:02:09 +00:00
svenbarth
f1a5fbc0df * rename TIntfMethodEntry.ReturnLoc to ResultLocs for consistency with both ResultType and TVmtMethodParam.ParaLocs
git-svn-id: trunk@35347 -
2017-01-28 13:28:03 +00:00
svenbarth
26135d605f + implement interface RTTI inspired by the changes from Steve Hildebrandt, yet not exactly the same. Like his implementation this one isn't Delphi compatible either.
+ added test

git-svn-id: trunk@35341 -
2017-01-27 17:00:15 +00:00
svenbarth
03715bd9a8 + add data records TInterfaceData for COM and TInterfaceRawData for raw interfaces that allow for easier access to data that's only accessible by using pointers (and keeping track of alignment) without further polluting TTypeData
git-svn-id: trunk@35339 -
2017-01-27 16:53:47 +00:00
svenbarth
c6233697be + add utility properties to TPropData to access a specific TPropInfo or the end of the known data of all properties
git-svn-id: trunk@35338 -
2017-01-27 16:49:47 +00:00
svenbarth
bf2891938f + add utility properties to TPropInfo to easily access the next TPropInfo in a list of prop infos (TPropInfo.Next) or the direct, unpadded end of the known information (TPropInfo.Tail)
git-svn-id: trunk@35337 -
2017-01-27 16:47:45 +00:00
michael
f0a8355b84 * AlwaysQuote added (bug ID 31126)
git-svn-id: trunk@35333 -
2017-01-25 22:37:33 +00:00
michael
b5fb706a65 * Fix bug #31176: (Try)StrToBool should accept localized floats
git-svn-id: trunk@35331 -
2017-01-25 21:23:07 +00:00
svenbarth
3b1ae57844 * allow for AlignTypeData() to be inlined
git-svn-id: trunk@35322 -
2017-01-20 15:39:33 +00:00
svenbarth
8e510da317 * adjust AlignTypeData to take a Pointer as argument as it also needs to be used for e.g. subrecords inside TTypeData (e.g. the property table of interfaces)
git-svn-id: trunk@35321 -
2017-01-20 15:38:51 +00:00
svenbarth
e827c28722 + not only add pfResult to the compiler, but also indeed to TParamFlag
git-svn-id: trunk@35291 -
2017-01-13 16:40:09 +00:00
svenbarth
ecb878a7a7 * move PParameterLocation before TParameterLocation for consistency with all other pointer declarations in the unit
git-svn-id: trunk@35285 -
2017-01-13 16:13:18 +00:00
svenbarth
fe28403330 + two more pointer types (PPropData for TPropData and PParameterLocations for TParameterLocations)
git-svn-id: trunk@35284 -
2017-01-13 16:12:26 +00:00
svenbarth
990b0e1657 * fix TParameterLocations.GetLocation()
git-svn-id: trunk@35283 -
2017-01-13 16:11:10 +00:00
svenbarth
0dbc123557 * ensure that TRegisterType and TSubRegister have a size of 1 by moving them at the correct location
git-svn-id: trunk@35282 -
2017-01-13 16:10:17 +00:00
svenbarth
5275c36393 + extend TParamFlags by values for hidden parameters in general and especially the hidden high, self and vmt parameters (this is necessary so a manager approach for Invoke() can be used with as few knowledge about the involved calling conventions as possible)
Note: with this TParamFlags exceeds the size of a Byte

git-svn-id: trunk@35267 -
2017-01-08 16:08:35 +00:00
svenbarth
bd8a7be17e * better implementation of TProcedureParam.GetFlags that correctly handles a TParamFlags with a size > 1 even on big endian
git-svn-id: trunk@35262 -
2017-01-08 12:41:06 +00:00
svenbarth
417f1cd49d + initial implementation of the RTTI for parameter locations (not *yet* used by anything)
The parameter manager converts from the internal compiler representation of
a parameter's location to an RTTI representation. As the general implementation
more or less directly uses the compiler structures for this a platform specific
parameter manager may override this functionality in case some parameter
information changed in a non-backwards compatible way.
The RTTI parameter location has a layout that allows for an easy enumeration
as the size is fixed for all locations. Additionally there are properties that
allow for easy access to the information stored in them.

git-svn-id: trunk@35250 -
2017-01-06 22:21:37 +00:00
florian
0b82f71e8d * take care of the fact that there are 32 bit abis (e.g. ARMHF) which align qword on 8 byte boundaries, resolves issue #31132
git-svn-id: trunk@35218 -
2016-12-30 15:32:56 +00:00
marco
e6029140eb * fix for #31073
git-svn-id: trunk@35203 -
2016-12-27 16:31:14 +00:00
marco
b33da605f3 * move tendian to objpas, alias in sysutils, types. mantis #31150
git-svn-id: trunk@35202 -
2016-12-27 14:30:13 +00:00
Károly Balogh
c7576e4a3f sysutils: enable FINDHANDLE_IS_POINTER for Amiga-like systems and Atari. this allows to remove some Pointer<->THandle casts from the amicommon code
git-svn-id: trunk@35198 -
2016-12-27 03:23:54 +00:00
svenbarth
4717d78ac3 * as restructuring TTypeData to correctly layout tkBool for 64-bit Booleans is basically impossible at least add a comment for tkBool to the tkInt64 and tkQWord branches
git-svn-id: trunk@35188 -
2016-12-23 16:26:16 +00:00
svenbarth
73ed1a9bf1 * fix for Mantis #31140: applied patch by Maciej Izak; this way it's clear what purpose ManagedFldCount has in FPC compared to Delphi
Commit message of patch:

+ New field TotalFieldCount for TTypeData
* Mark ManagedFldCount as deprecated
* Adjusted test trtti12.pp

git-svn-id: trunk@35180 -
2016-12-23 15:32:44 +00:00
svenbarth
2acf542737 * extend TParamFlag by pfConstRef which is set for constref parameters
* extend test trtti9.pp accordingly

git-svn-id: trunk@35175 -
2016-12-20 21:37:07 +00:00
svenbarth
1553aa5639 * declare the first field of TProcedureParam as TParamFlags to avoid potential problems if more than 8 entries should be used (especially if some day the hidden Self and High parameters should be written)
* rename first field of TProcedureParam to ParamFlags and introduce a property Flags for backwards and Delphi compatibility

git-svn-id: trunk@35174 -
2016-12-20 21:13:04 +00:00
svenbarth
a9d14fe30b * extend TOrdType by entries for 64-bit values
* have tkInt64 and tkQWord entries also contain the OrdType field (basically the compiler can now use the same function to generate them only with different type kinds)

+ added test

git-svn-id: trunk@35135 -
2016-12-16 14:22:04 +00:00
svenbarth
460f309035 * fix for Mantis #31123, applied patch by Maciej Izak
* adjusted test trtti10.pp due to renamed RecInitTable field

Original commit message:

Public interface for init table for records in TypInfo:

* Rename RecInitTable to RecInitInfo (because it is special kind of PTypeInfo for init table of record). Has more sense in practical usage.
+ New structure TRecInitData (and related PRecInitData) to handle data for (init) type info for records (aka init table)
+ New structure TInitManagedField and pointer type PInitManagedField (for init table)
+ Special helper property RecInitData to get PRecInitData for tkRecord

+ test attached

git-svn-id: trunk@35134 -
2016-12-16 13:43:12 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
svenbarth
7089677a22 * change RecInitTable into a direct reference to avoid an unnecessary indirection as both the full and init RTTI of a record always reside inside the same unit
git-svn-id: trunk@35128 -
2016-12-14 18:40:16 +00:00
svenbarth
12dba952f0 * integration of Part 2 patch of Mantis #30687 with a few adjustments:
- indentation in ncgrtti.pas
  - fewer ifdefs in rtti.inc
  - InitTable/Terminator field as first field to avoid padding on targets that require proper alignment and have SizeOf(Pointer) > 4

Original message by Maciej Izak:

Breaking change for rtti layout for record rtti. Init table
is always accessible from regular rtti. Rtti table contains indirect
reference to init table, additionally init table contains nil-terminator (for
rtl purposes - the only way to determine kind of info : init or rtti). Pros:

* will be possible to create more Delphi compatible code for RTTI, finally end-user can access to *real* managed fields of records (some work on TypInfo.pp is still required but is not necessary).
* important step forward for management operators (anyway this commit is not directly related to management operators)
* much more optimal memory allocation/initialization/finalization for records created/destroyed by InitializeArray/FinalizeArray, for example:

type
  TBar = record
    f1,f2,f3,f4,f5,f6,f7,f8,f9: byte;
    s: string;
  end;

previously:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE was executed 10 times

now:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE is executed just once

+ test attached

git-svn-id: trunk@35125 -
2016-12-13 23:03:11 +00:00
florian
759a53dfc7 - removed comment that the unit is a prototype and changing: the comment was introduced 10 years ago, the unit is part of stable release for years, it is documented
git-svn-id: trunk@35073 -
2016-12-04 21:16:00 +00:00
florian
55d9fea401 * CLASSESINLINE -> FGLINLINE
* inlining enabled

git-svn-id: trunk@35072 -
2016-12-04 21:14:00 +00:00
michael
0d772ae198 * Patch from Silvio Clecio to remove unused variable (bug ID 31044)
git-svn-id: trunk@35062 -
2016-12-04 11:56:05 +00:00
svenbarth
fde867cd5c * change IIDStr from a field to a property as otherwise the compiler would access the wrong field offset as it assumes RawUnitName to be a 255-byte ShortString
git-svn-id: trunk@35026 -
2016-12-01 12:59:20 +00:00
svenbarth
4fb77b71ec * fix for Mantis #31029, based on the patch provided by Silvio Clécio: PArrayOfByte is not necessary and in fact the purpose of TArrayOfByte is a different one from reference counting (namely to ensure correct passing of the parameter), so renamed accordingly (plus a comment); similar change in SetDynArrayProp. Also Get-/SetPropValue in Variants unit has been adjusted to make use of Get-/SetDynArrayProp.
+ added adjusted test

git-svn-id: trunk@35025 -
2016-11-30 19:32:41 +00:00
Károly Balogh
6dff85df58 math: replace trunc() with int() in some functions working with floats to avoid some unnecessary int64->double conversions, as trunc returns an integer, which then has to be converted back to float
git-svn-id: trunk@34995 -
2016-11-27 18:08:32 +00:00
Károly Balogh
5c87e870fd tabs to spaces fix, no functional changes
git-svn-id: trunk@34994 -
2016-11-27 17:59:41 +00:00
michael
c0f183258f * Added EProgrammerNotFound and EInvalidOpException, by Silvio Clecio (bug ID 30627)
git-svn-id: trunk@34986 -
2016-11-27 15:54:06 +00:00
michael
10360a823e * Fix bug ID #30960
git-svn-id: trunk@34970 -
2016-11-26 17:28:55 +00:00
michael
3e21810dbd * Change comments for AdjustLineBreaks (bug ID 30959)
git-svn-id: trunk@34969 -
2016-11-26 17:05:54 +00:00
michael
18f2592433 * float version of modulo (Patch from Thaddy De koning, bug ID #30744)
git-svn-id: trunk@34968 -
2016-11-26 16:57:34 +00:00
michael
47a59f269a * Added some explanatory comments about the use of this include file
git-svn-id: trunk@34925 -
2016-11-20 10:07:15 +00:00
michael
d55ed2a3fd * CamelCase for Top/Left properties (bug ID 30413)
git-svn-id: trunk@34905 -
2016-11-16 07:57:57 +00:00
michael
8e3381b4bc Fix bug #30930
git-svn-id: trunk@34903 -
2016-11-15 20:15:33 +00:00
michael
f648bdecba * Made some additional functions inlined (Bug ID 30909)
git-svn-id: trunk@34874 -
2016-11-11 10:28:19 +00:00
michael
2e3ab0d37e * Introduce TFPList.CheckIndex (bug ID 30887)
git-svn-id: trunk@34873 -
2016-11-11 10:26:05 +00:00
michael
aa6a8acb72 * Introduce TFPSList checkindex (bug ID 30886)
git-svn-id: trunk@34872 -
2016-11-11 10:16:57 +00:00
michael
9b21d9a87e * Inline some functions, bug ID #30905
git-svn-id: trunk@34868 -
2016-11-11 09:33:28 +00:00
michael
860ad25430 * Add some comments about used algorithms for increasing/decreasing list sizes
git-svn-id: trunk@34861 -
2016-11-09 21:28:20 +00:00
michael
32ec90dccf * Fix wrong index check for insert, border is different
git-svn-id: trunk@34834 -
2016-11-07 13:39:56 +00:00
michael
9926d37dda * Fix bug #30869, introduce CheckIndex in TStringList
git-svn-id: trunk@34817 -
2016-11-06 17:04:37 +00:00
pierre
a81d2b58f8 Rectify last accessed char in TBigEndianUnicideEncoding.GetChars, fixes test/units/sysutils/tencodingtest.pp failure with -gc option
git-svn-id: trunk@34740 -
2016-10-17 10:48:28 +00:00
michael
9f88f52ddf * Getters/Setters should be private
git-svn-id: trunk@34725 -
2016-10-15 20:59:01 +00:00
svenbarth
63f0c7a2c3 Fix for Mantis #30734: Implement Delphi-compatible functions StrToUInt64(), StrToUInt64Def and TryStrToUInt64 as inline forwarders to the existing respective QWord functions
git-svn-id: trunk@34710 -
2016-10-13 17:49:50 +00:00
michael
5810ff8154 * Patch from Maciej Izak for delphi compatible TLocaleOptions (bug ID 30660)
git-svn-id: trunk@34683 -
2016-10-08 22:23:34 +00:00
Jonas Maebe
265923a2ee * several fixes for TMultiReadExclusiveWriteSynchronizer, based on patch by
Derek (mantis #28830)
   o ability for a thread to acquire a readlock when it already holds a
     write lock, or vice versa
   o detect when thread1 releases a lock while it hadn't acquired one
   o correct result of beginwrite (return true only when another thread
     held/acquired a write lock before the current thread got it)
   o extra compared to Derek's patch: replaced some additional
     (mostly pre-existing) interlocked*() hacks with proper memory
     barriers, made formatting consistent, fixed compilation on platforms
     where tthreadid is not an integer type, improved tthreadid hashing
     function for 64 bit platforms, fixed some comments

git-svn-id: trunk@34678 -
2016-10-08 20:45:45 +00:00
michael
bc6819aa91 * Attempt to avoid overflow when reallocating stream
git-svn-id: trunk@34518 -
2016-09-12 08:41:42 +00:00
michael
f4e3068c8b * AnsiExtractquotedStr returns original string if unquoted
git-svn-id: trunk@34495 -
2016-09-10 18:51:02 +00:00
michael
5917b38706 * AnsiDequotedString needs to return empty if it equals "" (bug ID 30220)
git-svn-id: trunk@34494 -
2016-09-10 18:43:59 +00:00
michael
ee40c7618c * Make TFPGListEnumeratorSpec public (Bug ID 30573)
git-svn-id: trunk@34485 -
2016-09-10 17:15:10 +00:00
michael
b504cc4131 * Make singletons thread-safe
git-svn-id: trunk@34483 -
2016-09-10 16:51:50 +00:00
michael
8318ba30d4 * Patch from Ondrej Pokorny to implement specifying encoding when saving/loading from stream
git-svn-id: trunk@34475 -
2016-09-10 10:59:48 +00:00
michael
de7e5d73c0 * Patch from Ondrej Pokorny to add GetAnsiBytes/GetAnsiString
git-svn-id: trunk@34474 -
2016-09-10 10:44:30 +00:00
michael
b8b96f0c8c * Patch from Laco to limit growth of TFPList
git-svn-id: trunk@34462 -
2016-09-08 19:03:11 +00:00
svenbarth
ed144a6535 * fix for Mantis #30567; the method only needs to be left with nothing to do if both method and thread are Nil
git-svn-id: trunk@34456 -
2016-09-08 17:22:45 +00:00
svenbarth
947c876ba3 * use the indirect start and end symbols for the resource string table (affects both the compiler and the RTL)
git-svn-id: trunk@34185 -
2016-07-22 16:01:39 +00:00
pierre
7ff12e144f Fix IgnoreCase error in CompareUnicodeString function
git-svn-id: trunk@34167 -
2016-07-22 05:29:35 +00:00
nickysn
c205cb03c8 * in SysUtils.DecodeDate(), cast the result of trunc() to longint (trunc
normally returns int64 in FPC), before performing any further calculations -
  the result always fits in a longint (the date is range checked against
  MaxDateTime and that is well within longint limits). This generates faster
  code on non 64-bit targets and also fixes i8086 compilation, which previously
  failed on register allocation on this function.

git-svn-id: trunk@33946 -
2016-06-10 19:39:44 +00:00
svenbarth
345d83c3e3 Merge RTTI changes from packages branch (including adjustments that were required due to changes in trunk since then). These changes favor source backwards compatibility in contrast to Delphi compatibility. Binary compatiblity is however drastically broken due to the indirect references that are platform independant!
Merged revision(s) 28239-28289 from branches/svenbarth/packages:
Provide the possiblity to switch between the direct and indirect RTTI symbols.

ncgrtti.pas, TRTTIWriter:
  + get_rtti_label, get_rtti_label_ord2str & get_rtti_label_str2ord: add new "indirect" parameter and pass that along to rtti_mangledname
hlcgobj.pas, thlcgobj:
  * g_incrrefcount, g_initialize, g_finalize, g_array_rtti_helper: for now pass along False to get_rtti_label()
ncgvmt.pas, TVMTWriter:
  * writevmt: for now pass along False to get_rtti_label()
ncgld.pas, tcgrttinode:
  * pass_generate_code: for now pass along False to the get_rtti_label*() methods
........
Provide possibility to select between using a direct and an indirect RTTI reference. This way the references can be changed for selected cases.

ncgrtti, TRTTIWriter:
  * ref_rtti: new "indirect" parameter that's relayed to rtti_mangledname()
  * write_rtti_reference: new "indirect" paramater that's relayed to ref_rtti()
........
Switch properties to use the indirect type information without breaking backwards compatiblity. :)

compiler/ncgrtti.pas, TRTTIWriter:
  * published_properties_write_rtti_data: use the indirect reference, not the direct one
rtl/objpas/typinfo.pp:
  * to allow compilation with both 2.6.x and 2.7.1 and too avoid too many ifdefs at least in the declarations we define a macro TypeInfoPtr which is either PTypeInfo (2.6.x) or PPTypeInfo (2.7.1 and newer)
  * TPropInfo: rename PropType to PropTypeRef and change type to TypeInfoPtr
  + TPropInfo: add a new property PropType which returns a PTypeInfo out of the PropTypeRef depending on the compiler version
........
Switch further simple types (sets, enums, class references, pointers) to indirect type information (again without breaking backwards compatibility).

compiler/ncgrtti.pas, TRTTIWriter.write_rtti_data:
  * enumdef_rtti, setdef_rtti, classrefdef_rtti & pointerdef_rtti: write an indirect RTTI reference

rtl/objpas/typinfo.pp, TTypeData:
  * rename BaseType to BaseTypeRef, CompType to CompTypeRef, InstanceType to InstanceTypeRef and RefType to RefTypeRef and change their type to TypeInfoPtr
  + add properties BaseType, CompType, InstanceType & RefType which return a PTypeInfo out of the corresponding *Ref field depending on the compiler version
........
Switch class and interface parent as well as extended type to indirect type information

compiler/ncgrtti.pas, TRTTIWriter:
  * write_rtti_data.objectdef_rtti.objectdef_rtti_class_full: use indirect reference for class parent and extended type
  * write_rtti_data.objectdef_rtti.objectdef_rtti_interface_full: use indirect reference for interface parent

rtl/objpas/typinfo.pp, TTypeData:
  + add new method DerefTypeInfoPtr which returns Nil if the indirect reference is Nil and otherwise returns the dereferences indirect reference (for 2.6.x the direct reference is returned as is)
  * rename ParentInfo to ParentInfoRef, HelperParent to HelperParentRef, ExtendedInfo to ExtendedInfoRef, IntfParent ot IntfParentRef and RawIntfParent to RawIntfParentRef and change their type to TypeInfoPtr
  + introduce ParentInfo, HelperParent, ExtendedInfo, IntfParent and RawIntfParent properties that return a PTypeInfo and use the new DerefTypeInfoPtr to return the correct type info value
  * change the other newly introduced properties of TTypeData to use DerefTypeInfoPtr as well to be on the safe side
........
Switch record/object fields to indirect type information references.

compiler/ncgrtti.pas, TRTTIWriter.fields_write_rtti_data:
  * use the indirect reference for the object parent type
  * use the indirect reference for the field type

rtl/inc/rtti.inc:
  * TRecordElement: change TypeInfo to PPointer for 2.7.1 and newer
  * RecordRTTI: correctly dereference the element type for 2.7.1 and newer
  * fpc_copy: correctly reference the element type for 2.7.1 and newer
........
Switch static arrays to indirect RTTI reference.

compiler/ncgrtti.pas, TRTTIWriter.write_rtti_data:
  * arraydef_rtti: write the dimension types and the final field type as indirect references

rtl/inc/rtti.inc:
  * TArrayInfo: switch ElInfo to PPointer for 2.7.1+
  * ArrayRTTI & fpc_copy: correctly dereference ElInfo for 2.7.1+
rtl/objpas/typinfo.pp, TArrayTypeData:
  * switch ElType and Dims to PPTypeInfo; no backwards compatibility needed here as TArrayTypeData was added in 2.7.1 only

tests/test/trtti8.pp: fix test
........
Switch dynamic arrays to indirect RTTI references.

compiler/ncgrtti.pas, TRTTIWriter.write_rtti_data.arraydef_rtti:
  * write indirect references for the two element entries

rtl/inc/dynarr.inc:
  * tdynarraytypedata: change elType2 to PPointer for 2.7.1+
  * fpc_dynarray_clear, fpc_dynarray_setlength & fpc_dynarray_copy: correctly dereference elType2 for 2.7.1+
rtl/objpas/typinfo.pp, TTypeData:
  * rename elType and elType2 to elTypeRef and elType2Ref respectively and change type to TypeInfoPtr
  * add properties elType and elType2 which return PTypeInfo by dereferencing elTypeRef and elType2Ref respecively correctly
  * remove a few stray "inline" directives in the implementation
........
Switch procedure parameters and result type to indirect RTTI references.

compiler/ncgrtti.pas, TRTTIWriter.write_rtti_data.procvardef_rtti:
  * write_procedure_param: use indirect RTTI reference
  * write result info for both methods and procvars as indirect RTTI reference
  * write parameters for procvars as indirect RTTI reference

rtl/objpas/typinfo.pp:
  * TProcedureParam: change type of ParamType to PPTypeInfo (no backwards compatiblity needed here; was added for 2.7.1)
  * TProcedureSignature: change type of RseultType to PPTypeInfo (no backwards compatibility needed here; was added for 2.7.1)
  * TTypeData: remark in the comments of tkMethod that ResultTypeRef and ParamTypeRefs are of type PPTypeInfo and not PTypeInfo

tests/test/trtti9.pp: 
  * fix test
........
Remove no longer needed "indirect" parameter for TRTTIWriter methods.

ncgrtti.pas, TRTTIWriter:
  - ref_rtti & write_rtti_reference: remove "indirect" parameter
  * ref_rtti: call rtti_mangledname with "indirect" always set to "true"
  - remove "true" parameter on callsites of write_rtti_reference & ref_rtti
........

git-svn-id: trunk@33944 -
2016-06-10 17:01:51 +00:00
marco
869d24f7d1 * spelling mistakes fpc repo part, mantis #30233
git-svn-id: trunk@33882 -
2016-06-02 20:01:09 +00:00
svenbarth
dc5d9c7001 rtl/objpas/classes/classes.inc, TThread:
* Synchronize: fill the syncentry using the correct size

git-svn-id: trunk@33879 -
2016-06-02 18:48:41 +00:00
svenbarth
d5cc59c22e Avoid the creation of a TExternalThread instance for Synchronize() and Queue() (Delphi does the same).
Note: the Sender parameter of WakeMainThread will be Nil for such threads. This is Delphi compatible.

rtl/objpas/classes/classesh.inc, TThread:
  + TThreadQueueEntry: new field ThreadID so that entries with Thread = Nil can be removed
rtl/objpas/classes/classes.inc, TThread:
  * InitSynchronizeEvent: setup ThreadID field
  * Synchronize: use a local TThreadQueueEntry if no TThread instance was passed in
  * Queue: setup ThreadID
  * RemoveQueueEvents: also check for ThreadID when trying to find the current thread

git-svn-id: trunk@33863 -
2016-05-31 20:01:52 +00:00
michael
253589b0b6 * Fix compilation for msdos
git-svn-id: trunk@33704 -
2016-05-17 18:41:33 +00:00
michael
a5d38c7ba6 * Added TStringBuilder
git-svn-id: trunk@33695 -
2016-05-16 15:23:40 +00:00
marco
d4fd7520ef * wrap getfirst and getlast in fcount<>0 because otherwise it will dereference nil.
Mantis #30080

git-svn-id: trunk@33598 -
2016-05-01 14:43:12 +00:00
michael
3e96806f7e Renamed DisposeAndNil to FreeMemAndNil
git-svn-id: trunk@33378 -
2016-03-29 07:55:58 +00:00
michael
92b8bf97c0 * Added DisposeAndNil (bug ID 28895)
git-svn-id: trunk@33377 -
2016-03-29 07:33:28 +00:00
michael
231ec77175 * Delphi compatibility classes (Patch by Silvio Clecio, bug ID #29917)
git-svn-id: trunk@33362 -
2016-03-28 12:57:42 +00:00
michael
f380aeb63d * Fix from Andrea Mauri to make formatfloat delphi-compatible in case of negative zero (bug ID 26465)
git-svn-id: trunk@33344 -
2016-03-27 10:40:09 +00:00
michael
bcdfe055a8 * Fix bug ID #26944 (thousandseparator, patch from wp)
git-svn-id: trunk@33343 -
2016-03-27 10:13:16 +00:00
michael
2ec2f1fc16 * Fix bug in WrapText (bug ID 26677)
git-svn-id: trunk@33342 -
2016-03-27 09:41:23 +00:00
michael
73bf5dd3f0 * Extra error message for using find in unsorted list
git-svn-id: trunk@33330 -
2016-03-26 12:26:22 +00:00
michael
10bbfce412 * Allow Find to work with user-sorted stringlists.
git-svn-id: trunk@33328 -
2016-03-26 09:13:27 +00:00
michael
2b077f6af3 * Revert Integer -> SizeInt change where appropriate, capping result when needed
git-svn-id: trunk@33327 -
2016-03-26 07:41:34 +00:00
michael
5085009410 * Added GetDriveIDFromLetter, bug ID #28318
git-svn-id: trunk@33300 -
2016-03-20 19:04:49 +00:00
marco
66608fec02 * unicode executeprocess from work during Lazarus convention in IJsselstein
git-svn-id: trunk@33290 -
2016-03-19 17:59:42 +00:00
Jonas Maebe
2b210335a1 * fixed pointer arithmetic errors in WideStrAlloc/StrBufSize/StrDispose
(patch by Iks, mantis #29710)

git-svn-id: trunk@33271 -
2016-03-18 13:12:11 +00:00
michael
668f8eec91 * Patch from Silvio Clecio to declare EArgumentNilException (Bug ID 29850)
git-svn-id: trunk@33258 -
2016-03-16 19:10:10 +00:00
michael
416151a335 * Adapted string routines so they use sizeint instead of integer (bug ID 29814)
git-svn-id: trunk@33246 -
2016-03-13 18:59:21 +00:00
michael
671416959d * Added SameStr, for symmetry and consistency with SameText (bug ID 29821)
git-svn-id: trunk@33238 -
2016-03-13 16:31:41 +00:00
florian
8b81ce7e25 * use PtrUInt instead of Cardinal in GenericAnsiStrLComp and GenericAnsiStrLIComp, resolves #29815
git-svn-id: trunk@33218 -
2016-03-11 20:38:48 +00:00
michael
839a0445a4 Fixed bug in split when final word has length 1 (bug ID 29798)
git-svn-id: trunk@33209 -
2016-03-09 19:56:57 +00:00
michael
5568ee5513 * Bug ID #29779, add DWord versions of StrToInt
git-svn-id: trunk@33153 -
2016-03-05 13:50:59 +00:00
marco
b38b3a7c1e * patch from Ondrej to fix splitrecttype aliasing on windows. Mantis #29557
added alias of tarray4integertype too.

git-svn-id: trunk@33152 -
2016-03-05 13:50:02 +00:00
marco
eb1d895718 * fix reexport of record types in classesh, bug #29776 patch by Ondrej.
git-svn-id: trunk@33144 -
2016-03-04 10:42:40 +00:00
michael
364abc3c07 * Author retracted erf/erfc functions due to copyright issues
git-svn-id: trunk@33130 -
2016-02-28 08:27:01 +00:00
michael
3da0f82995 * Add error functions erf/erfc, bug ID #29740
git-svn-id: trunk@33128 -
2016-02-27 14:59:51 +00:00
svenbarth
6d81760136 typinfo.pp, TTypeData:
* document the property data that follows for interface types (both COM and Corba)

git-svn-id: trunk@33106 -
2016-02-19 15:23:52 +00:00
michael
2a33ee63bb * Forgot to commit, constant for TThread.ExecuteInthread
git-svn-id: trunk@33101 -
2016-02-17 07:46:56 +00:00
michael
789b80f702 * ExecuteInThread added
git-svn-id: trunk@33100 -
2016-02-16 18:59:35 +00:00
michael
ae3b0eab2a * Fix stringlist addstrings so virtual method is preserved (bug id 0029630)
git-svn-id: trunk@33099 -
2016-02-16 18:59:01 +00:00
sergei
161f812113 * Explicitly typecast (-longint) to longint, otherwise it becomes an int64 on 64-bit targets, causing wrong result of sign(longint). Mantis #29649.
git-svn-id: trunk@33096 -
2016-02-14 10:29:11 +00:00
michael
db19d73ec0 * Add ClearFirst parameter to AddStrings (bug ID 29630)
git-svn-id: trunk@33092 -
2016-02-13 11:03:51 +00:00
sergei
9b84581f4c + function copysign(x,y), calculates abs(x)*sign(y), private for unit math (not in interface).
* fixed sinh and arsinh return values at -0.0 and -Inf.

git-svn-id: trunk@33069 -
2016-02-07 15:34:02 +00:00
sergei
a4ed9f3b54 * Improved sign(x) functions to be branchless in most cases. Resolves #14206.
git-svn-id: trunk@33067 -
2016-02-07 11:18:31 +00:00
michael
dd00b26c09 * Implement missing functions (Fraction/Exponent/Mantissa/Sign)
git-svn-id: trunk@33060 -
2016-02-06 12:44:23 +00:00
michael
a999f055ef * Implement missing functions (Fraction/Exponent/Mantissa/Sign)
git-svn-id: trunk@33059 -
2016-02-06 12:44:05 +00:00
michael
21920b9cea * Correct string type
git-svn-id: trunk@33058 -
2016-02-06 12:17:41 +00:00
michael
cf530f117e * Faster stringreplace (bug ID 26864)
git-svn-id: trunk@33055 -
2016-02-06 10:19:56 +00:00
svenbarth
e3060130a4 Adjustments so that the resource string related tables are provided inside the system unit (both for indirect and direct entry targets).
rtl/inc/system.inc:
  + new variables that hold pointers to the tables
  + new procedure SetupEntryInformation() that should be used in the entry points of indirect entry targets to setup cross target fields
  + for direct entry targets the two resource string tables are imported here and supplied as initialization to the table pointers
objpas/objpas.pp:
  * adjust table declarations so that the pointers provided from the System unit are used
  * adjust usages of the tables as they are now pointers
win32/system.pp:
  * Exe_Entry: use SetupEntryInformation()
win/syswin.inc:
  * Dll_Entry: use SetupEntryInformation()

git-svn-id: trunk@33028 -
2016-01-29 17:19:33 +00:00
michael
46315176f4 * Patch from Silvio Clecio implementing TFPGMapObject (Bug ID 29438)
git-svn-id: trunk@32987 -
2016-01-22 23:07:05 +00:00
michael
702dd7f31f * Forgot to commit, part of Inoussas update of unicode tables
git-svn-id: trunk@32986 -
2016-01-22 22:58:51 +00:00
michael
6df35742ae * Fix bug #0029461, faSymlink is incompatible with Delphi and plain wrong
git-svn-id: trunk@32985 -
2016-01-22 21:07:27 +00:00
michael
2b80ac1353 * Fix bug ID #29415 (compilation with 2.6.4)
git-svn-id: trunk@32959 -
2016-01-17 09:21:07 +00:00
michael
4e7115a956 * 2 Patches from Silvio Clecio
git-svn-id: trunk@32947 -
2016-01-15 20:59:29 +00:00
michael
64c324caaf * Patch from Silvio Clecio to add a TryGetValue method to TFPGMap (bug ID 29397)
git-svn-id: trunk@32942 -
2016-01-15 07:48:49 +00:00
michael
8544b8a500 * Patch from Anthony Walter to make IsValidIdent more strict in case of dotted identifiers (bug ID 29364)
git-svn-id: trunk@32920 -
2016-01-10 22:57:19 +00:00