Commit Graph

2366 Commits

Author SHA1 Message Date
Michaël Van Canneyt
1cdbefe851 Make sure RTL str consts have consistent ending. Fixes issue #40272 2023-05-14 12:48:55 +02:00
marcoonthegit
8d0b822a27 * check for frac(dt) being slightly lower than a whole number. Patch by Werner P
Resolves #40140
2023-04-23 12:32:53 +02:00
mattias
e8546a9e41 rtl: classes: added parameter aName to TFindComponentClassExEvent 2023-04-13 15:33:38 +02:00
marcoonthegit
8e7572faba * small cleanup, remove redundant result assignment and unused variable (from Lagprogramming on forum) 2023-04-11 14:13:39 +02:00
Nikolay Nikolov
1eca53a681 + support 16-bit pointers in TFPList.IndexOf 2023-04-01 21:50:56 +03:00
Nikolay Nikolov
538f8201e2 + support 16-bit pointer size in TFPGInterfacedObjectList.IndexOf 2023-04-01 21:49:33 +03:00
Nikolay Nikolov
34471a6403 + support 16-bit pointer size in TFPGObjectList.IndexOf 2023-04-01 21:48:32 +03:00
Michael Van Canneyt
6ff542a13e * SafeFormat and helper function to convert array of const to string in a safe manner 2023-03-31 22:13:05 +02:00
florian
466561f09f * patch by Rika: Use Index* for pointer lists, resolves #40218 2023-03-25 21:32:29 +01:00
marcoonthegit
33071fd179 * Add ptr types for fixed(u)int, fixes #40205 2023-03-20 11:29:47 +01:00
Sven/Sarah Barth
e774a6275c * change Result of CheckSynchronize to true when at least one method was executed (matches with both FPC and Delphi documentation) 2023-03-17 15:53:25 +01:00
Sven/Sarah Barth
b2b2606e36 + add function reference suitable overload of TThread.ForceQueue() 2023-03-11 17:08:32 +01:00
Michaël Van Canneyt
0e2102e172 * Resource handle is not resource ID 2023-03-08 16:12:59 +01:00
Michaël Van Canneyt
c3c3bd3471 * Fix windows compilation 2023-03-08 10:09:58 +01:00
Michaël Van Canneyt
f9a96e5e63 * Avoid useless exceptions by checking existence of resource 2023-03-07 11:43:39 +01:00
Sven/Sarah Barth
d40a2dbb12 + add generic utility function ConstParamIsRef<> to determine whether a specific type is passed by-value or by-reference as a const parameter 2023-03-06 23:24:36 +01:00
Sven/Sarah Barth
b878a0d390 * fix typo in resource string 2023-03-06 23:24:35 +01:00
florian
66891b1d59 * patch by Rika: Implement TCurrencyHelper.Ceil/Floor, resolves #40134 2023-01-31 22:58:51 +01:00
Michaël Van Canneyt
fead1ce818 * Fix compilation 2023-01-31 19:39:30 +01:00
Michaël Van Canneyt
c5af4c420e * Hopefully fixed GetFileStamps/FileGetDateTimeInfo 2023-01-31 19:05:48 +01:00
florian
a9f9996dc8 + support leap seconds in TryEncodeTime, resolves #40121 2023-01-30 22:40:15 +01:00
Bi0T1N
eb62a71a5f Add Delphi-compatible TCurrencyHelper 2023-01-30 13:10:47 +00:00
Pierre Muller
b95bfd07d9 Fix sysutils unit compilation failure for wasm32-wasi wince and possibly more targets 2023-01-27 14:42:05 +00:00
Michaël Van Canneyt
0bad315daf * Fix TDateTimeInfoRec 2023-01-23 18:09:43 +01:00
Michaël Van Canneyt
735fd20a6a * (Hopefully) fix compilation for non-win,non-unix platforms 2023-01-23 10:05:18 +01:00
Michael Van Canneyt
d1b2fe1659 * Date/Time info for files (Delphi compatibility) 2023-01-21 13:45:04 +01:00
Michael Van Canneyt
32884082e3 * Checks for directory and special directories 2023-01-19 12:21:56 +01:00
mattias
fdea66d217 rtl: added TBinaryObjectReader.BeginComponent 2023-01-15 10:56:58 +01:00
mattias
ea4768456f rtl: ObjectBinaryToText, ObjectTextToBinary: support unitname/classname 2023-01-08 20:30:52 +01:00
mattias
c1f3960388 rtl: added overload GetClass(UnitName,ClassName), implemented UnregisterClass, overload TStream.WriteComponent(Instance,WriteUnitName) 2023-01-08 15:46:49 +01:00
mattias
b0f5d5a4e1 rtl: TBinaryObjectWriter.Version 2023-01-07 10:19:29 +01:00
mattias
b641c564c6 rtl: TReader: FindComponentClass using field name and classname 2023-01-07 10:19:29 +01:00
florian
9889a81062 * patch by Rika: Improve SinH and TanH, resolves #40086 2023-01-04 19:04:40 +01:00
florian
96eb5da939 * patch by Bart B: Implement sinh(), cosh() and tanh() for single, double and extended parameters, resolves #40083 2023-01-04 17:04:10 +01:00
florian
a260f1987c * patch by Rika: Improve Math.CotH, resolves #40084 2023-01-03 23:13:33 +01:00
florian
cfbdf90ab0 * patch by Rika to optimize ArcCos, resolves #40078 2023-01-02 18:56:41 +01:00
florian
60c80a45a0 * patch by Bart B to complete missing functions in the math unit, resolves #40055 2023-01-01 22:52:57 +01:00
marcoonthegit
bfb904640a * fix for #40069 add swapdimensions 2022-12-30 15:41:47 +01:00
florian
69eebe4c0c + patch by Rika to implement missing TPointF methods, resolves #40057
+ test by Rika
2022-12-29 15:20:49 +01:00
florian
cf41a549b9 * patch by Bart B and Rika for *H functions, part of #40055 2022-12-26 21:47:47 +01:00
florian
d948420eba + (modified) patch by Bart B to add Cycles conversion functions, part of #40055 2022-12-25 16:08:33 +01:00
florian
48b9751419 * patch by Alexey Torgashin to resolve #40054 2022-12-20 21:46:33 +01:00
florian
1761d3c09d + operator TPointF./, resolves #40046 2022-12-19 22:58:34 +01:00
Ondrej Pokorny
d1f999100b Add SetToArray and ArrayToSet functions for more general RTTI Set handling 2022-12-18 13:32:15 +00:00
florian
f1e391fb41 * patch by Make TPointF * TPointF a component-wise multiplication, resolves #40042 2022-12-17 18:22:16 +01:00
Ondrej Pokorny
5109f0ba44 add missing TSizeF, TRectF properties and features 2022-12-17 11:22:41 +00:00
florian
725da25477 * patch by Rika to improve IntPower, resolves #40036 2022-12-13 19:40:08 +01:00
florian
c92056fcac * patches by Rika: Fix a bug in LdExp(extended), and test Math.Frexp/Ldexp implementations instead of own, resolves #40030 2022-12-11 20:04:46 +01:00
Michaël Van Canneyt
13548088b7 * Implement case-insensitive version of Equals & Contains. Fix issue #40029 2022-12-10 15:18:26 +01:00
florian
06b0927f1e * patch by Rika to improve FrExp and LdExp 2022-12-09 22:30:56 +01:00
florian
f8f824aa8d * avoid unneeded widening of expressions due to constants defaulting to extended 2022-11-26 23:27:02 +01:00
florian
9c8f362acc * more robust calculation of TBITS_SHIFT 2022-11-06 22:33:38 +01:00
Rika Ichinose
7243befdb7 Better TBits. 2022-11-06 20:55:38 +00:00
Michaël Van Canneyt
d5777174d8 * Optimization of TStringHelper.Split by Rika. Fixes issue #39948 2022-10-13 12:45:30 +02:00
florian
989895c82f * patch by Bart B: FormatFloat correctly outputs NaN now, resolves #32868
+ test
2022-10-11 22:11:33 +02:00
florian
3963a30f9e * prettier exception message, resolves #39909 2022-09-18 15:50:55 +02:00
florian
717d38f060 * prettier casing of Str* functions, resolves #39879 2022-08-25 20:40:23 +02:00
marcoonthegit
9ad1995c6d * Patch by Rika to have a char specific TStringHelper.replace. Probably faster with low number of char matches. closes #39707
* also raise rangeerror for startindex<0 in previous committed join() patch.
2022-08-20 16:16:58 +02:00
marcoonthegit
d25daba08a * Patch from Alexey T. closes #39705
* don't use copy in helper.indexof(). Watch those 0 based indexes.
2022-08-18 13:59:00 +02:00
florian
9e14dee1c3 * fixed Math.Tanh as proposed by Paolo Valle, resolves #39867 2022-08-17 20:56:43 +02:00
marcoonthegit
533cd82922 * applied patch from Alexey for closes #39704
* reviewed checks at start of function to match Delphi in rangecheck errors and other exits
 * test for the above.
