Commit Graph

1421 Commits

Author SHA1 Message Date
michael
2a9e12c709 * Fixed rounding errors in DateTimeToTimeStamp, causing errors in conversions
git-svn-id: trunk@23334 -
2013-01-07 10:28:47 +00:00
michael
b55eb113a6 * Fixed bug ID #23464
git-svn-id: trunk@23328 -
2013-01-06 16:49:35 +00:00
florian
6363567fba * FloatToStrFIntl is used only internally so we can assume that Value is aligned
git-svn-id: trunk@23311 -
2013-01-04 19:13:28 +00:00
florian
8ee1445b81 * stripped trailing spaces
git-svn-id: trunk@23294 -
2013-01-02 10:50:32 +00:00
florian
82f20cedbd * make threading code dependend on feature switch
git-svn-id: trunk@23293 -
2013-01-02 10:48:29 +00:00
florian
0215f00490 * fix compilation of objpas if ansistrings are disabled as requested by Michael Ring on fpc-devel
git-svn-id: trunk@23256 -
2012-12-31 14:26:48 +00:00
svenbarth
70a7a09413 * use the correct thread ID when checking for the main thread
* ensure that the Exception reference is Nil when appending a synchronize entry to the synchronize queue

git-svn-id: trunk@23234 -
2012-12-27 23:36:16 +00:00
svenbarth
764f36a179 Extend TThread with (class) methods and (class) properties from Delphi 2007 and newer.
Especially for the introduction of the Queue method the internal Synchronize handling was modified. Instead of handling only one event there is now a queue of events which is walked completely when CheckSynchronize is called. Each entry in the queue can carry a PRTLEvent which will be signaled when the contained method has been executed and thus Synchronize methods can still be blocking.
Exceptions inside the queued methods are either handed back to the calling method for Synchronize events or raised directly (after leaving the queue in a valid state) to the caller of CheckSynchronize.

The way platform specific adjustments can be made to TThread was changed. Instead of implementing the Constructor and Destructor directly one now implements the methods SysCreate and SysDestroy which are called from the Constructor and Destructor respectively. All RTLs were adjusted for this and should be controlled by the platform maintainers for correct compilation (Unix works).

The new method NameThreadForDebugging has two overloaded variants: one with the thread name as AnsiString and one with the thread name as UnicodeString.
By default the AnsiString variant calls the UnicodeString variant and the latter needs to be implemented. This can be changed by defining THREADNAME_IS_ANSISTRING for a platform. Then the UnicodeString variant calls the AnsiString one and the AnsiString one needs to be implemented.

Also added was a global property CPUCount for the System unit. This property returns the number of virtual cores of the system.

New methods and functions that should be implemented per platform are:
System.GetCPUCount (default returns 1)
Classes.TThread.GetSystemTimes (default zeros the struct)
Classes.TThread.NameThreadForDebugging (default does nothing)

More detailed information about the added methods will be available in the feature announcement mail.

git-svn-id: trunk@23227 -
2012-12-27 16:16:17 +00:00
svenbarth
e914ec7f00 Add platform independant support for "GetTickCount" and "GetTickCount64" to unit "SysUtils". "GetTickCount" is declared as deprecated from the beginning and thus "GetTickCount64" should be used instead.
The default implementation of "GetTickCount" just uses the lower 32-Bit from the result of "GetTickCount64". 
The default implementation of "GetTickCount64" is based upon "Now" for systems that support a floating point unit (and thus "Now"). 
Other systems can define a "SysTimerTick" function which is used instead if "HAS_SYSTIMERTICK" is defined.

The Windows implementation of "GetTickCount" uses Windows' "GetTickCount" function. 
The implemenation of "GetTickCount64" checks whether the system is a Windows Vista or newer and then uses Windows' "GetTickCount64" function. Otherwise Windows' "GetTickCount" is used also.

The Unix implementation of "GetTickCount" is the default one. 
The "GetTickCount64" implementation uses "fpgettimeofday".

