Commit Graph

1198 Commits

Author SHA1 Message Date
paul
538cf8667b rtl: fix compilation under windows
git-svn-id: trunk@14590 -
2010-01-10 06:28:50 +00:00
Jonas Maebe
8da0a031bf * fixed memory leak in new TMultiReadExclusiveWriteSynchronizer
(fwaitingwriterlock was not freed)
  * fixed typo in comment
  * free all memory in trwsync.pp test

git-svn-id: trunk@14588 -
2010-01-09 23:14:53 +00:00
Jonas Maebe
106baa8b2f * optimized version of TMultiReadExclusiveWriteSynchronizer that allows
concurrent readers (mantis #14451)

git-svn-id: trunk@14587 -
2010-01-09 23:00:45 +00:00
marco
8e9a7e14ad * Revised yesterday solution to a more general one. Executeprocess gets
another parameter, a set type with flags, default = []

git-svn-id: trunk@14572 -
2010-01-07 20:49:28 +00:00
florian
4ddebcbf1c * handle subrange enumeration types in GetEnumValue correctly, resolves #15467
git-svn-id: trunk@14544 -
2010-01-05 16:10:13 +00:00
florian
31e2f16484 resolves #15453:
* fixes i386 DivMod with negative numbers with a patch from Jonas
* fixes generic DivMod with negative numbers
* test updated

git-svn-id: trunk@14532 -
2010-01-03 14:59:01 +00:00
florian
42ae8bf971 * fixed memory stream compilation on 64 bit targets
git-svn-id: trunk@14523 -
2010-01-02 16:05:57 +00:00
florian
b5167560c3 * T*MemoryStream now uses PtrInt for sizes and positions so it can be bigger than 2 GB on 64 Bit systems, resolves #15313
git-svn-id: trunk@14513 -
2010-01-01 21:05:18 +00:00
paul
c83fc67e32 compiler: write correct method kind for constructors,destructors and class methods
git-svn-id: trunk@14512 -
2010-01-01 20:22:02 +00:00
paul
db0f23e643 compiler: write not dummy unit name for enumeration and dynamic array rtti
git-svn-id: trunk@14511 -
2010-01-01 19:32:53 +00:00
paul
17bd267141 compiler, rtl: write calling conventions for tkMethod members (issue #0014573)
git-svn-id: trunk@14508 -
2010-01-01 14:36:33 +00:00
paul
5cc182ac07 rtl: fix FormatFloat to skip first spaces
git-svn-id: trunk@14490 -
2009-12-28 15:53:35 +00:00
florian
8cecea9b53 * GetEnumName handles subrange types correctly, resolves #15377
git-svn-id: trunk@14461 -
2009-12-22 11:36:47 +00:00
florian
230142f08b * change length parameter of CompareMem/CompareMemRange into PtrUInt, resolves #15190
* use CompareByte inside these routines instead of simple handmade code

git-svn-id: trunk@14435 -
2009-12-13 11:42:05 +00:00
paul
1cd32f5327 rtl: implement TCollection.SetPropName
git-svn-id: trunk@14295 -
2009-12-02 03:40:26 +00:00
giulio2
d257b19798 * Skip UTF-8 BOM in TParser (classes) and dfmreader (fcl-res)
git-svn-id: trunk@14292 -
2009-11-30 21:55:25 +00:00
michael
01ed4a6745 * Implemented OnBeep to install custom beep handler
git-svn-id: trunk@14254 -
2009-11-22 17:33:56 +00:00
paul
64b6700c61 rtl: add enumerator for the TFPGList type
git-svn-id: trunk@14245 -
2009-11-21 18:51:48 +00:00
marco
4104d9f481 * More pluggability of the RTL. Mantis 15124
git-svn-id: trunk@14212 -
2009-11-18 21:16:12 +00:00
marco
17062d667c * ansistring versions of mk/rm/chdir in objpas, Mantis 15010. The os-dependant routines of *nix/os2/win/dos have been converted
git-svn-id: trunk@14211 -
2009-11-18 18:04:51 +00:00
marco
805e5a79c6 * writer.writeset, reader.readset as per mantis 10501
git-svn-id: trunk@14200 -
2009-11-16 12:50:18 +00:00
marco
6df3352279 * move constants out of ifndef wince, bug #15057.
git-svn-id: trunk@14163 -
2009-11-13 14:09:50 +00:00
marco
5163b44ac6 * Patch for "formatsettings" overloads of currency functions, mantis 15067
git-svn-id: trunk@14162 -
2009-11-13 09:10:24 +00:00
marco
b3ea1668db * improvements to sysuitls date/time formatting routines: (Mantis 14905,Sergei)
- Adds threadsafe (Delphi-compatible) versions of DateToStr, 
	TimeToStr, DateTimeToStr, FormatDateTime.
   - Core functionality moved to DateTimeToString, which directly 	
	uses 'out' parameter in order to avoid unnecessary result copying.
   - Modified the code so no temporary AnsiStrings are used (speed).
   - Fixes a bug which would cause infinite recursion if 
     (Short|Long)DateFormat variable would contain 'd' character or, 
      likewise, (Short|Long)TimeFormat would contain 't'.
   - Fixes numerous small Delphi compatibility issues, like: empty format 
      string has the same effect as 'C'; overlong tokens treated as the 
      longest possible ones (e.g. 'ddddddddd' is the same as 'dddddd'); 
      'AM/PM' is output preserving its case, etc.
   - minor reformating

git-svn-id: trunk@14116 -
2009-11-08 15:07:00 +00:00
marco
e018effcd2 * non-resolved methods are not written. Mantis 13846(laz) / 14798(fpc)
git-svn-id: trunk@14115 -
2009-11-08 14:21:03 +00:00
marco
27114853b4 * TStream.Read/writeqword. Mantis 15023
git-svn-id: trunk@14111 -
2009-11-08 11:47:50 +00:00
marco
887d8a9d92 * replace encodedate/time by try variants mantis 14969
git-svn-id: trunk@14110 -
2009-11-08 11:43:01 +00:00
pierre
2b879fcb54 MaybeSkipTimeWrap function: Change NewDate var_type to var to suppress warnings
git-svn-id: trunk@14091 -
2009-11-07 00:30:32 +00:00
marco
6ed7d33569 * patch from 15003 from M spiller, reverting now implemented.
git-svn-id: trunk@14078 -
2009-11-06 10:52:23 +00:00
marco
21f569391b * Patch from Sergei/Anton. Mantis 10948. Under ifndef ver2_2
git-svn-id: trunk@14069 -
2009-11-05 20:42:18 +00:00
ivost
10e78efaac * removed commented code in TryStringToGUID
git-svn-id: trunk@14060 -
2009-11-04 23:04:30 +00:00
ivost
537825dee9 * fixed TryStringToGUID: this function throwed an exceptions
git-svn-id: trunk@14059 -
2009-11-04 23:02:32 +00:00
marco
8bc0583045 * trystrto* variants with formatsettings.
git-svn-id: trunk@14018 -
2009-11-03 21:20:10 +00:00
paul
8292fcc49e rtl: override TObject.Equals for TBits and TStrings classes
git-svn-id: trunk@14013 -
2009-11-03 02:01:06 +00:00
paul
aa5a5e79ce merge revisions: 13909,13923,13924,13934,13935,13942,13943,13944,13946,13948,13950,13951,13952,13983,13994:
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler: 
  + start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
  + add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
  + add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
  + add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
  + tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
  + allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
  + prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
  + increase ppu version
  + test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
  + add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop

git-svn-id: trunk@14008 -
2009-11-02 03:24:48 +00:00
paul
dfef902c53 rtl: introduce new TObject methods: UnitName, GetHashCode, Equals, ToString added for compatibility with delphi 2009.
+ changes in compiler, utils, packages to resolve identifier conflicts with the new TObject methods (like changing of UnitName arguments to AUnitName, adding Classes. before the toString, etc). (issue #0014931)

git-svn-id: trunk@14005 -
2009-11-01 16:22:47 +00:00
marco
de350d5c26 * fixed compilation win32/win64 after (my) last commit.
due to wince <-> win32/win64 headerwise. wince has some identifiers in Windows that win32/win64 has in activex
 * patches for comobj/comserv from 0014822 and 0014939	as well as one minor fix to activex.

git-svn-id: trunk@13991 -
2009-10-31 22:31:26 +00:00
ivost
4d0272fd5c * resourcestring SCannotCreateDir: translated from german to english
git-svn-id: trunk@13990 -
2009-10-31 22:08:22 +00:00
marco
09b22de964 * TStreamAdapter + relevant constants. From 10608
git-svn-id: trunk@13988 -
2009-10-31 20:13:41 +00:00
marco
b5e361a4cb * TOleStream + TProxystream (Mantis 8376)
git-svn-id: trunk@13984 -
2009-10-30 18:27:26 +00:00
ivost
1e5b61c240 * added 3 new resources strings to describe library errors
git-svn-id: trunk@13974 -
2009-10-30 13:10:31 +00:00
ivost
bab5c5d8a3 * parameter "Separator" of function TryStrToDate was not passed to IntStrToDate
git-svn-id: trunk@13959 -
2009-10-26 17:34:07 +00:00
ivost
243e0ff3b5 * reverted r13949 because it's unnecessary test
git-svn-id: trunk@13954 -
2009-10-25 11:06:38 +00:00
ivost
d4d3227e77 * fixed CompareDate function. Only dates are compared now, ignoring time of day.
git-svn-id: trunk@13949 -
2009-10-24 20:53:00 +00:00
michael
89ec956733 * Patch from Mattias Gaertner to fix property overrides. (bug ID 14885)
git-svn-id: trunk@13939 -
2009-10-24 12:34:26 +00:00
michael
ed950da9cc * Forgot raise statement in strtodate (thanks to Denis Golovan)
git-svn-id: trunk@13928 -
2009-10-23 10:24:24 +00:00
ivost
40069c3112 * changed output parameters from var to out. This suppress some unnecessary hints and it's also done in datih.inc
git-svn-id: trunk@13920 -
2009-10-22 21:26:24 +00:00
ivost
2bfe336917 * reverted compon.inc to the state of r13298 (csFreeNotification maybe set even with no freelist allocated)
git-svn-id: trunk@13917 -
2009-10-21 23:26:45 +00:00
ivost
0c725eae43 * fixed setting wrong component state. csDesignInstance and csInline were set inversed.
git-svn-id: trunk@13916 -
2009-10-21 19:24:10 +00:00
michael
4c2fe8bc31 * Correctly split date/time parts when dateseparator is a space
git-svn-id: trunk@13888 -
2009-10-17 11:18:16 +00:00
ivost
fff6e218af * readded BeforeDestructor that calls Destroying (delphi compatibility issue)
* uncommented code in Notification procedure (delphi compatibility issue)

git-svn-id: trunk@13874 -
2009-10-16 18:12:11 +00:00
ivost
3cfcdb2ab9 * reverted parts of r13852 (removed +/- with sets and added include/exclude)
git-svn-id: trunk@13873 -
2009-10-16 17:34:50 +00:00
michael
e4244e0452 * Forgot to commit
git-svn-id: trunk@13871 -
2009-10-16 15:31:25 +00:00
michael
cb29ddbd04 * TryStrToTime/TryStrToDate no longer need to catch exceptions
git-svn-id: trunk@13865 -
2009-10-16 09:31:09 +00:00
michael
dadd6631ad * Patch from Alex Rayne (bug ID 14622) to provide some overloaded versions of the strtodate/strtotime functions
git-svn-id: trunk@13864 -
2009-10-16 08:16:55 +00:00
ivost
242560f138 * corrected some typo that was inserted by r13853
git-svn-id: trunk@13854 -
2009-10-13 15:48:42 +00:00
ivost
65bca0a26d * enhanced how observers are notified by subjects on destroying
git-svn-id: trunk@13853 -
2009-10-13 12:22:36 +00:00
ivost
74c09e2268 * fixed strange free notification behavior of TComponent. Must be some memory corruption or so.
* replaced deprecated Include / Exclude calls

git-svn-id: trunk@13852 -
2009-10-13 12:05:14 +00:00
ivost
f18a2ab69c * fixed bug in TFPSList.SetCount. Deref was not called when shrinking the list.
git-svn-id: trunk@13851 -
2009-10-12 21:23:38 +00:00
marco
1e7ee7aef4 * Patch from Paul Ishenin, load stringlists with fmdenywrite. (improves sharing behaviour)
git-svn-id: trunk@13803 -
2009-10-04 13:36:43 +00:00
Jonas Maebe
1aa1686778 * fixed varbyref in variant conversion helpers (patch+test by Paul Ishenin,
mantis #14536)

git-svn-id: trunk@13687 -
2009-09-10 16:57:06 +00:00
Jonas Maebe
c2c68ddb8f - removed FPC_NEW_BIGENDIAN_SETS define and if(n)defs
* left old cpu-specific set helper code under ifdef FPC_OLD_BIGENDIAN_SETS
    in case someone wants to write new assembler set helpers (although most
    of them should be optimally generated by the compiler already if
    http://wiki.freepascal.org/FPC_HowToDo#Bit.28field.29_getting.2Fsetting_primitives
    are optimally implemented)

git-svn-id: trunk@13582 -
2009-08-23 08:16:40 +00:00
Jonas Maebe
0eec337a00 - removed SUPPORT_UNALIGNED, FPC_SUPPORTS_UNALIGNED and FPC_UNALIGNED_FIXED
defines and ifdefs (already all defined by 2.2.4)

git-svn-id: trunk@13581 -
2009-08-23 07:51:26 +00:00
michael
a7ed599879 * Patch from martin friebe (bug id 14380) to fix streaming of frames
git-svn-id: trunk@13567 -
2009-08-20 11:29:06 +00:00
florian
a14db25c64 + procedure DivMod(Dividend: Integer; Divisor: integer; var Result, Remainder: integer); and procedure DivMod(Dividend: cardinal; Divisor: cardinal; var Result, Remainder: cardinal);, resolves #14286
+ assembler implementations of DivMod for i386

git-svn-id: trunk@13508 -
2009-08-09 20:47:06 +00:00
marco
2c82c6a747 * several functions are now marked with overload;
* implementation of RandomFrom for some float type
  (Mantis #12662)

git-svn-id: trunk@13490 -
2009-08-04 08:20:13 +00:00
florian
44f588b7ad * fixed nested comment warning
git-svn-id: trunk@13450 -
2009-07-26 12:55:01 +00:00
florian
bc8ccacab8 * TInterfacedPersistent requires that the interface is requested from the owner if an owner is SetActive
* unified coding style

git-svn-id: trunk@13409 -
2009-07-19 09:36:43 +00:00
florian
5d8835861c + unicode functions for sysutils, makes tunistr6.pp compiling
git-svn-id: trunk@13402 -
2009-07-17 14:05:19 +00:00
florian
ee49e8acb6 * SScanf uses StrToFloat to convert the string to a float so it has to use DecimalSeparator to parse the string
* test adapted to use DecimalSeparator to create the test string

git-svn-id: trunk@13399 -
2009-07-16 21:12:45 +00:00
florian
87df99a53d * reverted partially r11598 because it breaks delphi compatibility and e.g. tw3721.pp
git-svn-id: trunk@13398 -
2009-07-16 21:01:27 +00:00
Jonas Maebe
55578e8226 * fixed FloatToDecimal() for inf/nan (mantis #14143, thanks to
Sergei Gorelkin for the test program)

git-svn-id: trunk@13394 -
2009-07-16 13:11:36 +00:00
florian
6dfd5cb5b8 * fix ExtractFileDrive for \\server\share\path\file: it should return \\server\share
* made test easier to debug

git-svn-id: trunk@13392 -
2009-07-15 20:40:34 +00:00
Jonas Maebe
77feb9d45c * fixed setstrprop() for shortstring properties (based on hint by Zawullon,
mantis #14040)

git-svn-id: trunk@13323 -
2009-06-26 11:34:04 +00:00
ivost
91430b6837 * reverted 13297
git-svn-id: trunk@13298 -
2009-06-19 09:03:51 +00:00
ivost
8b7167e538 * revised TComponent class. There was a lot of outdated, bad, maybe also old code. Tested also with Lazarus.
git-svn-id: trunk@13297 -
2009-06-19 00:07:59 +00:00
ivost
da55f04221 * fixed bug in SetAncestor of TComponent
git-svn-id: trunk@13293 -
2009-06-18 22:38:30 +00:00
Jonas Maebe
79e6ed5047 * fixed CenterPoint() function (patch by Alexander S. Klenin, mantis #13972)
git-svn-id: trunk@13274 -
2009-06-14 14:12:09 +00:00
florian
855a65a061 + RandomRange
git-svn-id: trunk@13262 -
2009-06-11 20:43:24 +00:00
Jonas Maebe
ba951580a2 * fixes and cleanups for tbits (patch by Sergei Gorelkin, mantis #13890)
git-svn-id: trunk@13243 -
2009-06-06 14:35:25 +00:00
ivost
91ae3e8788 * added TryStringToGuid function (former StringToGuid is using this now)
git-svn-id: trunk@13237 -
2009-06-05 20:35:12 +00:00
ivost
db429f2d48 * added GUID_NULL constant
git-svn-id: trunk@13236 -
2009-06-05 20:23:38 +00:00
ivost
b5be9e008e * added GuidCase function to intf/guid helper functions
git-svn-id: trunk@13234 -
2009-06-05 14:36:43 +00:00
florian
398b5806b1 * TCollectionItem.Changed checks update counter of collection, resolves #13813
git-svn-id: trunk@13225 -
2009-06-01 16:09:56 +00:00
Jonas Maebe
ee69d00bec - unconditionally enabled {$ifdef PARAOUTFILE}-code (that define was
decomissioned quite a while ago, but this file was forgotten in
    that process)

git-svn-id: trunk@13181 -
2009-05-21 09:57:45 +00:00
ivost
b340822af2 * added FreeObjects property to TFPGObjectList (as known from TObjectList in contnrs)
git-svn-id: trunk@13108 -
2009-05-06 22:50:25 +00:00
Jonas Maebe
8193cd175d * corrected *Between() functions: add epsilon and truncate, rather than
round the results (bug reported on irc)

git-svn-id: trunk@13107 -
2009-05-06 20:35:20 +00:00
ivost
f38c6c609d * implemented TFPGInterfacedObjectList. it's the same as TFPGObjectList but ref counted.
git-svn-id: trunk@13102 -
2009-05-05 12:26:42 +00:00
Jonas Maebe
9ab6e355a3 * Miscellaneous is with two l's...
git-svn-id: trunk@13087 -
2009-05-03 11:48:30 +00:00
Jonas Maebe
2706eeafcf * comment change: Playthingies -> Miscelaneous
git-svn-id: trunk@13086 -
2009-05-03 08:17:02 +00:00
Jonas Maebe
445c842db3 * made ifthen() declaration in strutils Delphi-compatible (removed overloads
that cause various problems, added "overload" directive so it gets
    overloaded next to the routines in the "math" unit) (based on patch
    by Alexander S. Klenin, mantis #13619)
  - removed "inline" from that function because all the reference increasing/
    decreasing in its body mainly cause code bloat and little if any speed
    increase

git-svn-id: trunk@13084 -
2009-05-02 15:50:41 +00:00
yury
80fe51380d * Removed unused private fields TThread.FMethod and TThread.FSynchronizeException.
* Removed all code of TThread.Synchronize() for BeOS, since existing code is copy/paste from win32 code and does not work anyway.

git-svn-id: trunk@13078 -
2009-05-02 12:09:30 +00:00
Jonas Maebe
f6d452c2c0 * remove the RTL's installed signal handlers at the end of the system
unit's initialization code in case we're in a library
  + implemented InquireSignal(), AbandonSignalHandler(), HookSignal() and
    UnhookSignal() in the sysutils unit
  * for Kylix compatibility, these routines support operating on
    SIGINT and SIGQUIT as well, although they are not hooked by default
    by FPC. The run time errors/exception codes for these signals are
    resp. 217 and 233 (same as in Kylix; I changed ENoWideStringSupport
    to 234).
  * changed the BSD syscall version of fpsigaction to use pointer
    rather than "var" arguments (compatible with other targets, and
    required to be able to pass nil arguments inside the system unit)
  -> together fixes mantis #12704

git-svn-id: trunk@13077 -
2009-05-02 09:40:44 +00:00
Jonas Maebe
d89eedf38d * support varbyref and vararray (the latter if convertable to a single
element of its element type) in TBinaryObjectWriter.WriteVariant
    by letting variantmanager handle their conversion transparently

git-svn-id: trunk@13075 -
2009-05-02 08:28:42 +00:00
Jonas Maebe
8cae53bb18 * fixed errors with parsing negative, >$99 and invalid BCD numbers in
BCDToInt() (patch from Milla, mantis #13512)

git-svn-id: trunk@13052 -
2009-04-27 16:46:42 +00:00
Jonas Maebe
e8edc31a89 * don't insert thousandseparator if it is #0 (mantis #13552, patch by
Jesus Reyes)

git-svn-id: trunk@13028 -
2009-04-23 19:16:49 +00:00
Jonas Maebe
6a813b8e7b * fixed rounding error in DateTimeToUnix (mantis #12894 and #12936)
* fixed errors in Inc*() routines regarding skipping the black
    home in the data-time continuum around 0, and the same for the
    *Between() functions
  + tests, test...

git-svn-id: trunk@12958 -
2009-03-22 18:26:34 +00:00
Jonas Maebe
1c2d2ae481 * fixed SimpleRoundTo() function (mantis #10159)
git-svn-id: trunk@12957 -
2009-03-22 16:29:54 +00:00
Jonas Maebe
6f4637b32a * do not do anything when writing to a t(custom)memorystream if the current
position is negative (patch by Collin Western, mantis #13318)

git-svn-id: trunk@12955 -
2009-03-22 15:53:16 +00:00
joost
51b49d324e * Implemented function ExeSearch
git-svn-id: trunk@12947 -
2009-03-22 10:02:24 +00:00