2022-08-17 18:38:02 +02:00
florian
cc66eb27ab * patch by Rika: More numerical stability for Math, resolves #39863 2022-08-14 22:26:09 +02:00
marcoonthegit
f532cf1698 * Use an own put for tfpginterfacedobjectlist as per bug #39846.
Maybe not the most elegant, but solves the immediately
2022-08-14 16:24:35 +02:00
florian
306559667c * patch by Rika for ArcTan2 to reduce code size 2022-08-11 22:32:45 +02:00
florian
f18d6f1c85 * fixed and improved generic ArcTan2 implementation by Paolo Valle, resolves #39861 2022-08-10 18:23:22 +02:00
florian
30f5558bf2 * patch by Rika: optimize TStringHelper.StartsWith / EndsWith, resolves #39706 2022-07-14 22:38:07 +02:00
florian
0122044226 * part of last commit 2022-07-06 20:39:38 +02:00
florian
4fecfe3df3 * fix SysUtils.HashName as proposed by Awkward in #39827, resolves #39827
* adapted to syscodepages.inc for the fixed HashName
2022-07-06 20:38:45 +02:00
Michaël Van Canneyt
b2ad1d3efd * Patch from Bart. Fix for issue #39797 2022-06-25 14:33:33 +02:00
Michaël Van Canneyt
0cc00b355c * Fix by Bart to fix conversion to temperature. Fix issue 39776 2022-06-11 11:47:35 +02:00
marcoonthegit
2df9dd9c14 * another fix for bug #39758, this time the end of the string 2022-06-05 17:46:58 +02:00
marcoonthegit
5b90eaf2dd * move char index checks up. fixes bug #39758 2022-06-04 22:40:56 +02:00
marcoonthegit
e5ac0b2689 * anonymous method overloads for synchronize/queue. 2022-06-01 13:54:06 +02:00
marcoonthegit
d38c881828 * add IEquatable<T>, requested on forum. 2022-06-01 11:00:56 +02:00
Michaël Van Canneyt
712823eb6c * Add some delphi compatibility enumerateds to TShiftState 2022-05-07 10:20:04 +02:00
Michaël Van Canneyt
cab37732c4 * Avoid memory allocation in IsNullOrWhitespace. Fix issue #39702 2022-05-05 12:04:52 +02:00
marcoonthegit
c203097ec2 * add overload to getenvironmentvariable so that it is also found when windows is before sysutils in the uses list. bug #39448 2022-04-25 14:07:57 +02:00
Sven/Sarah Barth
862cffa087 * have the unsigned 32-bit overload of IntToHex use the signed 32-bit one to avoid usage of 64-bit arithmetic (and parameter passing) when it can be avoided 2022-04-19 14:24:01 +02:00
Sven/Sarah Barth
d32134dd1a * fix #39664: ensure that the 8- and 16-bit signed overloads of IntToHex return the correct number of digits
+ added test
2022-04-19 14:24:00 +02:00
marcoonthegit
2457016671 * TStringlist constructor with ownsobjects parameter, Delphi compatible + empty constructor to avoid compiler getting confused 2022-04-18 21:23:10 +02:00
inoussa
551f267670 Unicode source code's size reduction: short field names, delete unicodenumtable.pas. 2022-03-26 21:17:54 +00:00
inoussa
27ed2808dc Unicode 14, Unicode Collation Algorithm 14, CLDR 40 support. 2022-03-15 10:19:15 +00:00
Michaël Van Canneyt
5ca52bcab1 * Add Flush method to TFileStream. Fix issue #39619 2022-03-10 09:35:28 +01:00
Michaël Van Canneyt
59a7024d73 * Move() check for identical index. Additional fix for #39617 2022-03-08 11:42:24 +01:00
Michaël Van Canneyt
2a19e152b7 * Micro-optimization. Fix issue #39617 2022-03-08 11:35:43 +01:00
florian
15b7a8763f * avoid range check error and overflow in objpas.hash, should resolve #39561 2022-02-12 14:28:59 +01:00
Michaël Van Canneyt
f9a6e082ba * Remove duplicate HexDigits constants. Fix issue #39462 2022-01-31 10:05:33 +01:00
Michaël Van Canneyt
7097a1030f * Added Read64/Write64 2022-01-23 12:18:43 +01:00
Michaël Van Canneyt
042eb7e8c1 * Small safety precaution 2022-01-23 12:03:24 +01:00
Sergey Larin
e27ea76b88 The TStream.ReadBuffer and TStream.WriteBuffer methods have changed the Count parameter type to NativeInt.
Changed the implementation of ReadBuffer, WriteBuffer so that the size of the blocks when calling Read and Write does not exceed High(Longint).
Notes:
- Thanks to this change, for example, a file larger than 2GB can be loaded into TMemoryStream.
- The fact that the Count parameter has the NativeInt type is compatible with the latest versions of Delphi.
2022-01-23 10:25:55 +00:00
Michaël Van Canneyt
30b0d98636 * Change return type of some functions, so -1 can actually be returned, patch by Zeljko Avramovic (issue 39268). 2022-01-22 11:17:44 +01:00
Michaël Van Canneyt
d6a26f2c28 * Remove component from previous owner. Fix issue #39529 2022-01-13 22:41:01 +01:00
florian
0764158fd1 * reverted TryStrToInt to the old implementation since after the val fixed the changes are not
needed anymore as pointed out by Bart B
2022-01-09 18:35:31 +01:00
florian
983fbff871 * proper range checking for TryStrToDWord, should resolve all issues in #39406 2022-01-02 21:46:14 +01:00
florian
435f3a9fe2 * allow a range of Low(Longint) to High(DWord) in TryStrToInt, see also issue #39406
* moved test
2022-01-02 21:33:01 +01:00
florian
2a93e65511 * seperator => separator 2022-01-02 13:12:33 +01:00
Sven Barth
2636966e2a * adjust ToInteger of the Boolean helpers so that it returns the value of either True or False, but not any other value (e.g. in the *Bool types). This is not only Delphi compatible, but also fixes the compilation problem of the one or other 32-bit platform (like PowerPC) after e65b822a. 2021-12-05 00:03:05 +01:00
Sven/Sarah Barth
e65b822a0c + add type helpers for the remaining Boolean types (QWordBool and Boolean{8,16,32,64}) 2021-12-03 14:52:19 +01:00
Michaël Van Canneyt
b1412ec5c0 * Make hexdigits a global constant 2021-11-30 09:06:41 +01:00
florian
18e0979379 + Exception.GetBaseException 2021-11-23 23:01:06 +01:00
florian
64c21bb88b * fix bootstrapping wtih 3.2.2 and -Cpcoreavx2 2021-11-14 23:13:51 +01:00
Michaël Van Canneyt
5df6671ff2 * Fix issue 39431 2021-11-11 19:36:05 +01:00
florian
40df955423 * StrTo* functions are now using the TryStrTo* functions 2021-11-01 14:55:41 +01:00
Nikolay Nikolov
8e730d20db + implemented FindFirst, FindNext and FindClose in SysUtils for the WASI platform 2021-10-19 15:39:59 +03:00
Michaël Van Canneyt
e97e27b8d5 * Raise exception for fileseek positions that do not fit in longing. Issue #39407 2021-10-17 17:58:11 +02:00
Michaël Van Canneyt
1e74c418ae * Fix integer overflow not being detected. Issue #39406 2021-10-17 12:44:44 +02:00
Nikolay Nikolov
8f95c14827 + implemented SysUtils.FileGetDate for WASI 2021-10-11 15:08:48 +03:00
Bernd Kreuss
2210143239 fix wording of error message when field not found during reading of lfm file 2021-09-02 11:16:56 +02:00
Ondrej Pokorny
bce2f26234 * TEncoding.GetEncoding - create unicode encodings, not only MBCS 2021-09-01 09:31:50 +02:00
Michaël Van Canneyt
52c8ac0ca0 * Fix by Mark Paley to add IfThen for StringList and TStringDynArray. Issue #39314 2021-09-01 09:29:50 +02:00
Michaël Van Canneyt
c587f5a681 * fix compilation 2021-09-01 09:29:50 +02:00
Michaël Van Canneyt
c4069b5fe8 * Remove spurious var, prevents fpdoc from handling record 2021-09-01 09:29:50 +02:00
Ondrej Pokorny
a55794d80d DateTimeToString: do not write #0 separators 2021-08-11 12:22:29 +00:00
marcoonthegit
37863a6166 * Add skeleton for TPoint3D 2021-08-05 17:17:29 +02:00
nickysn
b878d461c8 * fixed compilation for i8086 and 8-bit targets after r49622. The conditional
ifdef checks for the ordinal helpers rewritten to be less dependendant on
  defines, such as CPU16/CPU32/CPU64 and instead use sizeof(integer),
  sizeof(nativeint) and sizeof(nativeuint)