git-svn-id: trunk@23215 -
2012-12-23 16:12:57 +00:00
michael
11a531ab62 * Fixed bug #23477
git-svn-id: trunk@23135 -
2012-12-12 15:21:28 +00:00
Jonas Maebe
9804fd527b * don't add a thousands separator in FormatFloat if there are no digits
before it because the value is too small, regardless of what the format
   pattern sepcifies (patch by Bart Broersma, mantis #13076)

git-svn-id: trunk@23095 -
2012-12-02 16:57:41 +00:00
michael
66553a253e * Applied and expanded patch from Luiz Americo to implement faster notifyobservers (bug ID 23419)
git-svn-id: trunk@23089 -
2012-12-02 11:14:49 +00:00
michael
e3b48d6eb2 * Simplified observer/observed GUIDs, patch from Luiz Americo (Bug ID 23420)
git-svn-id: trunk@23088 -
2012-12-02 11:09:51 +00:00
michael
217679843e * IFPObserver methods made public
git-svn-id: trunk@23080 -
2012-11-29 13:28:11 +00:00
michael
b774bbb681 * Use sender when notifying observers
git-svn-id: trunk@23079 -
2012-11-29 13:22:51 +00:00
svenbarth
bb5dc545f8 rtl/objpas/fgl.pp:
Fix typo in comment; fixes Mantis #23352

git-svn-id: trunk@23036 -
2012-11-19 19:23:58 +00:00
sergei
186cbaaf18 * Ansistring versions of MkDir,ChDir,RmDir: make a full copy of argument string. This is necessary because underlying implementations can modify directory separators in argument, causing crash if argument resides in read-only memory. This is also consistent with shortstring variants of same procedures.
git-svn-id: trunk@23000 -
2012-11-16 18:27:55 +00:00
michael
4ecfde31e1 * Prevent Move from freeing an associated object if OwnsObjects=True (reported on sourceforge)
git-svn-id: trunk@22992 -
2012-11-16 11:04:44 +00:00
michael
a3f7a7fdb4 * Avoid overflow when reading from streams > 2gb
git-svn-id: trunk@22945 -
2012-11-06 23:41:49 +00:00
florian
39aef35bdc * pass not only exception address but also frame to raise:
if an address is passed the compiler cannot know a good 
  value for the frame so it passed nil and no stack trace is printed, resolves #12528

git-svn-id: trunk@22932 -
2012-11-04 20:40:21 +00:00
michael
9d6b4aa946 * Fix dayOfWeek for dates < 0 (bug ID #23144)
git-svn-id: trunk@22679 -
2012-10-17 07:15:01 +00:00
michael
6eade12d3f * Take care of Florian's remark that FList may be nil when constructor failed
git-svn-id: trunk@22593 -
2012-10-08 15:11:10 +00:00
michael
3cafdc2a58 * Fix from Luiz Americo to avoid crash when a freenotification is registered during destroy. (bug ID 23031)
git-svn-id: trunk@22589 -
2012-10-08 12:02:11 +00:00
michael
61fecf4562 * Patch from Luiz Americo to clean up tlist (bug ID 23024)
git-svn-id: trunk@22585 -
2012-10-08 11:01:39 +00:00
marco
5d42d3a53c * change make TBinaryObjectWriter.WriteStr public mantis #22973
Delphi seems to use .writestr also for shortstring only, so the 
   function is the same.

git-svn-id: trunk@22556 -
2012-10-06 10:06:55 +00:00
marco
a48aba60fb * fix for Delphi incompatible DelimitedText, Mantis #19610, big patch from Reinier Olislagers.
git-svn-id: trunk@22549 -
2012-10-05 16:56:09 +00:00
Jonas Maebe
b4971c72d3 * partial fix for mantis #22912 (waiting on clarification from Unicode
consortium for the character.pas unit)

git-svn-id: trunk@22494 -
2012-09-28 07:57:45 +00:00
Jonas Maebe
92064356f0 * prevent code page conversion in CharInSet(widechar,tsyscharset)
git-svn-id: trunk@22464 -
2012-09-26 20:46:19 +00:00
Jonas Maebe
349a682596 * corrected license header from GPL to LGPL + static linking exception like
the rest of the FPC RTL, after confirming with the original author that
    this is ok (mantis #22879)

git-svn-id: trunk@22413 -
2012-09-17 12:12:42 +00:00
Jonas Maebe
404e1a34a4 * changed resource handle parameters from THandle to TFPResourceHMODULE so
they don't truncate the handle data on 64 bit platforms (patch by
    Anton Kavalenka, mantis #21721)

git-svn-id: trunk@22392 -
2012-09-14 15:05:08 +00:00
michael
441e059f32 * Changed ooChanged to ooChange, to be more consistent with tense in other values
git-svn-id: trunk@22262 -
2012-08-28 12:32:15 +00:00
michael
8d9f8e19c3 * remove use of ooCustom to avoid polluting custom use
git-svn-id: trunk@22261 -
2012-08-28 12:30:06 +00:00
michael
8a64893df6 * Forgot to commit
git-svn-id: trunk@22260 -
2012-08-28 07:20:42 +00:00
michael
445ec2672a * TCollection.Exchange also needs to notify
git-svn-id: trunk@22258 -
2012-08-27 19:35:54 +00:00
michael
43be53351e * Added observer support
git-svn-id: trunk@22257 -
2012-08-27 19:28:14 +00:00
Jonas Maebe
193c7af57f * print literal e/E in formatfloat if not followed by +/- (remaining part of
mantis #22290)

git-svn-id: trunk@22248 -
2012-08-26 14:51:32 +00:00
florian
1da4c0c3ce * SinCos overloads added, resolves #22663
git-svn-id: trunk@22139 -
2012-08-19 22:09:03 +00:00
marco
666fecb6df * workaround for unsupported construct in fpdoc. (enum declared nested in class)
git-svn-id: trunk@21999 -
2012-08-02 13:01:27 +00:00
michael
789a6452c9 * Implemented overloaded variant of fileage function
git-svn-id: trunk@21867 -
2012-07-11 10:42:23 +00:00
michael
597483610b * Added UniversalTimeToLocal LocalTimeToUniversal as per bug #17435
git-svn-id: trunk@21866 -
2012-07-11 10:15:25 +00:00
michael
64ab9c06d3 * Added GetLocalTimeOffset function
git-svn-id: trunk@21865 -
2012-07-11 09:56:34 +00:00
joost
025f840dd5 * Added ReplaceStr and ReplaceText functions, for Delphi compatibility
git-svn-id: trunk@21810 -
2012-07-07 08:12:07 +00:00
marco
262ff83658 * binary compare data compared data1 with itself, mantis #22241 Patch by ...
git-svn-id: trunk@21576 -
2012-06-10 09:30:11 +00:00
Jonas Maebe
df9c8652be * add default parameter values defined in implementation also to interface
(they don't have effect when they only appear in the implementation, and
     therefore this situation will cause an error in the future)

git-svn-id: trunk@21523 -
2012-06-07 22:36:15 +00:00
Tomas Hajny
99a9955195 + ExpandFileNameCase implementation added
git-svn-id: trunk@21466 -
2012-06-02 22:30:08 +00:00
svenbarth
2f92336b94 Forgot to commit the extension of the TSearchRec with the FindData for NativeNT.
git-svn-id: trunk@21439 -
2012-05-31 07:26:57 +00:00
michael
032528115f * Patch from Mattias Gaertner to improve quicksort memory use (Bug 22119)
git-svn-id: trunk@21386 -
2012-05-24 19:18:44 +00:00
marco
6b93cbcbea * Fix for #21636, TFPSList.Pack several fixes.
git-svn-id: trunk@21039 -
2012-04-25 17:25:00 +00:00
paul
e399f8f9bf rtl: reduce warnings about deprecated symbol access
git-svn-id: trunk@21001 -
2012-04-23 05:57:44 +00:00
florian
2677187b2f * inline several math methods (though a lot won't be inlined yet because they take open array parameters), resolves #21040
* more compact formatting (removed empty lines)
* remove call to invalid argument in arctanh, arccosh doesn't have it either

git-svn-id: trunk@20936 -
2012-04-19 21:14:09 +00:00