git-svn-id: trunk@49634 -
2021-07-23 23:23:47 +00:00
michael
e6a593c5fa * Patch from Zeljko Avramovic to extend ordinal/float helpers
git-svn-id: trunk@49622 -
2021-07-21 11:36:05 +00:00
marco
c8be89c7fa * fix from Sebastian Hellwig for writeunicodestring bytes number, mantis 0038963
git-svn-id: trunk@49478 -
2021-06-05 15:42:34 +00:00
michael
61cd38e6db * Fixed Issue ID38920: twriter crashes on readonly nil component
git-svn-id: trunk@49389 -
2021-05-22 07:54:30 +00:00
michael
59d4aaf5ec * Fix issue ID #38900: union wrongly implemented
git-svn-id: trunk@49376 -
2021-05-17 14:56:09 +00:00
michael
5cde6facdb * Patch from Werner Pamler to fix count of digits in periods
git-svn-id: trunk@49299 -
2021-05-01 06:32:48 +00:00
florian
dbee3bcc0d * fixed MSecsToTimeStamp by Lagunov Aleksey, resolves #38631
git-svn-id: trunk@49247 -
2021-04-22 20:14:00 +00:00
Károly Balogh
b149718566 sinclairql: added an entirely stub (for now) sysutils unit. added a classes unit. enabled building the whole rtl
git-svn-id: trunk@49239 -
2021-04-20 10:02:39 +00:00
michael
fe78829b99 * Fix issue ID #38772
git-svn-id: trunk@49225 -
2021-04-18 10:45:47 +00:00
florian
c1f85ac3a1 + initial implementation of path dependent IsFileNameCaseSensitive/IsFileNameCasePreserving functions for darwin
git-svn-id: trunk@49164 -
2021-04-10 13:29:59 +00:00
michael
e99c9ddd75 * Add deprecation message
git-svn-id: trunk@49038 -
2021-03-23 11:53:33 +00:00
Károly Balogh
1b1e1009c1 rtl: reverted some accidental but harmless extra changes committed in r49036
git-svn-id: trunk@49037 -
2021-03-23 09:36:45 +00:00
Károly Balogh
45b5e9215c rtl: remove defines for v2.x compiler from the common part of the RTL. It's no longer suppported to build with that
git-svn-id: trunk@49036 -
2021-03-23 09:32:49 +00:00
svenbarth
893cf511bc * fix casing of "VAr", no code changes
git-svn-id: trunk@48862 -
2021-03-02 08:06:05 +00:00
florian
2932787dee * use SizeInt for counters in math unit, all non-32 bit targets should benefit from this
git-svn-id: trunk@48815 -
2021-02-26 22:47:06 +00:00
michael
47be45830c * Fix issue ID #38462
git-svn-id: trunk@48580 -
2021-02-10 11:00:22 +00:00
florian
706e72e1fd * better error message for runtime errors 202 and 210, resolves #38254
git-svn-id: trunk@48438 -
2021-01-27 21:28:55 +00:00
svenbarth
b446023e5b * use Str instead of IntToStr to avoid overload problems with unsigned types
git-svn-id: trunk@48400 -
2021-01-24 14:57:24 +00:00
svenbarth
c3fd06b6b5 * fix for Mantis #38390: use Val instead of StrToInt to avoid overload problems
+ added test

git-svn-id: trunk@48399 -
2021-01-24 14:57:20 +00:00
svenbarth
38cde38177 * make TProxyStream.Check an abstract method; as it is right now one had to override it anyway because it always raised an exception
git-svn-id: trunk@48097 -
2021-01-06 20:25:12 +00:00
Károly Balogh
4b3fee38a5 dati.inc: tabs 2 spaces and whitespaces formatting fix. no functional changes
git-svn-id: trunk@47808 -
2020-12-18 11:55:21 +00:00
ondrej
706d89d6cc * GlobalNameSpace must EndWrite before it is released to unlock the critical section
git-svn-id: trunk@47636 -
2020-11-29 18:49:36 +00:00
ondrej
de6f3ea9b5 * rename generic TStringBuilder to TGenericStringBuilder to make code tools happy
git-svn-id: trunk@47553 -
2020-11-24 09:43:46 +00:00
Tomas Hajny
7169b6d04c * provided additional information in comments in the include file header
git-svn-id: trunk@47547 -
2020-11-24 00:45:00 +00:00
Tomas Hajny
95394d7f98 + added TZ variable based offset calculation
git-svn-id: trunk@47535 -
2020-11-23 01:08:39 +00:00
ondrej
e34e4b452a * FileSetDate linux compilation
git-svn-id: trunk@47399 -
2020-11-12 14:41:43 +00:00
ondrej
8ce015535a * FileSetDate with TDateTime and UTC for file names
git-svn-id: trunk@47398 -
2020-11-12 14:36:12 +00:00
ondrej
3ea339400e * FileGetDate, FileSetDate linux compilation
git-svn-id: trunk@47397 -
2020-11-12 13:55:01 +00:00
ondrej
d899c9fca4 * FileGetDate, FileSetDate with TDateTime and UTC
git-svn-id: trunk@47396 -
2020-11-12 13:36:39 +00:00
ondrej
33fe3f3ede TSearchRec.GetTimeStamp: fix ifdefs
git-svn-id: trunk@47395 -
2020-11-12 12:17:46 +00:00
michael
4a38d1b34e * Fix bug #38063, corner case in Remove() range checking
git-svn-id: trunk@47392 -
2020-11-12 09:27:00 +00:00
ondrej
934f2dc55d * introduce NowUTC() and GetUniversalTime()
git-svn-id: trunk@47306 -
2020-11-04 09:34:08 +00:00
ondrej
a02d676b06 GetLocalTimeOffset: add InputIsUTC parameter to DateTime-aware overloads
git-svn-id: trunk@47293 -
2020-11-03 18:15:16 +00:00
ondrej
e10ee5ccb4 GetLocalTimeOffset - fix overload call
git-svn-id: trunk@47289 -
2020-11-03 09:46:14 +00:00
ondrej
b51729dac5 File datetime UTC support
git-svn-id: trunk@47210 -
2020-10-26 20:39:21 +00:00
ondrej
0d08b98d47 GetLocalTimeOffset: DateTime-aware overloads (Windows supported, Unix is a ToDo). Issue #35710
git-svn-id: trunk@47206 -
2020-10-26 12:29:18 +00:00