You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(20) |
May
(48) |
Jun
(8) |
Jul
(23) |
Aug
(41) |
Sep
(42) |
Oct
(22) |
Nov
(17) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(43) |
Feb
(42) |
Mar
(17) |
Apr
(39) |
May
(16) |
Jun
(35) |
Jul
(37) |
Aug
(47) |
Sep
(49) |
Oct
(9) |
Nov
(52) |
Dec
(37) |
2008 |
Jan
(48) |
Feb
(21) |
Mar
(7) |
Apr
(2) |
May
(5) |
Jun
(17) |
Jul
(17) |
Aug
(40) |
Sep
(58) |
Oct
(38) |
Nov
(19) |
Dec
(32) |
2009 |
Jan
(67) |
Feb
(46) |
Mar
(54) |
Apr
(34) |
May
(37) |
Jun
(52) |
Jul
(67) |
Aug
(72) |
Sep
(48) |
Oct
(35) |
Nov
(27) |
Dec
(12) |
2010 |
Jan
(56) |
Feb
(46) |
Mar
(19) |
Apr
(14) |
May
(21) |
Jun
(3) |
Jul
(13) |
Aug
(48) |
Sep
(34) |
Oct
(51) |
Nov
(16) |
Dec
(32) |
2011 |
Jan
(36) |
Feb
(14) |
Mar
(12) |
Apr
(3) |
May
(5) |
Jun
(24) |
Jul
(15) |
Aug
(30) |
Sep
(21) |
Oct
(4) |
Nov
(25) |
Dec
(23) |
2012 |
Jan
(45) |
Feb
(42) |
Mar
(19) |
Apr
(14) |
May
(13) |
Jun
(7) |
Jul
(3) |
Aug
(46) |
Sep
(21) |
Oct
(10) |
Nov
(2) |
Dec
|
2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jfu...@us...> - 2010-08-19 20:08:05
|
Revision: 3317 http://jcl.svn.sourceforge.net/jcl/?rev=3317&view=rev Author: jfudickar Date: 2010-08-19 20:07:59 +0000 (Thu, 19 Aug 2010) Log Message: ----------- Switched to ANSI :-) Modified Paths: -------------- trunk/jcl/source/common/JclCompression.pas Modified: trunk/jcl/source/common/JclCompression.pas =================================================================== --- trunk/jcl/source/common/JclCompression.pas 2010-08-19 12:07:52 UTC (rev 3316) +++ trunk/jcl/source/common/JclCompression.pas 2010-08-19 20:07:59 UTC (rev 3317) @@ -1,4 +1,4 @@ -{**************************************************************************************************} +{**************************************************************************************************} { } { Project JEDI Code Library (JCL) } { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2010-08-19 12:08:00
|
Revision: 3316 http://jcl.svn.sourceforge.net/jcl/?rev=3316&view=rev Author: ahuser Date: 2010-08-19 12:07:52 +0000 (Thu, 19 Aug 2010) Log Message: ----------- Instead of switching the global DecimalSeparator JclRegistry now uses the TFormatSettings record. Modified Paths: -------------- trunk/jcl/source/windows/JclRegistry.pas Modified: trunk/jcl/source/windows/JclRegistry.pas =================================================================== --- trunk/jcl/source/windows/JclRegistry.pas 2010-08-16 08:48:20 UTC (rev 3315) +++ trunk/jcl/source/windows/JclRegistry.pas 2010-08-19 12:07:52 UTC (rev 3316) @@ -1092,23 +1092,21 @@ out RetValue: Single; RaiseException: Boolean): Boolean; var DataType, DataSize: DWORD; - OldSep: Char; + FS: TFormatSettings; begin RegGetDataType(RootKey, Key, Name, DataType); - OldSep := DecimalSeparator; if DataType in [REG_SZ, REG_EXPAND_SZ] then - try - DecimalSeparator := '.'; - if RaiseException then - begin - RetValue := StrToFloat(RegReadString(RootKey, Key, Name)); - Result := True; - end - else - Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue); - finally - DecimalSeparator := OldSep; + begin + FS.ThousandSeparator := ','; + FS.DecimalSeparator := '.'; + if RaiseException then + begin + RetValue := StrToFloat(RegReadString(RootKey, Key, Name), FS); + Result := True; end + else + Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue, FS); + end else Result := InternalGetData(RootKey, Key, Name, [REG_BINARY], SizeOf(RetValue), DataType, @RetValue, DataSize, RaiseException); @@ -1133,23 +1131,21 @@ out RetValue: Double; RaiseException: Boolean): Boolean; var DataType, DataSize: DWORD; - OldSep: Char; + FS: TFormatSettings; begin RegGetDataType(RootKey, Key, Name, DataType); - OldSep := DecimalSeparator; if DataType in [REG_SZ, REG_EXPAND_SZ] then - try - DecimalSeparator := '.'; - if RaiseException then - begin - RetValue := StrToFloat(RegReadString(RootKey, Key, Name)); - Result := True; - end - else - Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue); - finally - DecimalSeparator := OldSep; + begin + FS.ThousandSeparator := ','; + FS.DecimalSeparator := '.'; + if RaiseException then + begin + RetValue := StrToFloat(RegReadString(RootKey, Key, Name), FS); + Result := True; end + else + Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue, FS); + end else Result := InternalGetData(RootKey, Key, Name, [REG_BINARY], SizeOf(RetValue), DataType, @RetValue, DataSize, RaiseException); @@ -1174,23 +1170,21 @@ out RetValue: Extended; RaiseException: Boolean): Boolean; var DataType, DataSize: DWORD; - OldSep: Char; + FS: TFormatSettings; begin RegGetDataType(RootKey, Key, Name, DataType); - OldSep := DecimalSeparator; if DataType in [REG_SZ, REG_EXPAND_SZ] then - try - DecimalSeparator := '.'; - if RaiseException then - begin - RetValue := StrToFloat(RegReadString(RootKey, Key, Name)); - Result := True; - end - else - Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue); - finally - DecimalSeparator := OldSep; + begin + FS.ThousandSeparator := ','; + FS.DecimalSeparator := '.'; + if RaiseException then + begin + RetValue := StrToFloat(RegReadString(RootKey, Key, Name), FS); + Result := True; end + else + Result := TryStrToFloat(RegReadString(RootKey, Key, Name), RetValue, FS); + end else Result := InternalGetData(RootKey, Key, Name, [REG_BINARY], SizeOf(RetValue), DataType, @RetValue, DataSize, RaiseException); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ob...@us...> - 2010-08-16 08:48:27
|
Revision: 3315 http://jcl.svn.sourceforge.net/jcl/?rev=3315&view=rev Author: obones Date: 2010-08-16 08:48:20 +0000 (Mon, 16 Aug 2010) Log Message: ----------- RFC1952 specifies it should be ANSI Modified Paths: -------------- trunk/jcl/source/common/JclCompression.pas Modified: trunk/jcl/source/common/JclCompression.pas =================================================================== --- trunk/jcl/source/common/JclCompression.pas 2010-08-16 08:42:34 UTC (rev 3314) +++ trunk/jcl/source/common/JclCompression.pas 2010-08-16 08:48:20 UTC (rev 3315) @@ -1,4 +1,4 @@ -{**************************************************************************************************} +{**************************************************************************************************} { } { Project JEDI Code Library (JCL) } { } @@ -2719,7 +2719,7 @@ AHeader: TJclGZIPHeader; ExtraFieldLength, HeaderCRC16: Word; HeaderCRC: Cardinal; - TmpUTF8String: {$IFDEF UNICODE}UTF8String{$ELSE}AnsiString{$ENDIF UNICODE}; + TmpAnsiString: AnsiString; procedure StreamWriteBuffer(const Buffer; Count: Longint); begin @@ -2790,8 +2790,8 @@ if not CheckCString(OriginalFileName) then raise EJclCompressionError.CreateRes(@RsCompressionGZIPBadString); - TmpUTF8String := UTF8Encode(OriginalFileName); - StreamWriteBuffer(TmpUTF8String[1], Length(TmpUTF8String) + 1); + TmpAnsiString := AnsiString(OriginalFileName); + StreamWriteBuffer(TmpAnsiString[1], Length(TmpAnsiString) + 1); end; if (gfComment in Flags) and (Comment <> '') then @@ -2799,8 +2799,8 @@ if not CheckCString(Comment) then raise EJclCompressionError.CreateRes(@RsCompressionGZIPBadString); - TmpUTF8String := UTF8Encode(Comment); - StreamWriteBuffer(TmpUTF8String[1], Length(TmpUTF8String) + 1); + TmpAnsiString := AnsiString(Comment); + StreamWriteBuffer(TmpAnsiString[1], Length(TmpAnsiString) + 1); end; if (gfHeaderCRC16 in Flags) then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ob...@us...> - 2010-08-16 08:42:41
|
Revision: 3314 http://jcl.svn.sourceforge.net/jcl/?rev=3314&view=rev Author: obones Date: 2010-08-16 08:42:34 +0000 (Mon, 16 Aug 2010) Log Message: ----------- Original file name and comment are to be stored in UTF-8 for the GZip file to be valid Modified Paths: -------------- trunk/jcl/source/common/JclCompression.pas Modified: trunk/jcl/source/common/JclCompression.pas =================================================================== --- trunk/jcl/source/common/JclCompression.pas 2010-08-13 10:17:39 UTC (rev 3313) +++ trunk/jcl/source/common/JclCompression.pas 2010-08-16 08:42:34 UTC (rev 3314) @@ -2719,6 +2719,7 @@ AHeader: TJclGZIPHeader; ExtraFieldLength, HeaderCRC16: Word; HeaderCRC: Cardinal; + TmpUTF8String: {$IFDEF UNICODE}UTF8String{$ELSE}AnsiString{$ENDIF UNICODE}; procedure StreamWriteBuffer(const Buffer; Count: Longint); begin @@ -2788,14 +2789,18 @@ begin if not CheckCString(OriginalFileName) then raise EJclCompressionError.CreateRes(@RsCompressionGZIPBadString); - StreamWriteBuffer(OriginalFileName[1], Length(OriginalFileName) + 1); + + TmpUTF8String := UTF8Encode(OriginalFileName); + StreamWriteBuffer(TmpUTF8String[1], Length(TmpUTF8String) + 1); end; if (gfComment in Flags) and (Comment <> '') then begin if not CheckCString(Comment) then raise EJclCompressionError.CreateRes(@RsCompressionGZIPBadString); - StreamWriteBuffer(Comment[1], Length(Comment) + 1); + + TmpUTF8String := UTF8Encode(Comment); + StreamWriteBuffer(TmpUTF8String[1], Length(TmpUTF8String) + 1); end; if (gfHeaderCRC16 in Flags) then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-13 10:17:45
|
Revision: 3313 http://jcl.svn.sourceforge.net/jcl/?rev=3313&view=rev Author: outchy Date: 2010-08-13 10:17:39 +0000 (Fri, 13 Aug 2010) Log Message: ----------- Branch for JCL 2.2. Added Paths: ----------- branches/JCL_2.2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 15:22:45
|
Revision: 3312 http://jcl.svn.sourceforge.net/jcl/?rev=3312&view=rev Author: outchy Date: 2010-08-12 15:22:36 +0000 (Thu, 12 Aug 2010) Log Message: ----------- useless old DOM project file. Removed Paths: ------------- trunk/help/JCL.dfg Deleted: trunk/help/JCL.dfg =================================================================== --- trunk/help/JCL.dfg 2010-08-12 15:19:56 UTC (rev 3311) +++ trunk/help/JCL.dfg 2010-08-12 15:22:36 UTC (rev 3312) @@ -1,13221 +0,0 @@ -; This is a Doc-O-Matic version 3.10 project file. -; This file is maintained by Doc-O-Matic, do not edit manually. - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Basic] -AddLastDelim=0 -ChapterDelim=. -Compress=1 -FirstPageNumber=0 -FooterString1= -FooterString2= -FooterString3=%P% -FooterString4= -FooterString5= -FooterString6= -FooterStringColumnCount=3 -FooterStringRowCount=2 -FooterStringVisible=1 -HeaderString1=%CL1%%.CL2% %TL2% -HeaderString2=%T% -HeaderString3=%TL3% -HeaderString4= -HeaderString5= -HeaderString6= -HeaderStringColumnCount=3 -HeaderStringRowCount=2 -HeaderStringVisible=1 -ImagesDPI=144 -ImagesInterpolate=0 -ImagesTransparent=0 -Links_FormatString=' (%G% see page %P%)' -Links_NoSameTitleText=1 -Links_SuppressLinksFormatInCode=1 -List_Bullets_Symbol=1 -MaxContentLevel=7 -OutputFile= -OverviewColumns=2 -ShowOptions=251 -TitlePage_GraphicFileName= -TitlePage_UseGraphic=0 -TitlePage_UseText=1 -TopicTitle_FormatString=%G%%C% %T% %F% - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Common Layout Options] -DisplayTopicLinks=1 -TopicLinkListSeparator=' | ' -TopicLinkListSeparatorSection=', ' - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements] -Count=136 -DefaultCharset=0 -ElementID_0=-508 -ElementID_1=-507 -ElementID_10=-487 -ElementID_100=-106 -ElementID_101=-105 -ElementID_102=-104 -ElementID_103=-103 -ElementID_104=-102 -ElementID_105=-101 -ElementID_106=-93 -ElementID_107=-92 -ElementID_108=-91 -ElementID_109=-90 -ElementID_11=-486 -ElementID_110=-85 -ElementID_111=-84 -ElementID_112=-83 -ElementID_113=-75 -ElementID_114=-74 -ElementID_115=-73 -ElementID_116=-72 -ElementID_117=-71 -ElementID_118=-70 -ElementID_119=-69 -ElementID_12=-485 -ElementID_120=-67 -ElementID_121=-66 -ElementID_122=-58 -ElementID_123=-57 -ElementID_124=-55 -ElementID_125=-54 -ElementID_126=-44 -ElementID_127=-35 -ElementID_128=-34 -ElementID_129=-33 -ElementID_13=-484 -ElementID_130=-20 -ElementID_131=-19 -ElementID_132=-18 -ElementID_133=-17 -ElementID_134=-12 -ElementID_135=-7 -ElementID_14=-483 -ElementID_15=-482 -ElementID_16=-481 -ElementID_17=-480 -ElementID_18=-468 -ElementID_19=-467 -ElementID_2=-506 -ElementID_20=-466 -ElementID_21=-465 -ElementID_22=-464 -ElementID_23=-463 -ElementID_24=-462 -ElementID_25=-461 -ElementID_26=-460 -ElementID_27=-448 -ElementID_28=-447 -ElementID_29=-446 -ElementID_3=-505 -ElementID_30=-445 -ElementID_31=-444 -ElementID_32=-443 -ElementID_33=-442 -ElementID_34=-441 -ElementID_35=-440 -ElementID_36=-428 -ElementID_37=-427 -ElementID_38=-426 -ElementID_39=-425 -ElementID_4=-504 -ElementID_40=-424 -ElementID_41=-423 -ElementID_42=-422 -ElementID_43=-421 -ElementID_44=-420 -ElementID_45=-408 -ElementID_46=-407 -ElementID_47=-406 -ElementID_48=-405 -ElementID_49=-404 -ElementID_5=-503 -ElementID_50=-403 -ElementID_51=-402 -ElementID_52=-401 -ElementID_53=-400 -ElementID_54=-263 -ElementID_55=-262 -ElementID_56=-261 -ElementID_57=-260 -ElementID_58=-259 -ElementID_59=-258 -ElementID_6=-502 -ElementID_60=-257 -ElementID_61=-254 -ElementID_62=-253 -ElementID_63=-190 -ElementID_64=-185 -ElementID_65=-184 -ElementID_66=-183 -ElementID_67=-182 -ElementID_68=-181 -ElementID_69=-170 -ElementID_7=-501 -ElementID_70=-152 -ElementID_71=-151 -ElementID_72=-150 -ElementID_73=-149 -ElementID_74=-148 -ElementID_75=-147 -ElementID_76=-146 -ElementID_77=-145 -ElementID_78=-144 -ElementID_79=-143 -ElementID_8=-500 -ElementID_80=-142 -ElementID_81=-141 -ElementID_82=-132 -ElementID_83=-131 -ElementID_84=-130 -ElementID_85=-129 -ElementID_86=-128 -ElementID_87=-127 -ElementID_88=-126 -ElementID_89=-125 -ElementID_9=-488 -ElementID_90=-124 -ElementID_91=-123 -ElementID_92=-122 -ElementID_93=-121 -ElementID_94=-112 -ElementID_95=-111 -ElementID_96=-110 -ElementID_97=-109 -ElementID_98=-108 -ElementID_99=-107 -StandardFixedPitchFontname=Courier New -StandardVariablePitchFontname=Arial - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-101] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=1000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=16 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-101\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-102] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=2000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-102\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-103] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=3000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-103\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-104] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=4000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-104\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-105] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=5000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-105\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-106] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=6000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-106\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-107] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=7000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-107\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-108] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=8000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-108\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-109] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=9000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-109\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-110] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=10000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-110\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-111] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=11000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-111\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-112] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=12000 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-112\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-12] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1.20000004768372 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-12\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-121] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=2 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=26 -StrikeOut=0 -Underline=0 -VSpaceAfter=1000 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-121\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-122] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=22 -StrikeOut=0 -Underline=0 -VSpaceAfter=600 -VSpaceBefore=1000 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-122\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=9868950 -Top_Offset=850 -Top_Visible=1 -Top_Width=70 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-123] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=18 -StrikeOut=0 -Underline=0 -VSpaceAfter=600 -VSpaceBefore=800 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-123\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=9868950 -Top_Offset=650 -Top_Visible=1 -Top_Width=70 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-124] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=16 -StrikeOut=0 -Underline=0 -VSpaceAfter=400 -VSpaceBefore=500 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-124\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-125] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=14 -StrikeOut=0 -Underline=0 -VSpaceAfter=300 -VSpaceBefore=400 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-125\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-126] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=12 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-126\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-127] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-127\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-128] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-128\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-129] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-129\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-130] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-130\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-131] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-131\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-132] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-132\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-141] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=2 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=26 -StrikeOut=0 -Underline=0 -VSpaceAfter=1000 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-141\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-142] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=22 -StrikeOut=0 -Underline=0 -VSpaceAfter=600 -VSpaceBefore=1000 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-142\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=9868950 -Top_Offset=850 -Top_Visible=1 -Top_Width=70 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-143] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=18 -StrikeOut=0 -Underline=0 -VSpaceAfter=600 -VSpaceBefore=800 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-143\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=9868950 -Top_Offset=650 -Top_Visible=1 -Top_Width=70 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-144] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=16 -StrikeOut=0 -Underline=0 -VSpaceAfter=400 -VSpaceBefore=500 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-144\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-145] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=14 -StrikeOut=0 -Underline=0 -VSpaceAfter=300 -VSpaceBefore=400 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-145\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-146] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=12 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-146\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-147] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-147\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-148] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-148\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-149] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-149\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-150] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-150\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-151] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-151\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-152] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -BreakInfo=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -NumberingEnabled=1 -ParaAttributeOnly=0 -RightIndent=0 -Size=10 -StrikeOut=0 -Underline=0 -VSpaceAfter=250 -VSpaceBefore=300 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-152\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-17] -Alignment=1 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=400 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-17\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=60 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-170] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-170\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-18] -Alignment=1 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=0 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-18\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-181] -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=0 -Color=0 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-182] -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=0 -Color=16711680 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-183] -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=0 -Color=0 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=1 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-184] -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=0 -Color=0 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-185] -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=0 -Color=32768 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-19] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1.20000004768372 -None=0 -ParaAttributeOnly=0 -RightIndent=200 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-19\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-190] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=200 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=200 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-190\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-20] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1.20000004768372 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-20\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-253] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=32 -StrikeOut=0 -Underline=0 -VSpaceAfter=1000 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-253\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-254] -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FontCharset=0 -Fontname= -Italic=0 -None=0 -ParaAttributeOnly=0 -Size=9 -StrikeOut=0 -Underline=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-257] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-257\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-258] -Alignment=1 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-258\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-259] -Alignment=2 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-259\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-260] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-260\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-261] -Alignment=1 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-261\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-262] -Alignment=2 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=100 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=100 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-262\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=20 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=20 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=20 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=20 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-263] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=400 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-263\Borders] -Bottom_Colour=0 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=60 -Left_Colour=0 -Left_Offset=0 -Left_Visible=1 -Left_Width=60 -Right_Colour=0 -Right_Offset=0 -Right_Visible=1 -Right_Width=60 -Top_Colour=0 -Top_Offset=0 -Top_Visible=1 -Top_Width=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-33] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-33\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-34] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=400 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-34\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-35] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=0 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-35\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-400] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-400\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-401] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-401\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-402] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-402\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-403] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-403\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-404] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-404\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-405] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=600 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-405\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-406] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-406\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=25 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=25 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=25 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=25 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-407] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-407\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-408] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-408\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-420] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-420\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-421] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-421\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-422] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-422\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-423] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-423\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-424] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-424\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-425] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=600 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-425\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-426] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=1 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=100 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-426\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=25 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=25 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=25 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=25 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-427] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-427\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-428] -Alignment=0 -BackgroundColor=536870911 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=0 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=9 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-428\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-44] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=200 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-44\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-440] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-440\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-441] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-441\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-442] -Alignment=0 -BackgroundColor=15132390 -Bold=1 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-442\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-443] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=66 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=66 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=60 -VSpaceBefore=60 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-443\Borders] -Bottom_Colour=11974326 -Bottom_Offset=0 -Bottom_Visible=1 -Bottom_Width=10 -Left_Colour=11974326 -Left_Offset=0 -Left_Visible=1 -Left_Width=10 -Right_Colour=11974326 -Right_Offset=0 -Right_Visible=1 -Right_Width=10 -Top_Colour=11974326 -Top_Offset=0 -Top_Visible=1 -Top_Width=10 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-444] -Alignment=0 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=400 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=100 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-444\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-445] -Alignment=3 -BackgroundColor=536870911 -Bold=0 -ClearPreviousStyle=1 -Color=0 -FirstIndent=0 -FontCharset=0 -Fontname= -Italic=0 -LeftIndent=600 -LineSpacing=1 -None=0 -ParaAttributeOnly=0 -RightIndent=0 -Size=7 -StrikeOut=0 -Underline=0 -VSpaceAfter=200 -VSpaceBefore=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}\Elements\-445\Borders] -Bottom_Colour=-2147483640 -Bottom_Offset=0 -Bottom_Visible=0 -Bottom_Width=0 -Left_Colour=-2147483640 -Left_Offset=0 -Left_Visible=0 -Left_Width=0 -Right_Colour=-2147483640 -Right_Offset=0 -Right_Visible=0 -Right_Width=0 -Top_Colour=-2147483640 -Top_Offset=0 -Top_Visible=0 -Top_Width=0 - -[{51AFC76F-1628-478C-88DB-FA76DB55F3BE}... [truncated message content] |
From: <ou...@us...> - 2010-08-12 15:20:03
|
Revision: 3311 http://jcl.svn.sourceforge.net/jcl/?rev=3311&view=rev Author: outchy Date: 2010-08-12 15:19:56 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Minor help update. Modified Paths: -------------- trunk/help/Graphics.dtx trunk/help/JCLHelp.dox Modified: trunk/help/Graphics.dtx =================================================================== --- trunk/help/Graphics.dtx 2010-08-12 13:39:48 UTC (rev 3310) +++ trunk/help/Graphics.dtx 2010-08-12 15:19:56 UTC (rev 3311) @@ -1326,5 +1326,3 @@ <GROUP Graphics.Bitmaps> <COMBINE ScreenShot@TBitmap@Integer@Integer@Integer@Integer@HWND> -------------------------------------------------------------------------------- -@@JclQGraphics.pas -<ALIASOF JclGraphics.pas> Modified: trunk/help/JCLHelp.dox =================================================================== --- trunk/help/JCLHelp.dox 2010-08-12 13:39:48 UTC (rev 3310) +++ trunk/help/JCLHelp.dox 2010-08-12 15:19:56 UTC (rev 3311) @@ -137312,53 +137312,70 @@ SavedValues=1 [Source Files] -Count=138 +Count=155 File0=8087.dtx File1=AppInst.dtx File10=ExprEval.dtx -File100=..\jcl\source\common\JclVectors.pas -File101=..\jcl\source\common\JclWideStrings.pas -File102=..\jcl\source\common\pcre.pas -File103=..\jcl\source\vcl\JclFont.pas -File104=..\jcl\source\vcl\JclGraphics.pas -File105=..\jcl\source\vcl\JclGraphUtils.pas -File106=..\jcl\source\vcl\JclPrint.pas -File107=..\jcl\source\visclx\JclQGraphics.pas -File108=..\jcl\source\visclx\JclQGraphUtils.pas -File109=..\jcl\source\windows\Hardlinks.pas +File100=..\jcl\source\common\JclUsesUtils.pas +File101=..\jcl\source\common\JclValidation.pas +File102=..\jcl\source\common\JclVectors.pas +File103=..\jcl\source\common\JclWideStrings.pas +File104=..\jcl\source\common\pcre.pas +File105=..\jcl\source\common\zlibh.pas +File106=..\jcl\source\vcl\JclFont.pas +File107=..\jcl\source\vcl\JclGraphics.pas +File108=..\jcl\source\vcl\JclGraphUtils.pas +File109=..\jcl\source\vcl\JclOpenDialogFavorites.pas File11=FileUtils.dtx -File110=..\jcl\source\windows\JclAppInst.pas -File111=..\jcl\source\windows\JclCIL.pas -File112=..\jcl\source\windows\JclCLR.pas -File113=..\jcl\source\windows\JclCOM.pas -File114=..\jcl\source\windows\JclConsole.pas -File115=..\jcl\source\windows\JclDebug.pas -File116=..\jcl\source\windows\JclDotNet.pas -File117=..\jcl\source\windows\JclHookExcept.pas -File118=..\jcl\source\windows\JclLANMan.pas -File119=..\jcl\source\windows\JclLocales.pas +File110=..\jcl\source\vcl\JclOpenDialogHooks.pas +File111=..\jcl\source\vcl\JclPrint.pas +File112=..\jcl\source\vcl\JclVclResources.pas +File113=..\jcl\source\vcl\JclVersionControl.pas +File114=..\jcl\source\vcl\JclVersionCtrlCVSImpl.pas +File115=..\jcl\source\vcl\JclVersionCtrlSVNImpl.pas +File116=..\jcl\source\windows\Hardlinks.pas +File117=..\jcl\source\windows\JclAppInst.pas +File118=..\jcl\source\windows\JclCIL.pas +File119=..\jcl\source\windows\JclCLR.pas File12=Font.dtx -File120=..\jcl\source\windows\JclMapi.pas -File121=..\jcl\source\windows\JclMetadata.pas -File122=..\jcl\source\windows\JclMiscel.pas -File123=..\jcl\source\windows\JclMsdosSys.pas -File124=..\jcl\source\windows\JclMultimedia.pas -File125=..\jcl\source\windows\JclNTFS.pas -File126=..\jcl\source\windows\JclPeImage.pas -File127=..\jcl\source\windows\JclRegistry.pas -File128=..\jcl\source\windows\JclSecurity.pas -File129=..\jcl\source\windows\JclShell.pas +File120=..\jcl\source\windows\JclCOM.pas +File121=..\jcl\source\windows\JclConsole.pas +File122=..\jcl\source\windows\JclDebug.pas +File123=..\jcl\source\windows\JclDebugSerialization.pas +File124=..\jcl\source\windows\JclDebugXMLDeserializer.pas +File125=..\jcl\source\windows\JclDebugXMLSerializer.pas +File126=..\jcl\source\windows\JclDotNet.pas +File127=..\jcl\source\windows\JclHelpUtils.pas +File128=..\jcl\source\windows\JclHookExcept.pas +File129=..\jcl\source\windows\JclLANMan.pas File13=Graphics.dtx -File130=..\jcl\source\windows\JclStructStorage.pas -File131=..\jcl\source\windows\JclSvcCtrl.pas -File132=..\jcl\source\windows\JclTask.pas -File133=..\jcl\source\windows\JclTD32.pas -File134=..\jcl\source\windows\JclWideFormat.pas -File135=..\jcl\source\windows\JclWin32.pas -File136=..\jcl\source\windows\JclWin32Ex.pas -File137=..\jcl\source\windows\JclWinMIDI.pas +File130=..\jcl\source\windows\JclLocales.pas +File131=..\jcl\source\windows\JclMapi.pas +File132=..\jcl\source\windows\JclMetadata.pas +File133=..\jcl\source\windows\JclMiscel.pas +File134=..\jcl\source\windows\JclMsdosSys.pas +File135=..\jcl\source\windows\JclMultimedia.pas +File136=..\jcl\source\windows\JclNTFS.pas +File137=..\jcl\source\windows\JclPeImage.pas +File138=..\jcl\source\windows\JclRegistry.pas +File139=..\jcl\source\windows\JclSecurity.pas File14=Hardlinks.dtx +File140=..\jcl\source\windows\JclShell.pas +File141=..\jcl\source\windows\JclStructStorage.pas +File142=..\jcl\source\windows\JclSvcCtrl.pas +File143=..\jcl\source\windows\JclTask.pas +File144=..\jcl\source\windows\JclTD32.pas +File145=..\jcl\source\windows\JclTimeZones.pas +File146=..\jcl\source\windows\JclWin32.pas +File147=..\jcl\source\windows\JclWin32Ex.pas +File148=..\jcl\source\windows\JclWinMIDI.pas +File149=..\jcl\source\windows\mscoree_TLB.pas File15=hlpgrps.dtx +File150=..\jcl\source\windows\mscorlib_TLB.pas +File151=..\jcl\source\windows\MSHelpServices_TLB.pas +File152=..\jcl\source\windows\MSTask.pas +File153=..\jcl\source\windows\sevenzip.pas +File154=..\jcl\source\windows\Snmp.pas File16=IncludedFiles.dtx File17=IniFiles.dtx File18=LANMan.dtx @@ -137395,62 +137412,62 @@ File46=UnitConv.dtx File47=WideStrings.dtx File48=Win32.dtx -File49=..\jcl\source\common\Jcl8087.pas +File49=..\jcl\source\common\bzip2.pas File5=Complex.dtx -File50=..\jcl\source\common\JclAbstractContainers.pas -File51=..\jcl\source\common\JclAlgorithms.pas -File52=..\jcl\source\common\JclAnsiStrings.pas -File53=..\jcl\source\common\JclArrayLists.pas -File54=..\jcl\source\common\JclArraySets.pas -File55=..\jcl\source\common\JclBase.pas -File56=..\jcl\source\common\JclBinaryTrees.pas -File57=..\jcl\source\common\JclBorlandTools.pas -File58=..\jcl\source\common\JclComplex.pas -File59=..\jcl\source\common\JclCompression.pas +File50=..\jcl\source\common\Jcl8087.pas +File51=..\jcl\source\common\JclAbstractContainers.pas +File52=..\jcl\source\common\JclAlgorithms.pas +File53=..\jcl\source\common\JclAnsiStrings.pas +File54=..\jcl\source\common\JclArrayLists.pas +File55=..\jcl\source\common\JclArraySets.pas +File56=..\jcl\source\common\JclBase.pas +File57=..\jcl\source\common\JclBinaryTrees.pas +File58=..\jcl\source\common\JclCharsets.pas +File59=..\jcl\source\common\JclCompilerUtils.pas File6=Containers.dtx -File60=..\jcl\source\common\JclContainerIntf.pas -File61=..\jcl\source\common\JclCounter.pas -File62=..\jcl\source\common\JclDateTime.pas -File63=..\jcl\source\common\JclEDI.pas -File64=..\jcl\source\common\JclEDI_ANSIX12.pas -File65=..\jcl\source\common\JclEDI_ANSIX12_Ext.pas -File66=..\jcl\source\common\JclEDI_UNEDIFACT.pas -File67=..\jcl\source\common\JclEDI_UNEDIFACT_Ext.pas -File68=..\jcl\source\common\JclEDISEF.pas -File69=..\jcl\source\common\JclEDITranslators.pas +File60=..\jcl\source\common\JclComplex.pas +File61=..\jcl\source\common\JclCompression.pas +File62=..\jcl\source\common\JclContainerIntf.pas +File63=..\jcl\source\common\JclCounter.pas +File64=..\jcl\source\common\JclDateTime.pas +File65=..\jcl\source\common\JclDevToolsResources.pas +File66=..\jcl\source\common\JclExprEval.pas +File67=..\jcl\source\common\JclFileUtils.pas +File68=..\jcl\source\common\JclHashMaps.pas +File69=..\jcl\source\common\JclHashSets.pas File7=Counter.dtx -File70=..\jcl\source\common\JclEDIXML.pas -File71=..\jcl\source\common\JclExprEval.pas -File72=..\jcl\source\common\JclFileUtils.pas -File73=..\jcl\source\common\JclHashMaps.pas -File74=..\jcl\source\common\JclHashSets.pas -File75=..\jcl\source\common\JclIniFiles.pas -File76=..\jcl\source\common\JclLinkedLists.pas -File77=..\jcl\source\common\JclLogic.pas -File78=..\jcl\source\common\JclMath.pas -File79=..\jcl\source\common\JclMIDI.pas +File70=..\jcl\source\common\JclIDEUtils.pas +File71=..\jcl\source\common\JclIniFiles.pas +File72=..\jcl\source\common\JclLinkedLists.pas +File73=..\jcl\source\common\JclLogic.pas +File74=..\jcl\source\common\JclMath.pas +File75=..\jcl\source\common\JclMIDI.pas +File76=..\jcl\source\common\JclMime.pas +File77=..\jcl\source\common\JclNotify.pas +File78=..\jcl\source\common\JclPCRE.pas +File79=..\jcl\source\common\JclQueues.pas File8=DateTime.dtx -File80=..\jcl\source\common\JclMime.pas -File81=..\jcl\source\common\JclNotify.pas -File82=..\jcl\source\common\JclPCRE.pas -File83=..\jcl\source\common\JclQueues.pas -File84=..\jcl\source\common\JclResources.pas -File85=..\jcl\source\common\JclRTTI.pas -File86=..\jcl\source\common\JclSchedule.pas -File87=..\jcl\source\common\JclStacks.pas -File88=..\jcl\source\common\JclStatistics.pas -File89=..\jcl\source\common\JclStreams.pas +File80=..\jcl\source\common\JclResources.pas +File81=..\jcl\source\common\JclRTTI.pas +File82=..\jcl\source\common\JclSchedule.pas +File83=..\jcl\source\common\JclSimpleXml.pas +File84=..\jcl\source\common\JclSortedMaps.pas +File85=..\jcl\source\common\JclStacks.pas +File86=..\jcl\source\common\JclStatistics.pas +File87=..\jcl\source\common\JclStreams.pas +File88=..\jcl\source\common\JclStrHashMap.pas +File89=..\jcl\source\common\JclStringConversions.pas File9=Debug.dtx -File90=..\jcl\source\common\JclStrHashMap.pas +File90=..\jcl\source\common\JclStringLists.pas File91=..\jcl\source\common\JclStrings.pas File92=..\jcl\source\common\JclSynch.pas File93=..\jcl\source\common\JclSysInfo.pas File94=..\jcl\source\common\JclSysUtils.pas -File95=..\jcl\source\common\JclUnicode.pas -File96=..\jcl\source\common\JclUnitConv.pas -File97=..\jcl\source\common\JclUnitVersioning.pas -File98=..\jcl\source\common\JclUnitVersioningProviders.pas -File99=..\jcl\source\common\JclValidation.pas +File95=..\jcl\source\common\JclTrees.pas +File96=..\jcl\source\common\JclUnicode.pas +File97=..\jcl\source\common\JclUnitConv.pas +File98=..\jcl\source\common\JclUnitVersioning.pas +File99=..\jcl\source\common\JclUnitVersioningProviders.pas [Source Include Directories] Count=1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 13:39:55
|
Revision: 3310 http://jcl.svn.sourceforge.net/jcl/?rev=3310&view=rev Author: outchy Date: 2010-08-12 13:39:48 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Compatibility with C++Builder: properties with implicit index are not correctly emitted, the index is wrongly converted to an integer. Modified Paths: -------------- trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas Modified: trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-12 13:04:12 UTC (rev 3309) +++ trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-12 13:39:48 UTC (rev 3310) @@ -159,6 +159,8 @@ TAllTypeAttributeIDs = set of TAllTypeAttributeID; TTypeAttributeID = taTypeName..taStackClassName; + {$EXTERNALSYM TTypeAttributeID} + {$HPPEMIT '#define TTypeAttributeID int'} TTypeAttributes = array [TTypeAttributeID] of string; @@ -166,10 +168,16 @@ PKnownTypeAttributes = ^TKnownTypeAttributes; TKeyAttributeID = kaKeyTypeName..kaKeyArraySetClassName; + {$EXTERNALSYM TKeyAttributeID} + {$HPPEMIT '#define TKeyAttributeID int'} TValueAttributeID = vaValueTypeName..vaValueArrayListClassName; + {$EXTERNALSYM TValueAttributeID} + {$HPPEMIT '#define TValueAttributeID int'} TMapAttributeID = maMapInterfaceName..maSortedMapClassName; + {$EXTERNALSYM TMapAttributeID} + {$HPPEMIT '#define TMapAttributeID int'} TMapAttributes = array [TMapAttributeID] of string; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 13:04:18
|
Revision: 3309 http://jcl.svn.sourceforge.net/jcl/?rev=3309&view=rev Author: outchy Date: 2010-08-12 13:04:12 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Compatibility with D6. Modified Paths: -------------- trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr Modified: trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr =================================================================== --- trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr 2010-08-12 12:32:25 UTC (rev 3308) +++ trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr 2010-08-12 13:04:12 UTC (rev 3309) @@ -16,7 +16,7 @@ end; TRefCountObject = class(TInterfacedObject, IInterface, IRefCountInterface) - var + private FChar: Char; public function GetRefCount: Integer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 12:32:31
|
Revision: 3308 http://jcl.svn.sourceforge.net/jcl/?rev=3308&view=rev Author: outchy Date: 2010-08-12 12:32:25 +0000 (Thu, 12 Aug 2010) Log Message: ----------- fix compiler warnings introduced in rev 3307. Revision Links: -------------- http://jcl.svn.sourceforge.net/jcl/?rev=3307&view=rev Modified Paths: -------------- trunk/jcl/source/windows/JclDebug.pas Modified: trunk/jcl/source/windows/JclDebug.pas =================================================================== --- trunk/jcl/source/windows/JclDebug.pas 2010-08-12 12:13:20 UTC (rev 3307) +++ trunk/jcl/source/windows/JclDebug.pas 2010-08-12 12:32:25 UTC (rev 3308) @@ -1416,11 +1416,11 @@ C := Char(CurrPos^); case C of '0'..'9': - Result := (Result shl 4) or (Ord(C) - Ord('0')); + Result := (Result shl 4) or DWORD(Ord(C) - Ord('0')); 'A'..'F': - Result := (Result shl 4) or (Ord(C) - Ord('A') + 10); + Result := (Result shl 4) or DWORD(Ord(C) - Ord('A') + 10); 'a'..'f': - Result := (Result shl 4) or (Ord(C) - Ord('a') + 10); + Result := (Result shl 4) or DWORD(Ord(C) - Ord('a') + 10); 'H', 'h': begin Inc(CurrPos); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 12:13:26
|
Revision: 3307 http://jcl.svn.sourceforge.net/jcl/?rev=3307&view=rev Author: outchy Date: 2010-08-12 12:13:20 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Mantis 5282: ExceptDlg does not work if app is compiled with package vcl and bounds-checking on (with solution). Disable some numerical checks in ReadHexValue. Modified Paths: -------------- trunk/jcl/source/windows/JclDebug.pas Modified: trunk/jcl/source/windows/JclDebug.pas =================================================================== --- trunk/jcl/source/windows/JclDebug.pas 2010-08-12 11:53:27 UTC (rev 3306) +++ trunk/jcl/source/windows/JclDebug.pas 2010-08-12 12:13:20 UTC (rev 3307) @@ -1416,20 +1416,11 @@ C := Char(CurrPos^); case C of '0'..'9': - begin - Result := Result * 16; - Inc(Result, Ord(C) - Ord('0')); - end; + Result := (Result shl 4) or (Ord(C) - Ord('0')); 'A'..'F': - begin - Result := Result * 16; - Inc(Result, Ord(C) - Ord('A') + 10); - end; + Result := (Result shl 4) or (Ord(C) - Ord('A') + 10); 'a'..'f': - begin - Result := Result * 16; - Inc(Result, Ord(C) - Ord('a') + 10); - end; + Result := (Result shl 4) or (Ord(C) - Ord('a') + 10); 'H', 'h': begin Inc(CurrPos); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 11:53:33
|
Revision: 3306 http://jcl.svn.sourceforge.net/jcl/?rev=3306&view=rev Author: outchy Date: 2010-08-12 11:53:27 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Mantis 5293: CDATA ending by "]]]>" are incorrectly parsed. Modified Paths: -------------- trunk/jcl/source/common/JclSimpleXml.pas Modified: trunk/jcl/source/common/JclSimpleXml.pas =================================================================== --- trunk/jcl/source/common/JclSimpleXml.pas 2010-08-12 11:21:58 UTC (rev 3305) +++ trunk/jcl/source/common/JclSimpleXml.pas 2010-08-12 11:53:27 UTC (rev 3306) @@ -3006,12 +3006,12 @@ else if not CharIsWhiteSpace(Ch) then FmtError(LoadResString(@RsEInvalidCDATAExpectedsButFounds), [CS_START_CDATA[lPos], Ch, StringStream.PeekPosition]); - 10: + 10: // ] if Ch = CS_STOP_CDATA[lPos] then Inc(lPos) else St := St + Ch; - 11: //- + 11: // ] if Ch = CS_STOP_CDATA[lPos] then Inc(lPos) else @@ -3026,6 +3026,10 @@ Break; //End if end else + // ]]] + if Ch = CS_STOP_CDATA[lPos-1] then + St := St + ']' + else begin St := St + ']]' + Ch; Dec(lPos, 2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 11:22:05
|
Revision: 3305 http://jcl.svn.sourceforge.net/jcl/?rev=3305&view=rev Author: outchy Date: 2010-08-12 11:21:58 +0000 (Thu, 12 Aug 2010) Log Message: ----------- The TLS segment always starts at Offset = 0, the code shall not translate its entities. Modified Paths: -------------- trunk/jcl/source/windows/JclDebug.pas Modified: trunk/jcl/source/windows/JclDebug.pas =================================================================== --- trunk/jcl/source/windows/JclDebug.pas 2010-08-12 10:52:33 UTC (rev 3304) +++ trunk/jcl/source/windows/JclDebug.pas 2010-08-12 11:21:58 UTC (rev 3305) @@ -1684,7 +1684,11 @@ FSegmentClasses[C].Segment := Address.Segment; FSegmentClasses[C].Start := Address.Offset; FSegmentClasses[C].Addr := Address.Offset; // will be fixed below while considering module mapped address - FSegmentClasses[C].VA := MAPAddrToVA(FSegmentClasses[C].Start); + // test GroupName because SectionName = '.tls' in Delphi and '_tls' in BCB + if StrLIComp(GroupName, 'TLS', 3) = 0 then + FSegmentClasses[C].VA := FSegmentClasses[C].Start + else + FSegmentClasses[C].VA := MAPAddrToVA(FSegmentClasses[C].Start); FSegmentClasses[C].Len := Len; FSegmentClasses[C].SectionName := SectionName; FSegmentClasses[C].GroupName := GroupName; @@ -1744,7 +1748,10 @@ if (FSegmentClasses[SegIndex].Segment = Address.Segment) and (DWORD(Address.Offset) < FSegmentClasses[SegIndex].Len) then begin - VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); + if StrLIComp(FSegmentClasses[SegIndex].GroupName, 'TLS', 3) = 0 then + Va := Address.Offset + else + VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); { Starting with Delphi 2005, "empty" units are listes with the last line and the VA 0001:00000000. When we would accept 0 VAs here, System.pas functions could be mapped to other units and line numbers. Discaring such items should @@ -1849,7 +1856,10 @@ if FProcNamesCnt mod 256 = 0 then SetLength(FProcNames, FProcNamesCnt + 256); FProcNames[FProcNamesCnt].Segment := FSegmentClasses[SegIndex].Segment; - FProcNames[FProcNamesCnt].VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); + if StrLIComp(FSegmentClasses[SegIndex].GroupName, 'TLS', 3) = 0 then + FProcNames[FProcNamesCnt].VA := Address.Offset + else + FProcNames[FProcNamesCnt].VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); FProcNames[FProcNamesCnt].ProcName := Name; Inc(FProcNamesCnt); Break; @@ -1896,7 +1906,10 @@ if (FSegmentClasses[SegIndex].Segment = Address.Segment) and (DWORD(Address.Offset) < FSegmentClasses[SegIndex].Len) then begin - VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); + if StrLIComp(FSegmentClasses[SegIndex].GroupName, 'TLS', 3) = 0 then + VA := Address.Offset + else + VA := MAPAddrToVA(Address.Offset + FSegmentClasses[SegIndex].Start); if FSegmentCnt mod 16 = 0 then SetLength(FSegments, FSegmentCnt + 16); FSegments[FSegmentCnt].Segment := FSegmentClasses[SegIndex].Segment; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 10:52:39
|
Revision: 3304 http://jcl.svn.sourceforge.net/jcl/?rev=3304&view=rev Author: outchy Date: 2010-08-12 10:52:33 +0000 (Thu, 12 Aug 2010) Log Message: ----------- JclDebug.TJclMapScanner.MAPAddrToVA returns an invalid VA for the first module chunk (usually System.pas). Modified Paths: -------------- trunk/jcl/source/windows/JclDebug.pas Modified: trunk/jcl/source/windows/JclDebug.pas =================================================================== --- trunk/jcl/source/windows/JclDebug.pas 2010-08-12 10:33:40 UTC (rev 3303) +++ trunk/jcl/source/windows/JclDebug.pas 2010-08-12 10:52:33 UTC (rev 3304) @@ -1664,7 +1664,7 @@ // only one segment of code // after Delphi 2005: segments started at code base address (module base address + $10000) // 2 segments of code - if (Length(FSegmentClasses) > 0) and (FSegmentClasses[0].Start > 0) and (Addr > FSegmentClasses[0].Start) then + if (Length(FSegmentClasses) > 0) and (FSegmentClasses[0].Start > 0) and (Addr >= FSegmentClasses[0].Start) then // Delphi 2005 and later // The first segment should be code starting at module base address + $10000 Result := Addr - FSegmentClasses[0].Start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 10:33:47
|
Revision: 3303 http://jcl.svn.sourceforge.net/jcl/?rev=3303&view=rev Author: outchy Date: 2010-08-12 10:33:40 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Fix file name mutilations when module name contains dots (for instance Generics.Collections). The code now removes only known extensions (.obj and .pas). Modified Paths: -------------- trunk/jcl/source/windows/JclDebug.pas Modified: trunk/jcl/source/windows/JclDebug.pas =================================================================== --- trunk/jcl/source/windows/JclDebug.pas 2010-08-12 10:04:42 UTC (rev 3302) +++ trunk/jcl/source/windows/JclDebug.pas 2010-08-12 10:33:40 UTC (rev 3303) @@ -1304,7 +1304,8 @@ PExtension := PEnd; while (PExtension >= MapString) and (PExtension^ <> '.') and (PExtension^ <> '|') do Dec(PExtension); - if (PExtension^ = '.') then + if (StrLIComp(PExtension, '.pas ', 5) = 0) or + (StrLIComp(PExtension, '.obj ', 5) = 0) then PEnd := PExtension; PExtension := PEnd; while (PExtension >= MapString) and (PExtension^ <> '|') and (PExtension^ <> '\') do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-12 10:04:48
|
Revision: 3302 http://jcl.svn.sourceforge.net/jcl/?rev=3302&view=rev Author: outchy Date: 2010-08-12 10:04:42 +0000 (Thu, 12 Aug 2010) Log Message: ----------- Avoid duplicate registrations when the expert package is recompiled in the IDE while it was previously installed. Modified Paths: -------------- trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas Modified: trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas 2010-08-10 23:09:34 UTC (rev 3301) +++ trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas 2010-08-12 10:04:42 UTC (rev 3302) @@ -145,6 +145,22 @@ GlobalTypeAttributeHandlers: array [TAllTypeAttributeID] of TJclInterfaceParamsClass; GlobalTypeAttributeDependencies: array [TAllTypeAttributeID] of TAllTypeAttributeIDs; +procedure ClearRegisteredContainers; +var + AttributeID: TAllTypeAttributeID; +begin + SetLength(GlobalInterfaceParams, 0); + SetLength(GlobalImplementationParams, 0); + // avoid spurious errors while recompiling installed package in the IDE + // for some reasons the GlobalTypeAttributeHandlers and GlobalAttirbuteDependencies + // are not clean when the package is reloaded + for AttributeID := Low(AttributeID) to High(AttributeID) do + begin + GlobalTypeAttributeHandlers[AttributeID] := nil; + GlobalTypeAttributeDependencies[AttributeID] := []; + end; +end; + procedure RegisterContainerParams(const PrototypeName: string; InterfaceParamsClass: TJclInterfaceParamsClass); var @@ -153,6 +169,11 @@ PropCount, Index: Integer; Dependencies: TAllTypeAttributeIDs; begin + // avoid duplicate registrations + for Index := Low(GlobalInterfaceParams) to High(GlobalInterfaceParams) do + if (GlobalInterfaceParams[Index].ParamsName = PrototypeName) then + Exit; + PropCount := GetStringPropList(InterfaceParamsClass.ClassInfo, PropList); if PropCount > 0 then begin @@ -200,6 +221,11 @@ PropCount, Index: Integer; PropInfo: PPropInfo; begin + // avoid duplicate registrations + for Index := Low(GlobalInterfaceParams) to High(GlobalInterfaceParams) do + if (GlobalImplementationParams[Index].ParamsName = PrototypeName) then + Exit; + PropCount := GetStringPropList(ImplementationParamsClass.ClassInfo, PropList); if PropCount > 0 then begin @@ -617,7 +643,6 @@ {$IFDEF UNITVERSIONING} UnregisterUnitVersion(HInstance); {$ENDIF UNITVERSIONING} - SetLength(GlobalInterfaceParams, 0); - SetLength(GlobalImplementationParams, 0); + ClearRegisteredContainers; end. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 23:09:42
|
Revision: 3301 http://jcl.svn.sourceforge.net/jcl/?rev=3301&view=rev Author: outchy Date: 2010-08-10 23:09:34 +0000 (Tue, 10 Aug 2010) Log Message: ----------- New attribute for known container types: known defines and known undefs. New feature of JppContainers: some conditionals are implicitly declared when the macro is expanded (as of rev 3298, these conditions can be used to simplify/parameterize macros while they are expanded). The MoveArray procedures are now generated from templates. Revision Links: -------------- http://jcl.svn.sourceforge.net/jcl/?rev=3298&view=rev Modified Paths: -------------- trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas trunk/jcl/devtools/jpp/Templates/JclContainer1DTemplates.pas trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas trunk/jcl/source/common/JclAlgorithms.pas trunk/jcl/source/prototypes/JclAlgorithms.pas trunk/jcl/source/prototypes/containers/JclAlgorithms.imp trunk/jcl/source/prototypes/containers/JclAlgorithms.int Modified: trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -66,6 +66,23 @@ property ProcName: string read GetProcName write SetProcName stored False; end; + (* MOVEARRAYINT(PROCNAME, DYNARRAYTYPENAME, OVERLOAD) *) + TJclMoveArrayIntParams = class(TJclAlgorithmsIntProcParams) + protected + function GetProcName: string; override; + published + property Overload; + property ProcName; + property DynArrayTypeName: string index taDynArrayTypeName read GetTypeAttribute write SetTypeAttribute stored False; + end; + + (* MOVEARRAYIMP(PROCNAME, DYNARRAYTYPENAME) *) + TJclMoveArrayImpParams = class(TJclAlgorithmsImpProcParams) + published + property ProcName; + property DynArrayTypeName: string index taDynArrayTypeName read GetTypeAttribute write SetTypeAttribute stored False; + end; + (* ITERATEINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) *) TJclIterateIntParams = class(TJclAlgorithmsIntProcParams) protected @@ -360,6 +377,7 @@ procedure RegisterJclContainers; begin + RegisterContainerParams('MOVEARRAYINT', TJclMoveArrayIntParams); RegisterContainerParams('ITERATEINT', TJclIterateIntParams); RegisterContainerParams('APPLYINT', TJclApplyIntParams); RegisterContainerParams('SIMPLECOMPAREINT', TJclSimpleCompareIntParams); @@ -375,6 +393,7 @@ RegisterContainerParams('REVERSEINT', TJclReverseIntParams); RegisterContainerParams('SORTINT', TJclSortIntParams); + RegisterContainerParams('MOVEARRAYIMP', TJclMoveArrayImpParams, TJclMoveArrayIntParams); RegisterContainerParams('ITERATEIMP', TJclIterateImpParams, TJclIterateIntParams); RegisterContainerParams('APPLYIMP', TJclApplyImpParams, TJclApplyIntParams); RegisterContainerParams('FINDIMP', TJclFindImpParams, TJclFindIntParams); @@ -413,6 +432,15 @@ (InterfaceParams as TJclAlgorithmsIntProcParams).ProcName := Value; end; +//=== { TJclMoveArrayIntParams } ============================================= + +function TJclMoveArrayIntParams.GetProcName: string; +begin + Result := inherited GetProcName; + if Result = '' then + Result := 'MoveArray'; +end; + //=== { TJclIterateIntParams } =============================================== function TJclIterateIntParams.GetProcName: string; Modified: trunk/jcl/devtools/jpp/Templates/JclContainer1DTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainer1DTemplates.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/devtools/jpp/Templates/JclContainer1DTemplates.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -114,6 +114,8 @@ published property TypeName: string index taTypeName read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; property Condition: string index taCondition read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; + property Defines: string index taDefines read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; + property Undefs: string index taUndefs read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; property Alias: string index taAlias read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; property AliasCondition: string index taAliasCondition read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; property DefaultValue: string index taDefaultValue read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; Modified: trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -42,6 +42,8 @@ IInterfaceKnownType: TKnownTypeAttributes = ({taTypeName} 'IInterface', {taCondition} '', + {taDefines} 'REFCOUNTED', + {taUndefs} '', {taAlias} '', {taAliasCondition} '', {taDefaultValue} 'nil', @@ -122,6 +124,8 @@ AnsiStringKnownType: TKnownTypeAttributes = ({taTypeName} 'AnsiString', {taCondition} '', + {taDefines} 'REFCOUNTED', + {taUndefs} '', {taAlias} 'string', {taAliasCondition} 'CONTAINER_ANSISTR', {taDefaultValue} '''''', @@ -202,6 +206,8 @@ WideStringKnownType: TKnownTypeAttributes = ({taTypeName} 'WideString', {taCondition} '', + {taDefines} 'REFCOUNTED', + {taUndefs} '', {taAlias} 'string', {taAliasCondition} 'CONTAINER_WIDESTR', {taDefaultValue} '''''', @@ -282,6 +288,8 @@ UnicodeStringKnownType: TKnownTypeAttributes = ({taTypeName} 'UnicodeString', {taCondition} 'SUPPORTS_UNICODE_STRING', + {taDefines} 'REFCOUNTED', + {taUndefs} '', {taAlias} 'string', {taAliasCondition} 'CONTAINER_UNICODESTR', {taDefaultValue} '''''', @@ -362,6 +370,8 @@ StringKnownType: TKnownTypeAttributes = ({taTypeName} 'string', {taCondition} '', + {taDefines} 'REFCOUNTED', + {taUndefs} '', {taAlias} '', {taAliasCondition} '', {taDefaultValue} '''''', @@ -442,6 +452,8 @@ SingleKnownType: TKnownTypeAttributes = ({taTypeName} 'Single', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} 'Float', {taAliasCondition} 'MATH_SINGLE_PRECISION', {taDefaultValue} '0.0', @@ -522,6 +534,8 @@ DoubleKnownType: TKnownTypeAttributes = ({taTypeName} 'Double', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} 'Float', {taAliasCondition} 'MATH_DOUBLE_PRECISION', {taDefaultValue} '0.0', @@ -602,6 +616,8 @@ ExtendedKnownType: TKnownTypeAttributes = ({taTypeName} 'Extended', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} 'Float', {taAliasCondition} 'MATH_EXTENDED_PRECISION', {taDefaultValue} '0.0', @@ -682,6 +698,8 @@ FloatKnownType: TKnownTypeAttributes = ({taTypeName} 'Float', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} '0.0', @@ -762,6 +780,8 @@ IntegerKnownType: TKnownTypeAttributes = ({taTypeName} 'Integer', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} '0', @@ -842,6 +862,8 @@ CardinalKnownType: TKnownTypeAttributes = ({taTypeName} 'Cardinal', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} '0', @@ -922,6 +944,8 @@ Int64KnownType: TKnownTypeAttributes = ({taTypeName} 'Int64', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} '0', @@ -1002,6 +1026,8 @@ PointerKnownType: TKnownTypeAttributes = ({taTypeName} 'Pointer', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} 'nil', @@ -1082,6 +1108,8 @@ TObjectKnownType: TKnownTypeAttributes = ({taTypeName} 'TObject', {taCondition} '', + {taDefines} 'ZEROINIT', + {taUndefs} 'REFCOUNTED', {taAlias} '', {taAliasCondition} '', {taDefaultValue} 'nil', Modified: trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/devtools/jpp/Templates/JclContainerTemplates.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -65,7 +65,7 @@ procedure SetAllMapIndex(const Value: Integer); procedure SetMapTypeIndex(const Value: Integer); protected - function ProcessConditional(const MacroText, Condition: string): string; + function ProcessConditional(const MacroText: string; ContainerTypeInfo: TJclContainerTypeInfo): string; public constructor Create; destructor Destroy; override; @@ -120,6 +120,7 @@ SysUtils, JclRTTI, JclSysUtils, + JclStrings, JclContainerIntf, JclContainerKnownTypes, JclContainerKnownMaps; @@ -480,13 +481,13 @@ // process conditional defines if (InterfaceParams is TJclMapInterfaceParams) and FMapInfo.KnownMap then begin - Result := ProcessConditional(Result, FMapInfo.KeyTypeInfo.TypeAttributes[taCondition]); + Result := ProcessConditional(Result, FMapInfo.KeyTypeInfo); if FMapInfo.KeyTypeInfo.TypeAttributes[taCondition] <> FMapInfo.ValueTypeInfo.TypeAttributes[taCondition] then - Result := ProcessConditional(Result, FMapInfo.ValueTypeInfo.TypeAttributes[taCondition]); + Result := ProcessConditional(Result, FMapInfo.ValueTypeInfo); end else if (InterfaceParams is TJclContainerInterfaceParams) and FTypeInfo.KnownType then - Result := ProcessConditional(Result, FTypeInfo.TypeAttributes[taCondition]); + Result := ProcessConditional(Result, FTypeInfo); finally ImplementationParams.Free; InterfaceParams.Free; @@ -516,14 +517,31 @@ Result := Length(KnownTrueTypes); end; -function TJclContainerParams.ProcessConditional(const MacroText, Condition: string): string; +function TJclContainerParams.ProcessConditional(const MacroText: string; ContainerTypeInfo: TJclContainerTypeInfo): string; +var + DefineList: TStrings; + I: Integer; + Condition: string; begin Result := MacroText; + Condition := ContainerTypeInfo.TypeAttributes[taCondition]; if Condition <> '' then Result := Format('{$IFDEF %s}%s%s%s{$ENDIF %s}%s', [Condition, NativeLineBreak, Result, NativeLineBreak, Condition, NativeLineBreak]); + DefineList := TStringList.Create; + try + StrToStrings(ContainerTypeInfo.TypeAttributes[taDefines], ';', DefineList, False); + for I := 0 to DefineList.Count - 1 do + Define(DefineList.Strings[I]); + StrToStrings(ContainerTypeInfo.TypeAttributes[taUndefs], ';', DefineList, False); + for I := 0 to DefineList.Count - 1 do + Undef(DefineList.Strings[I]); + finally + DefineList.Free; + end; + end; procedure TJclContainerParams.SetAllMapIndex(const Value: Integer); Modified: trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -45,7 +45,9 @@ TAllTypeAttributeID = ( // attributes for 1-D containers taTypeName, - taCondition, + taCondition, // condition while expanding macros, will be emitted + taDefines, // list of defines while expanding macros, won't be emitted + taUndefs, // list of undefs while expanding macros, won't be emitted taAlias, taAliasCondition, taDefaultValue, @@ -187,6 +189,8 @@ TypeAttributeInfos: array [TTypeAttributeID] of TTypeAttributeInfo = ( {TypeName} (IsGUID: False; DefaultValue: ''), {Condition} (IsGUID: False; DefaultValue: ''), + {Defines} (IsGUID: False; DefaultValue: ''), + {Undefs} (IsGUID: False; DefaultValue: ''), {Alias} (IsGUID: False; DefaultValue: ''), {AliasCondition} (IsGUID: False; DefaultValue: ''), {DefaultValue} (IsGUID: False; DefaultValue: ''), @@ -306,7 +310,7 @@ TCodeLocation = (clDefault, clAtCursor, clInterface, clImplementation); - TJclMacroParams = class(TJclTemplateParams) + TJclMacroParams = class private // FCodeLocation: TCodeLocation; // FCodeUnit: string; Modified: trunk/jcl/source/common/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -127,27 +127,27 @@ {$ENDIF SUPPORTS_UNICODE_STRING} // move array algorithms + procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_UNICODE_STRING} procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$ENDIF SUPPORTS_UNICODE_STRING} -{$IFNDEF FPC} -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF ~FPC} -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_EXTENDED} procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF SUPPORTS_EXTENDED} procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; + procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFNDEF FPC} +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF ~FPC} // Iterate algorithms @@ -1058,6 +1058,7 @@ Result := Integer(AObject) and MaxInt; end; + procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin @@ -1123,7 +1124,7 @@ end; end; -procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin Assert(Count > 0); @@ -1143,7 +1144,7 @@ end; end; -procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; +procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin {$IFDEF FPC} @@ -1158,7 +1159,7 @@ {$ENDIF ~FPC} end; -procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Keep reference counting working } @@ -1178,75 +1179,87 @@ end; end; -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; end; -procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Clean array } + Assert(Count > 0); if FromIndex < ToIndex then begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); end else if FromIndex > ToIndex then begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - if Count > 0 then + {$IFDEF FPC} + while Count > 0 do begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} end; -procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Clean array } + { Keep reference counting working } if FromIndex < ToIndex then begin if (ToIndex - FromIndex) < Count then Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + InitializeArray(List, FromIndex, Count); end else if FromIndex > ToIndex then begin if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + InitializeArray(List, FromIndex, Count); end; end; -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; end; {$IFDEF SUPPORTS_UNICODE_STRING} + procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin @@ -1302,6 +1315,7 @@ end; end; + procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then @@ -1313,130 +1327,131 @@ end; {$ENDIF SUPPORTS_UNICODE_STRING} -{$IFNDEF FPC} -procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - Assert(Count > 0); + { Clean array } if FromIndex < ToIndex then begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end else if FromIndex > ToIndex then begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end; end; -procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} + +procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; begin - Initialize(List[FromIndex], Count); + if Count > 0 then + begin + + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; end; -procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Keep reference counting working } + { Clean array } if FromIndex < ToIndex then begin if (ToIndex - FromIndex) < Count then Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end else if FromIndex > ToIndex then begin if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) else - InitializeArray(List, FromIndex, Count); + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end; end; -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -{$ENDIF ~FPC} -procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - Assert(Count > 0); + { Clean array } if FromIndex < ToIndex then begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end else if FromIndex > ToIndex then begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end; end; -procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} + +procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; begin - {$IFDEF FPC} - while Count > 0 do + if Count > 0 then begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); + + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} end; -procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Keep reference counting working } + { Clean array } if FromIndex < ToIndex then begin if (ToIndex - FromIndex) < Count then Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end else if FromIndex > ToIndex then begin if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) else - InitializeArray(List, FromIndex, Count); + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); end; end; -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1456,16 +1471,18 @@ end; end; -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1485,16 +1502,18 @@ end; end; -procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1514,17 +1533,18 @@ end; end; -procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -{$IFDEF SUPPORTS_EXTENDED} -procedure InitializeArrayAfterMove(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1544,17 +1564,18 @@ end; end; -procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -{$ENDIF SUPPORTS_EXTENDED} -procedure InitializeArrayAfterMove(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1574,74 +1595,79 @@ end; end; -procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; -procedure InitializeArrayAfterMove(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFNDEF FPC} +procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Clean array } + Assert(Count > 0); if FromIndex < ToIndex then begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); end else if FromIndex > ToIndex then begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; -procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; + + Initialize(List[FromIndex], Count); + end; -procedure InitializeArrayAfterMove(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - { Clean array } + { Keep reference counting working } if FromIndex < ToIndex then begin if (ToIndex - FromIndex) < Count then Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + InitializeArray(List, FromIndex, Count); end else if FromIndex > ToIndex then begin if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + InitializeArray(List, FromIndex, Count); end; end; -procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; end; -procedure InitializeArrayAfterMove(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin { Clean array } @@ -1661,14 +1687,17 @@ end; end; -procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; + +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; begin if Count > 0 then begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); end; end; +{$ENDIF ~FPC} procedure Iterate(const First: IJclIntfIterator; Count: Integer; F: TIntfIterateProcedure); Modified: trunk/jcl/source/prototypes/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 23:09:34 UTC (rev 3301) @@ -79,27 +79,14 @@ {$ENDIF SUPPORTS_UNICODE_STRING} // move array algorithms -procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_UNICODE_STRING} -procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF SUPPORTS_UNICODE_STRING} +(*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT +{$JPPEXPANDMACRO MOVEARRAYINT(MoveArray,, overload;)}*) + +{$JPPEXPANDMACRO MOVEARRAYINT(MoveArray,TDynSizeIntArray, overload;)} {$IFNDEF FPC} -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$JPPEXPANDMACRO MOVEARRAYINT(MoveArray,TDynStringArray, overload;)} +{$JPPEXPANDMACRO MOVEARRAYINT(MoveArray,TDynFloatArray, overload;)} {$ENDIF ~FPC} -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_EXTENDED} -procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF SUPPORTS_EXTENDED} -procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; // Iterate algorithms (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT @@ -789,627 +776,17 @@ Result := Integer(AObject) and MaxInt; end; -procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; +(*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT +{$JPPEXPANDMACRO MOVEARRAYIMP(,)} +*) +{$JPPUNDEF REFCOUNTED}{$JPPDEFINE ZEROINIT}{$JPPEXPANDMACRO MOVEARRAYIMP(MoveArray,TDynSizeIntArray)} -procedure InitializeArray(var List: TDynIInterfaceArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -{$IFDEF SUPPORTS_UNICODE_STRING} -procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynUnicodeStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; -{$ENDIF SUPPORTS_UNICODE_STRING} - {$IFNDEF FPC} -procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; +{$JPPDEFINE REFCOUNTED}{$JPPUNDEF ZEROINIT}{$JPPEXPANDMACRO MOVEARRAYIMP(MoveArray,TDynStringArray)} -procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; +{$JPPUNDEF REFCOUNTED}{$JPPDEFINE ZEROINIT}{$JPPEXPANDMACRO MOVEARRAYIMP(MoveArray,TDynFloatArray)} {$ENDIF ~FPC} -procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -{$IFDEF SUPPORTS_EXTENDED} -procedure InitializeArrayAfterMove(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; -{$ENDIF SUPPORTS_EXTENDED} - -procedure InitializeArrayAfterMove(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT {$JPPEXPANDMACRO ITERATEIMP(Iterate,,)} *) Modified: trunk/jcl/source/prototypes/containers/JclAlgorithms.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclAlgorithms.imp 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/source/prototypes/containers/JclAlgorithms.imp 2010-08-10 23:09:34 UTC (rev 3301) @@ -1,3 +1,92 @@ +(*$JPPDEFINEMACRO MOVEARRAYIMP(PROCNAME, DYNARRAYTYPENAME) +{$IFDEF REFCOUNTED} +procedure FinalizeArrayBeforeMove(var List: DYNARRAYTYPENAME; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: DYNARRAYTYPENAME; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: DYNARRAYTYPENAME; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; +{$ELSE ~REFCOUNTED} +{$IFDEF ZEROINIT} +procedure InitializeArrayAfterMove(var List: DYNARRAYTYPENAME; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; +{$ENDIF ZEROINIT}{$ENDIF ~REFCOUNTED} + +procedure PROCNAME(var List: DYNARRAYTYPENAME; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin +{$IFDEF REFCOUNTED} FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count);{$ENDIF REFCOUNTED} + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); +{$IFDEF REFCOUNTED} InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); +{$ELSE ~REFCOUNTED}{$IFDEF ZEROINIT} InitializeArrayAfterMove(List, FromIndex, ToIndex, Count);{$ENDIF ZEROINIT}{$ENDIF ~REFCOUNTED} + end; +end;*) (*$JPPDEFINEMACRO ITERATEIMP(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE) procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE); var Modified: trunk/jcl/source/prototypes/containers/JclAlgorithms.int =================================================================== --- trunk/jcl/source/prototypes/containers/JclAlgorithms.int 2010-08-10 22:56:10 UTC (rev 3300) +++ trunk/jcl/source/prototypes/containers/JclAlgorithms.int 2010-08-10 23:09:34 UTC (rev 3301) @@ -1,3 +1,5 @@ +(*$JPPDEFINEMACRO MOVEARRAYINT(PROCNAME, DYNARRAYTYPENAME, OVERLOAD) +procedure PROCNAME(var List: DYNARRAYTYPENAME; FromIndex, ToIndex, Count: SizeInt);OVERLOAD*) (*$JPPDEFINEMACRO ITERATEINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE);OVERLOAD*) (*$JPPDEFINEMACRO APPLYINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 22:56:16
|
Revision: 3300 http://jcl.svn.sourceforge.net/jcl/?rev=3300&view=rev Author: outchy Date: 2010-08-10 22:56:10 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Fixed some bugs of rev 3298: - the condition was incorrectly assumed as defined (or undefined) in $ELSE - when a parent tristate is undefined, the child tristates should be activated. Revision Links: -------------- http://jcl.svn.sourceforge.net/jcl/?rev=3298&view=rev Modified Paths: -------------- trunk/jcl/devtools/jpp/JppParser.pas trunk/jcl/devtools/jpp/JppState.pas Modified: trunk/jcl/devtools/jpp/JppParser.pas =================================================================== --- trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 21:03:32 UTC (rev 3299) +++ trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 22:56:10 UTC (rev 3300) @@ -517,9 +517,17 @@ State.Undef(Condition); end; ttUndef: - State.TriState := ttUndef; + if Token = ptIfdef then + State.TriState := ttUndef + else + if Token = ptIfndef then + State.TriState := ttDefined; ttDefined: - State.TriState := ttDefined; + if Token = ptIfdef then + State.TriState := ttDefined + else + if Token = ptIfndef then + State.TriState := ttUndef; end; NextToken; ParseText; @@ -545,9 +553,23 @@ State.Define(Condition); end; ttUndef: - State.TriState := ttDefined; + begin + if Token = ptIfdef then + State.TriState := ttDefined + else + if Token = ptIfndef then + State.TriState := ttUndef; + State.Defines[Condition] := ttDefined; + end; ttDefined: - State.TriState := ttUndef; + begin + if Token = ptIfdef then + State.TriState := ttUndef + else + if Token = ptIfndef then + State.TriState := ttDefined; + State.Defines[Condition] := ttUndef; + end; end; NextToken; ParseText; Modified: trunk/jcl/devtools/jpp/JppState.pas =================================================================== --- trunk/jcl/devtools/jpp/JppState.pas 2010-08-10 21:03:32 UTC (rev 3299) +++ trunk/jcl/devtools/jpp/JppState.pas 2010-08-10 22:56:10 UTC (rev 3300) @@ -1,4 +1,4 @@ -{ **************************************************************************** } +{ **************************************************************************** } { } { PppState - Pascal PreProcessor State } { Copyright (c) 2001 Barry Kelly. } @@ -165,6 +165,7 @@ Macros: IJclStrIntfMap; SearchPath: IJclStrList; TriState: TTriState; + ParentTriState: TTriState; end; //=== { TPppState } ========================================================== @@ -442,14 +443,22 @@ AStateItem.Macros := Macros; AStateItem.SearchPath := SearchPath; AStateItem.TriState := ATriState; + if FStateStack.Empty then + AStateItem.ParentTriState := ttUnknown + else + AStateItem.ParentTriState := InternalPeekTriState; FStateStack.Push(AStateItem); end; procedure TPppState.InternalSetTriState(Value: TTriState); +var + ASimplePppStateItem: TSimplePppStateItem; begin if FStateStack.Empty then raise EPppState.Create('Internal error: PPP State stack is empty'); - (FStateStack.Peek as TSimplePppStateItem).TriState := Value; + ASimplePppStateItem := FStateStack.Peek as TSimplePppStateItem; + if (ASimplePppStateItem.ParentTriState <> ttUndef) or (Value = ttUndef) then + ASimplePppStateItem.TriState := Value; end; function TPppState.IsFileExcluded(const AName: string): Boolean; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 21:03:42
|
Revision: 3299 http://jcl.svn.sourceforge.net/jcl/?rev=3299&view=rev Author: outchy Date: 2010-08-10 21:03:32 +0000 (Tue, 10 Aug 2010) Log Message: ----------- JPP macro are now expanded without side effects on their outer state (state is pushed before the macro text is expanded). As a result, the security stuff around JclContainerCommon's READBEGIN, READEND, WRITEBEGIN, WRITEEND... has to be updated. Modified Paths: -------------- trunk/jcl/devtools/jpp/JppLexer.pas trunk/jcl/devtools/jpp/JppParser.pas trunk/jcl/source/prototypes/containers/JclArrayLists.imp trunk/jcl/source/prototypes/containers/JclArraySets.imp trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp trunk/jcl/source/prototypes/containers/JclContainerCommon.imp trunk/jcl/source/prototypes/containers/JclHashMaps.imp trunk/jcl/source/prototypes/containers/JclHashSets.imp trunk/jcl/source/prototypes/containers/JclLinkedLists.imp trunk/jcl/source/prototypes/containers/JclQueues.imp trunk/jcl/source/prototypes/containers/JclSortedMaps.imp trunk/jcl/source/prototypes/containers/JclStacks.imp trunk/jcl/source/prototypes/containers/JclTrees.imp trunk/jcl/source/prototypes/containers/JclVectors.imp Modified: trunk/jcl/devtools/jpp/JppLexer.pas =================================================================== --- trunk/jcl/devtools/jpp/JppLexer.pas 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/devtools/jpp/JppLexer.pas 2010-08-10 21:03:32 UTC (rev 3299) @@ -64,7 +64,9 @@ ptDefine, ptUndef, ptIfdef, ptIfndef, ptIfopt, ptElse, ptEndif, ptInclude, ptJppDefineMacro, ptJppExpandMacro, ptJppUndefMacro, ptJppGetStrValue, ptJppGetIntValue, ptJppGetBoolValue, - ptJppSetStrValue, ptJppSetIntValue, ptJppSetBoolValue, ptJppLoop); + ptJppSetStrValue, ptJppSetIntValue, ptJppSetBoolValue, ptJppLoop, + // same as $DEFINE and $UNDEF but they will not be written to the final file + ptJppDefine, ptJppUndef); EJppLexerError = class(Exception); @@ -145,6 +147,8 @@ AddToken('jppsetintvalue', ptJppSetIntValue); AddToken('jppsetboolvalue', ptJppSetBoolValue); AddToken('jpploop', ptJppLoop); + AddToken('jppdefine', ptJppDefine); + AddToken('jppundef', ptJppUndef); FBuf := ABuffer; Reset; @@ -217,6 +221,8 @@ ptUndef, ptIfdef, ptIfndef, + ptJppDefine, + ptJppUndef, ptJppGetStrValue, ptJppGetIntValue, ptJppGetBoolValue, Modified: trunk/jcl/devtools/jpp/JppParser.pas =================================================================== --- trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 21:03:32 UTC (rev 3299) @@ -76,8 +76,8 @@ procedure ParseCondition(Token: TJppToken); function ParseInclude: string; - procedure ParseDefine; - procedure ParseUndef; + procedure ParseDefine(Skip: Boolean); + procedure ParseUndef(Skip: Boolean); procedure ParseDefineMacro; procedure ParseExpandMacro; @@ -299,10 +299,12 @@ case TempLexer.CurrTok of ptEof: Break; - ptDefine: + ptDefine, + ptJppDefine: if poProcessDefines in State.Options then State.Define(TempLexer.TokenAsString); - ptUndef: + ptUndef, + ptJppUndef: if poProcessDefines in State.Options then State.Undef(TempLexer.TokenAsString); ptIfdef, ptIfndef: @@ -459,6 +461,8 @@ ptIfopt, ptElse, ptEndif, + ptJppDefine, + ptJppUndef, ptJppDefineMacro, ptJppExpandMacro, ptJppUndefMacro, @@ -563,7 +567,7 @@ NextToken; end; -procedure TJppParser.ParseDefine; +procedure TJppParser.ParseDefine(Skip: Boolean); var Condition: string; begin @@ -574,9 +578,10 @@ ttUndef: begin State.Defines[Lexer.TokenAsString] := ttDefined; - AddResult(Lexer.RawComment); + if not Skip then + AddResult(Lexer.RawComment); end; - // the symbol is already defined + // the symbol is already defined, always skip it ttDefined: ; end; NextToken; @@ -609,15 +614,20 @@ ParamNames: TDynStringArray; begin MacroText := Lexer.TokenAsString; - // expand the macro ParseMacro(MacroText, MacroName, ParamNames, False); - AResult := State.ExpandMacro(MacroName, ParamNames); - // add result to buffer - AddResult(AResult, True, True); + // macros are expanded in a sub-state + State.PushState; + try + AResult := State.ExpandMacro(MacroName, ParamNames); + // add result to buffer + AddResult(AResult, True, True); + finally + State.PopState; + end; NextToken; end; -procedure TJppParser.ParseUndef; +procedure TJppParser.ParseUndef(Skip: Boolean); var Condition: string; begin @@ -628,9 +638,10 @@ ttDefined: begin State.Defines[Lexer.TokenAsString] := ttUndef; - AddResult(Lexer.RawComment); + if not Skip then + AddResult(Lexer.RawComment); end; - // the symbol is already defined + // the symbol is already defined, skip it ttUndef: ; end; NextToken; @@ -850,13 +861,17 @@ NextToken; end; - ptDefine, ptUndef, ptIfdef, ptIfndef, ptIfopt: + ptDefine, ptJppDefine, ptUndef, ptJppUndef, ptIfdef, ptIfndef, ptIfopt: if poProcessDefines in State.Options then case Lexer.CurrTok of ptDefine: - ParseDefine; + ParseDefine(False); + ptJppDefine: + ParseDefine(True); ptUndef: - ParseUndef; + ParseUndef(False); + ptJppUndef: + ParseUndef(True); ptIfdef: ParseCondition(ptIfdef); ptIfndef: Modified: trunk/jcl/source/prototypes/containers/JclArrayLists.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclArrayLists.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -184,7 +184,7 @@ var Index: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if Result then begin @@ -208,14 +208,14 @@ end; end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.AddAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -223,7 +223,7 @@ It := ACollection.First; while It.HasNext do Result := Add(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.AssignDataTo(Dest: TJclAbstractContainerBase); @@ -250,12 +250,12 @@ var I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} for I := 0 to FSize - 1 do RELEASERNAME(FElementData[I]); FSize := 0; AutoPack; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.CollectionEquals(const ACollection: COLLECTIONINTERFACENAME): Boolean; @@ -263,7 +263,7 @@ I: Integer; It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -274,14 +274,14 @@ if not ItemsEqual(FElementData[I], It.Next) then Exit; Result := True; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Contains(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var I: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; for I := 0 to FSize - 1 do if ItemsEqual(FElementData[I], PARAMETERNAME) then @@ -289,38 +289,38 @@ Result := True; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ContainsAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := True; if ACollection = nil then Exit; It := ACollection.First; while Result and It.HasNext do Result := Contains(It.Next); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Delete(Index: Integer): TYPENAME; var Extracted: TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Extracted := ExtractIndex(Index); Result := RELEASERNAME(Extracted); - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Extract(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; for I := FSize - 1 downto 0 do if ItemsEqual(FElementData[I], PARAMETERNAME) then @@ -333,14 +333,14 @@ Break; end; AutoPack; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ExtractAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -348,12 +348,12 @@ It := ACollection.First; while It.HasNext do Result := Extract(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ExtractIndex(Index: Integer): TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if (Index >= 0) and (Index < FSize) then begin Result := FElementData[Index]; @@ -364,7 +364,7 @@ end else Result := RaiseOutOfBoundsError; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.First: ITRINTERFACENAME; @@ -381,21 +381,21 @@ function SELFCLASSNAME.GETTERNAME(Index: Integer): TYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := DEFAULTVALUE; if (Index >= 0) and (Index < FSize) then Result := FElementData[Index] else if not FReturnDefaultElements then raise EJclNoSuchElementError.Create(IntToStr(Index)); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.IndexOf(CONSTKEYWORDPARAMETERNAME: TYPENAME): Integer; var I: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := -1; for I := 0 to FSize - 1 do if ItemsEqual(FElementData[I], PARAMETERNAME) then @@ -403,14 +403,14 @@ Result := I; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Insert(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if (Index < 0) or (Index > FSize) then @@ -440,14 +440,14 @@ end; end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.InsertAll(Index: Integer; const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if (Index < 0) or (Index > FSize) then raise EJclOutOfBoundsError.Create; @@ -458,7 +458,7 @@ It := ACollection.Last; while It.HasPrevious do Result := Insert(Index, It.Previous) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.IsEmpty: Boolean; @@ -475,7 +475,7 @@ var I: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := -1; for I := FSize - 1 downto 0 do if ItemsEqual(FElementData[I], PARAMETERNAME) then @@ -483,7 +483,7 @@ Result := I; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RaiseOutOfBoundsError: TYPENAME; @@ -495,21 +495,21 @@ var Extracted: TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := Extract(PARAMETERNAME); if Result then begin Extracted := PARAMETERNAME; RELEASERNAME(Extracted); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -517,14 +517,14 @@ It := ACollection.First; while It.HasNext do Result := Remove(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -532,12 +532,12 @@ for I := FSize - 1 downto 0 do if not ACollection.Contains(FElementData[I]) then Delete(I); - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.SetCapacity(Value: Integer); begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if Value >= FSize then begin SetLength(FElementData, Value); @@ -545,7 +545,7 @@ end else raise EJclOutOfBoundsError.Create; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.SETTERNAME(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME); @@ -553,7 +553,7 @@ ReplaceItem: Boolean; I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if (Index < 0) or (Index >= FSize) then raise EJclOutOfBoundsError.Create; ReplaceItem := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); @@ -574,7 +574,7 @@ end; if not ReplaceItem then Delete(Index); - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Size: Integer; @@ -587,12 +587,12 @@ I: Integer; Last: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Last := First + Count - 1; if Last >= FSize then Last := FSize - 1; Result := CreateEmptyContainer as LISTINTERFACENAME; for I := First to Last do Result.Add(FElementData[I]); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end;*) \ No newline at end of file Modified: trunk/jcl/source/prototypes/containers/JclArraySets.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclArraySets.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclArraySets.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -5,7 +5,7 @@ var Idx: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if Result then begin @@ -17,21 +17,21 @@ if Result then Result := inherited Insert(Idx + 1, PARAMETERNAME); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.AddAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; It := ACollection.First; while It.HasNext do Result := Add(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.BinarySearch(CONSTKEYWORDPARAMETERNAME: TYPENAME): Integer; @@ -39,7 +39,7 @@ HiPos, LoPos, CompPos: Integer; Comp: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} LoPos := 0; HiPos := Size - 1; CompPos := (HiPos + LoPos) div 2; @@ -59,20 +59,20 @@ CompPos := (HiPos + LoPos) div 2; end; Result := HiPos; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Contains(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Idx: Integer; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Idx := BinarySearch(PARAMETERNAME); if Idx >= 0 then Result := ItemsEqual(GETTERNAME(Idx), PARAMETERNAME) else Result := False; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Insert(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; Modified: trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclBinaryTrees.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -39,7 +39,7 @@ function BASEITRCLASSNAME.ChildrenCount: Integer; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := 0; if FCursor <> nil then begin @@ -48,7 +48,7 @@ if FCursor.Right <> nil then Inc(Result); end; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; procedure BASEITRCLASSNAME.DeleteChild(Index: Integer); @@ -65,7 +65,7 @@ var OldCursor: NODETYPENAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnTree)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} CheckValid; Valid := False; OldCursor := FCursor; @@ -77,7 +77,7 @@ or (not FEqualityComparer.ItemsEqual(OldCursor.Value, FCursor.Value)); FOwnTree.Extract(OldCursor.Value); end; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; procedure BASEITRCLASSNAME.ExtractChild(Index: Integer); @@ -92,7 +92,7 @@ function BASEITRCLASSNAME.GetChild(Index: Integer): TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := DEFAULTVALUE; if (FCursor <> nil) and (Index = 0) and (FCursor.Left <> nil) then FCursor := FCursor.Left @@ -109,12 +109,12 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.GETTERNAME: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} CheckValid; Result := DEFAULTVALUE; if FCursor <> nil then @@ -122,12 +122,12 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasChild(Index: Integer): Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if (FCursor <> nil) and (Index = 0) then Result := (FCursor.Left <> nil) or (FCursor.Right <> nil) else @@ -135,53 +135,53 @@ Result := (FCursor.Left <> nil) and (FCursor.Right <> nil) else Result := False; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasLeft: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := (FCursor <> nil) and (FCursor.Left <> nil); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasNext: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if Valid then Result := GetNextCursor <> nil else Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasParent: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := (FCursor <> nil) and (FCursor.Parent <> nil); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasPrevious: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if Valid then Result := GetPreviousCursor <> nil else Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.HasRight: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := (FCursor <> nil) and (FCursor.Right <> nil); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.IndexOfChild(CONSTKEYWORDPARAMETERNAME: TYPENAME): Integer; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := -1; if FCursor <> nil then begin @@ -197,7 +197,7 @@ if (FCursor.Right <> nil) and FEqualityComparer.ItemsEqual(FCursor.Right.Value, PARAMETERNAME) then Result := 0; end; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.Insert(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; @@ -228,7 +228,7 @@ function BASEITRCLASSNAME.Left: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := DEFAULTVALUE; if FCursor <> nil then FCursor := FCursor.Left; @@ -237,25 +237,25 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; {$IFDEF SUPPORTS_FOR_IN} function BASEITRCLASSNAME.MoveNext: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if Valid then FCursor := GetNextCursor else Valid := True; Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; {$ENDIF SUPPORTS_FOR_IN} function BASEITRCLASSNAME.Next: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if Valid then FCursor := GetNextCursor else @@ -266,7 +266,7 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.NextIndex: Integer; @@ -277,7 +277,7 @@ function BASEITRCLASSNAME.Parent: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := DEFAULTVALUE; if FCursor <> nil then FCursor := FCursor.Parent; @@ -286,12 +286,12 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.Previous: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} if Valid then FCursor := GetPreviousCursor else @@ -302,7 +302,7 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.PreviousIndex: Integer; @@ -315,7 +315,7 @@ var OldCursor: NODETYPENAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnTree)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} CheckValid; Valid := False; OldCursor := FCursor; @@ -327,14 +327,14 @@ or (not FEqualityComparer.ItemsEqual(OldCursor.Value, FCursor.Value)); FOwnTree.Remove(OldCursor.Value); end; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; procedure BASEITRCLASSNAME.Reset; var NewCursor: NODETYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Valid := False; case FStart of isFirst: @@ -363,12 +363,12 @@ FCursor := FCursor.Parent; end; end; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; function BASEITRCLASSNAME.Right: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnTree)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnTree)} Result := DEFAULTVALUE; if FCursor <> nil then FCursor := FCursor.Right; @@ -377,7 +377,7 @@ else if not FOwnTree.ReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnTree)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnTree)} end; procedure BASEITRCLASSNAME.SetChild(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME); @@ -582,7 +582,7 @@ NewNode, Current, Save: NODETYPENAME; Comp, Depth: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} // Insert into right place if FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE) then begin @@ -630,14 +630,14 @@ end else Result := False; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.AddAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -645,7 +645,7 @@ It := ACollection.First; while It.HasNext do Result := Add(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.AssignDataTo(Dest: TJclAbstractContainerBase); @@ -713,7 +713,7 @@ var Current, Parent: NODETYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} // postorder Current := FRoot; if Current = nil then @@ -760,7 +760,7 @@ FRoot := nil; FSize := 0; FMaxDepth := 0; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.CloneNode(Node, Parent: NODETYPENAME): NODETYPENAME; @@ -778,7 +778,7 @@ var It, ItSelf: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -793,7 +793,7 @@ Result := False; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Contains(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; @@ -801,7 +801,7 @@ Comp: Integer; Current: NODETYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; Current := FRoot; while Current <> nil do @@ -818,21 +818,21 @@ else Current := Current.Right; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ContainsAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := True; if ACollection = nil then Exit; It := ACollection.First; while Result and It.HasNext do Result := Contains(It.Next); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Extract(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; @@ -840,7 +840,7 @@ Current, Successor: NODETYPENAME; Comp: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; // locate PARAMETERNAME in the tree Current := FRoot; @@ -956,14 +956,14 @@ Current := Successor; until FRemoveSingleElement or (Current = nil); AutoPack; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ExtractAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -971,14 +971,14 @@ It := ACollection.First; while It.HasNext do Result := Extract(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.First: STDITRINTERFACENAME; var Start: NODETYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Start := FRoot; case GetTraverseOrder of toPreOrder: @@ -1005,7 +1005,7 @@ else Result := nil; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; {$IFDEF SUPPORTS_FOR_IN} @@ -1017,7 +1017,7 @@ function SELFCLASSNAME.GetRoot: TREEITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} case GetTraverseOrder of toPreOrder: Result := PREORDERITRCLASSNAME.Create(Self, FRoot, False, isRoot); @@ -1028,7 +1028,7 @@ else Result := nil; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.GetTraverseOrder: TJclTraverseOrder; @@ -1045,7 +1045,7 @@ var Start: NODETYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Start := FRoot; case FTraverseOrder of toPreOrder: @@ -1072,7 +1072,7 @@ else Result := nil; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.Pack; @@ -1081,7 +1081,7 @@ ANode, BNode: NODETYPENAME; Index: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} SetLength(Leafarray, FSize); try // in order enumeration of nodes @@ -1130,28 +1130,28 @@ finally SetLength(LeafArray, 0); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Remove(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Extracted: TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := Extract(PARAMETERNAME); if Result then begin Extracted := PARAMETERNAME; RELEASERNAME(Extracted); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -1159,14 +1159,14 @@ It := ACollection.First; while It.HasNext do Result := Remove(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: STDITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -1175,7 +1175,7 @@ while It.HasNext do if not ACollection.Contains(It.Next) then It.Remove; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.SetCapacity(Value: Integer); Modified: trunk/jcl/source/prototypes/containers/JclContainerCommon.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclContainerCommon.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclContainerCommon.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -1,64 +1,60 @@ -(*$JPPDEFINEMACRO READBEGIN -{$JPPDEFINEMACRO READLOCK} -{$IFDEF THREADSAFE} -if FThreadSafe then - SyncReaderWriter.BeginRead; -try -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO READEND -{$JPPEXPANDMACRO READLOCK} -{$JPPUNDEFMACRO READLOCK} -{$IFDEF THREADSAFE} -finally - if FThreadSafe then - SyncReaderWriter.EndRead; -end; -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO WRITEBEGIN -{$JPPDEFINEMACRO WRITELOCK} +(*$JPPDEFINEMACRO LOCK +{$IFDEF WRITE} if ReadOnly then raise EJclReadOnlyError.Create; {$IFDEF THREADSAFE} if FThreadSafe then SyncReaderWriter.BeginWrite; try -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO WRITEEND -{$JPPEXPANDMACRO WRITELOCK} -{$JPPUNDEFMACRO WRITELOCK} +{$ENDIF THREADSAFE} +{$ELSE ~WRITE} {$IFDEF THREADSAFE} +if FThreadSafe then + SyncReaderWriter.BeginRead; +try +{$ENDIF THREADSAFE} +{$ENDIF ~WRITE}*) +(*$JPPDEFINEMACRO UNLOCK +{$IFDEF WRITE} +{$IFDEF THREADSAFE} finally if FThreadSafe then SyncReaderWriter.EndWrite; end; -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO DELEGATEREADBEGIN(CONTAINERNAME) -{$JPPDEFINEMACRO DELREADLOCK} +{$ENDIF THREADSAFE} +{$ELSE ~WRITE} {$IFDEF THREADSAFE} -CONTAINERNAME.ReadLock; -try -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO DELEGATEREADEND(CONTAINERNAME) -{$JPPEXPANDMACRO DELREADLOCK} -{$JPPUNDEFMACRO DELREADLOCK} -{$IFDEF THREADSAFE} finally - CONTAINERNAME.ReadUnlock; + if FThreadSafe then + SyncReaderWriter.EndRead; end; -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO DELEGATEWRITEBEGIN(CONTAINERNAME) -{$JPPDEFINEMACRO DELWRITELOCK} +{$ENDIF THREADSAFE} +{$ENDIF ~WRITE}*) +(*$JPPDEFINEMACRO DELEGATELOCK(CONTAINERNAME) +{$IFDEF WRITE} if CONTAINERNAME.ReadOnly then raise EJclReadOnlyError.Create; {$IFDEF THREADSAFE} CONTAINERNAME.WriteLock; try -{$ENDIF THREADSAFE}*) -(*$JPPDEFINEMACRO DELEGATEWRITEEND(CONTAINERNAME) -{$JPPEXPANDMACRO DELWRITELOCK} -{$JPPUNDEFMACRO DELWRITELOCK} +{$ENDIF THREADSAFE} +{$ELSE ~WRITE} {$IFDEF THREADSAFE} +CONTAINERNAME.ReadLock; +try +{$ENDIF THREADSAFE} +{$ENDIF ~WRITE}*) +(*$JPPDEFINEMACRO DELEGATEUNLOCK(CONTAINERNAME) +{$IFDEF WRITE} +{$IFDEF THREADSAFE} finally CONTAINERNAME.WriteUnlock; end; -{$ENDIF THREADSAFE}*) \ No newline at end of file +{$ENDIF THREADSAFE} +{$ELSE ~WRITE} +{$IFDEF THREADSAFE} +finally + CONTAINERNAME.ReadUnlock; +end; +{$ENDIF THREADSAFE} +{$ENDIF ~WRITE}*) \ No newline at end of file Modified: trunk/jcl/source/prototypes/containers/JclHashMaps.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclHashMaps.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclHashMaps.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -52,7 +52,7 @@ ADest: SELFCLASSNAME; AMap: MAPINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} inherited AssignDataTo(Dest); if Dest is SELFCLASSNAME then begin @@ -81,7 +81,7 @@ AMap.Clear; AMap.PutAll(Self); end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.AssignPropertiesTo(Dest: TJclAbstractContainerBase); @@ -96,7 +96,7 @@ I, J: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} for I := 0 to FCapacity - 1 do begin Bucket := FBuckets[I]; @@ -111,7 +111,7 @@ end; end; FSize := 0; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ContainsKey(KEYCONSTKEYWORDKey: KEYTYPENAME): Boolean; @@ -119,7 +119,7 @@ I: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; Bucket := FBuckets[FHashFunction(Hash(Key), FCapacity)]; if Bucket <> nil then @@ -129,7 +129,7 @@ Result := True; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ContainsValue(VALUECONSTKEYWORDValue: VALUETYPENAME): Boolean; @@ -137,7 +137,7 @@ I, J: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; for J := 0 to FCapacity - 1 do begin @@ -150,7 +150,7 @@ Break; end; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Extract(KEYCONSTKEYWORDKey: KEYTYPENAME): VALUETYPENAME; @@ -158,7 +158,7 @@ Bucket: BUCKETTYPENAME; I, NewCapacity: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := VALUEDEFAULT; Bucket := FBuckets[FHashFunction(Hash(Key), FCapacity)]; if Bucket <> nil then @@ -180,7 +180,7 @@ if NewCapacity < Length(Bucket.Entries) then SetLength(Bucket.Entries, NewCapacity); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.GetValue(KEYCONSTKEYWORDKey: KEYTYPENAME): VALUETYPENAME; @@ -189,7 +189,7 @@ Bucket: BUCKETTYPENAME; Found: Boolean; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Found := False; Result := VALUEDEFAULT; Bucket := FBuckets[FHashFunction(Hash(Key), FCapacity)]; @@ -203,7 +203,7 @@ end; if (not Found) and (not FReturnDefaultElements) then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.IsEmpty: Boolean; @@ -217,7 +217,7 @@ Bucket: BUCKETTYPENAME; Found: Boolean; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Found := False; Result := KEYDEFAULT; for J := 0 to FCapacity - 1 do @@ -234,7 +234,7 @@ end; if (not Found) and (not FReturnDefaultElements) then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.KeySet: KEYSETINTERFACENAME; @@ -242,7 +242,7 @@ I, J: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := CREATEKEYSET; for I := 0 to FCapacity - 1 do begin @@ -251,7 +251,7 @@ for J := 0 to Bucket.Size - 1 do Result.Add(Bucket.Entries[J].Key); end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.MapEquals(const AMap: MAPINTERFACENAME): Boolean; @@ -259,7 +259,7 @@ I, J: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if AMap = nil then Exit; @@ -279,7 +279,7 @@ Exit; end; Result := True; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.Pack; @@ -287,7 +287,7 @@ I: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} for I := 0 to FCapacity - 1 do begin Bucket := FBuckets[I]; @@ -299,7 +299,7 @@ FreeAndNil(FBuckets[I]); end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.PutAll(const AMap: MAPINTERFACENAME); @@ -307,7 +307,7 @@ It: KEYITRINTERFACENAME; Key: KEYTYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if AMap = nil then Exit; It := AMap.KeySet.First; @@ -316,7 +316,7 @@ Key := It.Next; PutValue(Key, AMap.GetValue(Key)); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.PutValue(KEYCONSTKEYWORDKey: KEYTYPENAME; VALUECONSTKEYWORDValue: VALUETYPENAME); @@ -325,7 +325,7 @@ Bucket: BUCKETTYPENAME; I: Integer; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if FAllowDefaultElements or (not KeysEqual(Key, KEYDEFAULT) and not ValuesEqual(Value, VALUEDEFAULT)) then begin Index := FHashFunction(Hash(Key), FCapacity); @@ -358,20 +358,20 @@ Inc(FSize); end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Remove(KEYCONSTKEYWORDKey: KEYTYPENAME): VALUETYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := Extract(Key); Result := FreeValue(Result); - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.SetCapacity(Value: Integer); begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} if FSize = 0 then begin SetLength(FBuckets, Value); @@ -379,7 +379,7 @@ end else raise EJclOperationNotSupportedError.Create; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Size: Integer; @@ -392,7 +392,7 @@ I, J: Integer; Bucket: BUCKETTYPENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := CREATEVALUECOLLECTION; for I := 0 to FCapacity - 1 do begin @@ -401,5 +401,5 @@ for J := 0 to Bucket.Size - 1 do Result.Add(Bucket.Entries[J].Value); end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end;*) Modified: trunk/jcl/source/prototypes/containers/JclHashSets.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclHashSets.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclHashSets.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -15,18 +15,18 @@ function SELFCLASSNAME.Add(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FMap)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := not FMap.ContainsKey(PARAMETERNAME); if Result then FMap.PutValue(PARAMETERNAME, RefUnique); - {$JPPEXPANDMACRO DELEGATEWRITEEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; function SELFCLASSNAME.AddAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FMap)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -34,7 +34,7 @@ It := ACollection.First; while It.HasNext do Result := Add(It.Next) and Result; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; procedure SELFCLASSNAME.AssignDataTo(Dest: TJclAbstractContainerBase); @@ -53,7 +53,7 @@ var It, ItMap: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FMap)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -68,7 +68,7 @@ Result := False; Exit; end; - {$JPPEXPANDMACRO DELEGATEREADEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; function SELFCLASSNAME.Contains(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; @@ -80,7 +80,7 @@ var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FMap)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -88,7 +88,7 @@ It := ACollection.First; while Result and It.HasNext do Result := FMap.ContainsKey(It.Next); - {$JPPEXPANDMACRO DELEGATEREADEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; function SELFCLASSNAME.Extract(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; @@ -101,7 +101,7 @@ It: ITRINTERFACENAME; ARefUnique: TRefUnique; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FMap)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -110,7 +110,7 @@ It := ACollection.First; while It.HasNext do Result := (FMap.Extract(It.Next) = ARefUnique) and Result; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; function SELFCLASSNAME.First: ITRINTERFACENAME; @@ -200,7 +200,7 @@ It: ITRINTERFACENAME; ARefUnique: TRefUnique; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FMap)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -209,14 +209,14 @@ It := ACollection.First; while It.HasNext do Result := (FMap.Remove(It.Next) = ARefUnique) and Result; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; function SELFCLASSNAME.RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var ItMap: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FMap)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FMap)} Result := False; if ACollection = nil then Exit; @@ -225,7 +225,7 @@ while ItMap.HasNext do if not ACollection.Contains(ItMap.Next) then ItMap.Remove; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FMap)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FMap)} end; procedure SELFCLASSNAME.SetAutoPackParameter(Value: Integer); Modified: trunk/jcl/source/prototypes/containers/JclLinkedLists.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2010-08-10 19:27:39 UTC (rev 3298) +++ trunk/jcl/source/prototypes/containers/JclLinkedLists.imp 2010-08-10 21:03:32 UTC (rev 3299) @@ -40,7 +40,7 @@ var OldCursor: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnList)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} CheckValid; Valid := False; if FCursor <> nil then @@ -53,7 +53,7 @@ FCursor := FCursor.Next; OldCursor.Free; end; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.GETTERNAME: TYPENAME; @@ -69,29 +69,29 @@ function SELFCLASSNAME.HasNext: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} if Valid then Result := (FCursor <> nil) and (FCursor.Next <> nil) else Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.HasPrevious: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} if Valid then Result := (FCursor <> nil) and (FCursor.Previous <> nil) else Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.Insert(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var NewCursor: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnList)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} CheckValid; Result := FCursor <> nil; if Result then @@ -124,7 +124,7 @@ end; end; end; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.IteratorEquals(const AIterator: ITRINTERFACENAME): Boolean; @@ -146,19 +146,19 @@ {$IFDEF SUPPORTS_FOR_IN} function SELFCLASSNAME.MoveNext: Boolean; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} if Valid and (FCursor <> nil) then FCursor := FCursor.Next else Valid := True; Result := FCursor <> nil; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; {$ENDIF SUPPORTS_FOR_IN} function SELFCLASSNAME.Next: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} if Valid and (FCursor <> nil) then FCursor := FCursor.Next else @@ -167,7 +167,7 @@ Result := FCursor.Value else Result := DEFAULTVALUE; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.NextIndex: Integer; @@ -178,7 +178,7 @@ function SELFCLASSNAME.Previous: TYPENAME; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} if Valid and (FCursor <> nil) then FCursor := FCursor.Previous else @@ -187,7 +187,7 @@ Result := FCursor.Value else Result := DEFAULTVALUE; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; function SELFCLASSNAME.PreviousIndex: Integer; @@ -200,7 +200,7 @@ var OldCursor: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnList)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} CheckValid; Valid := False; if FCursor <> nil then @@ -214,12 +214,12 @@ FCursor := FCursor.Next; OldCursor.Free; end; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; procedure SELFCLASSNAME.Reset; begin - {$JPPEXPANDMACRO DELEGATEREADBEGIN(FOwnList)} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} Valid := False; case FStart of isFirst: @@ -233,16 +233,16 @@ FCursor := FCursor.Next; end; end; - {$JPPEXPANDMACRO DELEGATEREADEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end; procedure SELFCLASSNAME.SETTERNAME(CONSTKEYWORDPARAMETERNAME: TYPENAME); begin - {$JPPEXPANDMACRO DELEGATEWRITEBEGIN(FOwnList)} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO DELEGATELOCK(FOwnList)} CheckValid; RELEASERCALL FCursor.Value := PARAMETERNAME; - {$JPPEXPANDMACRO DELEGATEWRITEEND(FOwnList)} + {$JPPEXPANDMACRO DELEGATEUNLOCK(FOwnList)} end;*) (*$JPPDEFINEMACRO JCLLINKEDLISTIMP(SELFCLASSNAME, ITEMCLASSNAME, COLLECTIONINTERFACENAME, LISTINTERFACENAME, ITRINTERFACENAME, ITRCLASSNAME, OWNERSHIPDECLARATION, OWNERSHIPPARAMETER, @@ -269,7 +269,7 @@ var NewItem: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if Result then begin @@ -305,7 +305,7 @@ Inc(FSize); end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.AddAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; @@ -315,7 +315,7 @@ AddItem: Boolean; NewItem: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -361,7 +361,7 @@ end; Result := AddItem and Result; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.AssignDataTo(Dest: TJclAbstractContainerBase); @@ -380,7 +380,7 @@ var Old, Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Current := FStart; while Current <> nil do begin @@ -394,14 +394,14 @@ //Daniele Teti 27/12/2004 FStart := nil; FEnd := nil; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.CollectionEquals(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It, ItSelf: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -416,14 +416,14 @@ Result := False; Break; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Contains(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; Current := FStart; while Current <> nil do @@ -435,14 +435,14 @@ end; Current := Current.Next; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ContainsAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -450,14 +450,14 @@ It := ACollection.First; while Result and It.HasNext do Result := Contains(It.Next); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Delete(Index: Integer): TYPENAME; var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := DEFAULTVALUE; if (Index >= 0) and (Index < FSize) then begin @@ -485,14 +485,14 @@ end else raise EJclOutOfBoundsError.Create; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Extract(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; Current := FStart; while Current <> nil do @@ -516,28 +516,28 @@ end; Current := Current.Next; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ExtractAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := True; if ACollection = nil then Exit; It := ACollection.First; while It.HasNext do Result := Extract(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.ExtractIndex(Index: Integer): TYPENAME; var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := DEFAULTVALUE; if (Index >= 0) and (Index < FSize) then begin @@ -565,7 +565,7 @@ end else raise EJclOutOfBoundsError.Create; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.First: ITRINTERFACENAME; @@ -584,7 +584,7 @@ var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := DEFAULTVALUE; Current := FStart; while (Current <> nil) and (Index > 0) do @@ -597,14 +597,14 @@ else if not FReturnDefaultElements then raise EJclNoSuchElementError.Create(''); - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.IndexOf(CONSTKEYWORDPARAMETERNAME: TYPENAME): Integer; var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Current := FStart; Result := 0; while (Current <> nil) and not ItemsEqual(Current.Value, PARAMETERNAME) do @@ -614,14 +614,14 @@ end; if Current = nil then Result := -1; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Insert(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Current, NewItem: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if (Index < 0) or (Index > FSize) then raise EJclOutOfBoundsError.Create; @@ -682,7 +682,7 @@ end; end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.InsertAll(Index: Integer; const ACollection: COLLECTIONINTERFACENAME): Boolean; @@ -692,7 +692,7 @@ AddItem: Boolean; Item: TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if (Index < 0) or (Index > FSize) then raise EJclOutOfBoundsError.Create; @@ -820,7 +820,7 @@ end; end; end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.IsEmpty: Boolean; @@ -837,7 +837,7 @@ var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := -1; if FEnd <> nil then begin @@ -851,42 +851,42 @@ if Current = nil then Result := -1; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Remove(CONSTKEYWORDPARAMETERNAME: TYPENAME): Boolean; var Extracted: TYPENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := Extract(PARAMETERNAME); if Result then begin Extracted := PARAMETERNAME; RELEASERNAME(Extracted); end; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RemoveAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := True; if ACollection = nil then Exit; It := ACollection.First; while It.HasNext do Result := Remove(It.Next) and Result; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.RetainAll(const ACollection: COLLECTIONINTERFACENAME): Boolean; var It: ITRINTERFACENAME; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} Result := False; if ACollection = nil then Exit; @@ -895,7 +895,7 @@ while It.HasNext do if not ACollection.Contains(It.Next) then It.Remove; - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; procedure SELFCLASSNAME.SETTERNAME(Index: Integer; CONSTKEYWORDPARAMETERNAME: TYPENAME); @@ -903,7 +903,7 @@ Current: ITEMCLASSNAME; ReplaceItem: Boolean; begin - {$JPPEXPANDMACRO WRITEBEGIN} + {$JPPDEFINE WRITE}{$JPPEXPANDMACRO LOCK} ReplaceItem := FAllowDefaultElements or not ItemsEqual(PARAMETERNAME, DEFAULTVALUE); if ReplaceItem then begin @@ -938,7 +938,7 @@ end; if not ReplaceItem then Delete(Index); - {$JPPEXPANDMACRO WRITEEND} + {$JPPEXPANDMACRO UNLOCK} end; function SELFCLASSNAME.Size: Integer; @@ -950,7 +950,7 @@ var Current: ITEMCLASSNAME; begin - {$JPPEXPANDMACRO READBEGIN} + {$JPPUNDEF WRITE}{$JPPEXPANDMACRO LOCK} Result := CreateEmptyContainer as LISTINTERFACENAME; Current := FStart; while (Current <> nil) and (First > 0) do @@ -964,5 +964,5 @@ Dec(Count); Current := Current.Next; end; - {$JPPEXPANDMACRO READEND} + {$JPPEXPANDMACRO UNLOCK} end;*) \ No newline at end of file Modified: trunk/jcl/source/prototypes/containers/JclQueues.imp =================================================================== --- trunk/jcl/source/prot... [truncated message content] |
From: <ou...@us...> - 2010-08-10 19:27:47
|
Revision: 3298 http://jcl.svn.sourceforge.net/jcl/?rev=3298&view=rev Author: outchy Date: 2010-08-10 19:27:39 +0000 (Tue, 10 Aug 2010) Log Message: ----------- The JPP is now able to simplify conditional defines while expanding macros. Modified Paths: -------------- trunk/jcl/devtools/jpp/JppParser.pas Modified: trunk/jcl/devtools/jpp/JppParser.pas =================================================================== --- trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 19:19:19 UTC (rev 3297) +++ trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 19:27:39 UTC (rev 3298) @@ -67,7 +67,7 @@ FAllWhiteSpaceOut: Boolean; procedure RemoveOrphanedLineBreaks; protected - procedure AddResult(const S: string; FixIndent: Boolean = False); + procedure AddResult(const S: string; FixIndent: Boolean = False; ForceRecurseTest: Boolean = False); function IsExcludedInclude(const FileName: string): Boolean; procedure NextToken; @@ -272,7 +272,7 @@ inherited; end; -procedure TJppParser.AddResult(const S: string; FixIndent: Boolean); +procedure TJppParser.AddResult(const S: string; FixIndent, ForceRecurseTest: Boolean); var I, J: Integer; LinePrefix, AResult, Line: string; @@ -288,16 +288,29 @@ AResult := S; // recurse macro expanding - if StrIPos('$JPP', AResult) > 0 then + if ForceRecurseTest or (StrIPos('$JPP', AResult) > 0) then begin Recurse := False; TempLexer := TJppLexer.Create(AResult); try + State.PushState; while True do begin case TempLexer.CurrTok of ptEof: Break; + ptDefine: + if poProcessDefines in State.Options then + State.Define(TempLexer.TokenAsString); + ptUndef: + if poProcessDefines in State.Options then + State.Undef(TempLexer.TokenAsString); + ptIfdef, ptIfndef: + if (poProcessDefines in State.Options) and (State.Defines[TempLexer.TokenAsString] in [ttDefined, ttUndef]) then + begin + Recurse := True; + Break; + end; ptJppDefineMacro, ptJppExpandMacro, ptJppUndefMacro: @@ -322,6 +335,7 @@ TempLexer.NextTok; end; finally + State.PopState; TempLexer.Free; end; if Recurse then @@ -537,31 +551,6 @@ State.PopState; end; end; - (*end - else - if ((Token = ptIfdef) and (ConditionTriState = ttDefined)) - or ((Token = ptIfndef) and (ConditionTriState = ttUndef)) then - begin - NextToken; - ParseText; - if Lexer.CurrTok = ptElse then - begin - NextToken; - Skip; - end; - end - else - begin - NextToken; - Skip; - if Lexer.CurrTok = ptElse then - begin - NextToken; - ParseText; - end - else - ; - end;*) if Lexer.CurrTok <> ptEndif then Lexer.Error('$ENDIF expected'); case ConditionTriState of @@ -624,7 +613,7 @@ ParseMacro(MacroText, MacroName, ParamNames, False); AResult := State.ExpandMacro(MacroName, ParamNames); // add result to buffer - AddResult(AResult, True); + AddResult(AResult, True, True); NextToken; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 19:19:26
|
Revision: 3297 http://jcl.svn.sourceforge.net/jcl/?rev=3297&view=rev Author: outchy Date: 2010-08-10 19:19:19 +0000 (Tue, 10 Aug 2010) Log Message: ----------- The JPP is now able to simplify some patterns like: {$DEFINE FOO} {$IFDEF FOO} will be simplified {$ENDIF FOO} It also assumes that the conditions are defined (or undefined) in the conditional blocks: {$IFDEF FOO} {$IFDEF FOO} will be simplified {$ELSE ~FOO} will be removed {$ENDIF ~FOO} {$ELSE ~FOO} {$IFDEF FOO} will be removed {$ELSE ~FOO} will be simplified {$ENDIF ~FOO} {$ENDIF ~FOO} Modified Paths: -------------- trunk/jcl/devtools/jpp/JppParser.pas trunk/jcl/devtools/jpp/JppState.pas trunk/jcl/source/common/JclAlgorithms.pas Modified: trunk/jcl/devtools/jpp/JppParser.pas =================================================================== --- trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 16:13:22 UTC (rev 3296) +++ trunk/jcl/devtools/jpp/JppParser.pas 2010-08-10 19:19:19 UTC (rev 3297) @@ -60,11 +60,9 @@ private FLexer: TJppLexer; FState: TPppState; - FTriState: TTriState; FResult: string; FResultLen: Integer; FLineBreakPos: Integer; - FSkipLevel: Integer; FAllWhiteSpaceIn: Boolean; FAllWhiteSpaceOut: Boolean; procedure RemoveOrphanedLineBreaks; @@ -93,9 +91,6 @@ procedure ParseSetIntValue; procedure ParseSetStrValue; - // same as ParseText, but throws result away - procedure Skip; - property Lexer: TJppLexer read FLexer; property State: TPppState read FState; public @@ -268,7 +263,6 @@ FLexer := TJppLexer.Create(ABuffer); FState := APppState; - FTriState := ttUnknown; FState.Undef('PROTOTYPE'); end; @@ -289,6 +283,9 @@ Lines: TStrings; Recurse: Boolean; begin + if State.TriState = ttUndef then + Exit; + AResult := S; // recurse macro expanding if StrIPos('$JPP', AResult) > 0 then @@ -392,8 +389,6 @@ Lines.Free; end; end; - if FSkipLevel > 0 then - Exit; while FResultLen + Length(AResult) > Length(FResult) do SetLength(FResult, Length(FResult) * 2); Move(AResult[1], FResult[FResultLen + 1], Length(AResult) * SizeOf(Char)); @@ -411,7 +406,7 @@ begin Lexer.NextTok; - if FSkipLevel = 0 then + if State.TriState in [ttUnknown, ttDefined] then RemoveOrphanedLineBreaks; end; @@ -482,65 +477,118 @@ procedure TJppParser.ParseCondition(Token: TJppToken); var - SavedTriState: TTriState; + Condition: string; + ConditionTriState: TTriState; begin - SavedTriState := FTriState; - FTriState := State.Defines[Lexer.TokenAsString]; + Condition := Lexer.TokenAsString; + ConditionTriState := State.Defines[Condition]; + // parse the first part of the $IFDEF or $IFNDEF + State.PushState; try - if FTriState = ttUnknown then + case ConditionTriState of + ttUnknown: + begin + // preserve the $IFDEF or $IFNDEF + AddResult(Lexer.RawComment); + // assume that the symbol is defined in the $IFDEF + if Token = ptIfdef then + State.Define(Condition) + else + // assume that the symbol is not defined in the $IFNDEF + if Token = ptIfndef then + State.Undef(Condition); + end; + ttUndef: + State.TriState := ttUndef; + ttDefined: + State.TriState := ttDefined; + end; + NextToken; + ParseText; + finally + State.PopState; + end; + // part the second part of the $IFDEF or $IFNDEF if any + if Lexer.CurrTok = ptElse then + begin + State.PushState; + try + case ConditionTriState of + ttUnknown: + begin + // preserve the $ELSE + AddResult(Lexer.RawComment); + // assume that the symbol is not defined after the $IFDEF + if Token = ptIfdef then + State.Undef(Condition) + else + // assume that the symbol is defined after the $IFNDEF + if Token = ptIfndef then + State.Define(Condition); + end; + ttUndef: + State.TriState := ttDefined; + ttDefined: + State.TriState := ttUndef; + end; + NextToken; + ParseText; + finally + State.PopState; + end; + end; + (*end + else + if ((Token = ptIfdef) and (ConditionTriState = ttDefined)) + or ((Token = ptIfndef) and (ConditionTriState = ttUndef)) then begin - AddResult(Lexer.RawComment); NextToken; ParseText; if Lexer.CurrTok = ptElse then begin - AddResult(Lexer.RawComment); NextToken; - ParseText; + Skip; end; - AddResult(Lexer.RawComment); end else - if ((Token = ptIfdef) and (FTriState = ttDefined)) - or ((Token = ptIfndef) and (FTriState = ttUndef)) then + begin + NextToken; + Skip; + if Lexer.CurrTok = ptElse then begin NextToken; ParseText; - if Lexer.CurrTok = ptElse then - begin - NextToken; - Skip; - end; end else - begin - NextToken; - Skip; - if Lexer.CurrTok = ptElse then - begin - NextToken; - ParseText; - end - else - ; - end; - if Lexer.CurrTok <> ptEndif then - Lexer.Error('$ENDIF expected'); - NextToken; - finally - FTriState := SavedTriState; + ; + end;*) + if Lexer.CurrTok <> ptEndif then + Lexer.Error('$ENDIF expected'); + case ConditionTriState of + ttUnknown: + // preserve the $ENDIF + AddResult(Lexer.RawComment); + ttUndef: ; + ttDefined: ; end; + NextToken; end; procedure TJppParser.ParseDefine; +var + Condition: string; begin - case FTriState of - ttUnknown: + Condition := Lexer.TokenAsString; + case State.Defines[Condition] of + // the symbol is not defined + ttUnknown, + ttUndef: begin - State.Defines[Lexer.TokenAsString] := ttUnknown; + State.Defines[Lexer.TokenAsString] := ttDefined; AddResult(Lexer.RawComment); end; - ttDefined: State.Define(Lexer.TokenAsString); + // the symbol is already defined + ttDefined: ; end; NextToken; end; @@ -581,14 +629,20 @@ end; procedure TJppParser.ParseUndef; +var + Condition: string; begin - case FTriState of - ttUnknown: + Condition := Lexer.TokenAsString; + case State.Defines[Condition] of + // the symbol is not defined + ttUnknown, + ttDefined: begin - State.Defines[Lexer.TokenAsString] := ttUnknown; + State.Defines[Lexer.TokenAsString] := ttUndef; AddResult(Lexer.RawComment); end; - ttDefined: State.Undef(Lexer.TokenAsString); + // the symbol is already defined + ttUndef: ; end; NextToken; end; @@ -880,16 +934,6 @@ end; end; -procedure TJppParser.Skip; -begin - Inc(FSkipLevel); - try - ParseText; - finally; - Dec(FSkipLevel); - end; -end; - {$IFDEF UNITVERSIONING} initialization RegisterUnitVersion(HInstance, UnitVersioning); Modified: trunk/jcl/devtools/jpp/JppState.pas =================================================================== --- trunk/jcl/devtools/jpp/JppState.pas 2010-08-10 16:13:22 UTC (rev 3296) +++ trunk/jcl/devtools/jpp/JppState.pas 2010-08-10 19:19:19 UTC (rev 3297) @@ -1,4 +1,4 @@ -{ **************************************************************************** } +{ **************************************************************************** } { } { PppState - Pascal PreProcessor State } { Copyright (c) 2001 Barry Kelly. } @@ -85,11 +85,13 @@ FStateStack: IJclStack; FOptions: TPppOptions; procedure InternalPushState(const ExcludedFiles, SearchPath: IJclStrList; - const Macros: IJclStrIntfMap; const Defines: IJclStrMap); + const Macros: IJclStrIntfMap; const Defines: IJclStrMap; ATriState: TTriState); function InternalPeekDefines: IJclStrMap; function InternalPeekExcludedFiles: IJclStrList; function InternalPeekMacros: IJclStrIntfMap; function InternalPeekSearchPath: IJclStrList; + function InternalPeekTriState: TTriState; + procedure InternalSetTriState(Value: TTriState); protected function GetOptions: TPppOptions; procedure SetOptions(AOptions: TPppOptions); @@ -116,6 +118,8 @@ procedure PushState; procedure PopState; + property TriState: TTriState read InternalPeekTriState write InternalSetTriState; + procedure Define(const ASymbol: string); procedure Undef(const ASymbol: string); @@ -160,6 +164,7 @@ ExcludedFiles: IJclStrList; Macros: IJclStrIntfMap; SearchPath: IJclStrList; + TriState: TTriState; end; //=== { TPppState } ========================================================== @@ -168,7 +173,7 @@ begin FStateStack := TJclStack.Create(16, True); InternalPushState(TJclStrArrayList.Create(16), TJclStrArrayList.Create(16), - TJclStrIntfHashMap.Create(16), TJclStrHashMap.Create(16, False)); + TJclStrIntfHashMap.Create(16), TJclStrHashMap.Create(16, False), ttUnknown); end; destructor TPppState.Destroy; @@ -419,8 +424,15 @@ Result := (FStateStack.Peek as TSimplePppStateItem).SearchPath; end; +function TPppState.InternalPeekTriState: TTriState; +begin + if FStateStack.Empty then + raise EPppState.Create('Internal error: PPP State stack is empty'); + Result := (FStateStack.Peek as TSimplePppStateItem).TriState; +end; + procedure TPppState.InternalPushState(const ExcludedFiles, SearchPath: IJclStrList; - const Macros: IJclStrIntfMap; const Defines: IJclStrMap); + const Macros: IJclStrIntfMap; const Defines: IJclStrMap; ATriState: TTriState); var AStateItem: TSimplePppStateItem; begin @@ -429,9 +441,17 @@ AStateItem.DefinedKeywords := Defines; AStateItem.Macros := Macros; AStateItem.SearchPath := SearchPath; + AStateItem.TriState := ATriState; FStateStack.Push(AStateItem); end; +procedure TPppState.InternalSetTriState(Value: TTriState); +begin + if FStateStack.Empty then + raise EPppState.Create('Internal error: PPP State stack is empty'); + (FStateStack.Peek as TSimplePppStateItem).TriState := Value; +end; + function TPppState.IsFileExcluded(const AName: string): Boolean; var AExcludedFiles: IJclStrList; @@ -462,13 +482,15 @@ AExcludedFiles, ASearchPath: IJclStrList; ADefines: IJclStrMap; AMacros: IJclStrIntfMap; + ATriState: TTriState; begin ADefines := (InternalPeekDefines as IJclIntfCloneable).IntfClone as IJclStrMap; AExcludedFiles := (InternalPeekExcludedFiles as IJclIntfCloneable).IntfClone as IJclStrList; ASearchPath := (InternalPeekSearchPath as IJclIntfCloneable).IntfClone as IJclStrList; AMacros := (InternalPeekMacros as IJclIntfCloneable).IntfClone as IJclStrIntfMap; + ATriState := InternalPeekTriState; - InternalPushState(AExcludedFiles, ASearchPath, AMacros, ADefines); + InternalPushState(AExcludedFiles, ASearchPath, AMacros, ADefines, ATriState); end; procedure TPppState.SetOptions(AOptions: TPppOptions); Modified: trunk/jcl/source/common/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 16:13:22 UTC (rev 3296) +++ trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 19:19:19 UTC (rev 3297) @@ -1337,16 +1337,7 @@ procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} end; procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 16:13:30
|
Revision: 3296 http://jcl.svn.sourceforge.net/jcl/?rev=3296&view=rev Author: outchy Date: 2010-08-10 16:13:22 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Move the MoveArray procedures from JclBase to JclAlgorithms. Modified Paths: -------------- trunk/jcl/source/common/JclAlgorithms.pas trunk/jcl/source/common/JclArrayLists.pas trunk/jcl/source/common/JclBase.pas trunk/jcl/source/common/JclQueues.pas trunk/jcl/source/common/JclVectors.pas trunk/jcl/source/prototypes/JclAlgorithms.pas trunk/jcl/source/prototypes/JclArrayLists.pas trunk/jcl/source/prototypes/JclQueues.pas trunk/jcl/source/prototypes/JclVectors.pas Modified: trunk/jcl/source/common/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -126,6 +126,29 @@ function UnicodeStrSimpleHashConvertI(const AString: UnicodeString): Integer; {$ENDIF SUPPORTS_UNICODE_STRING} +// move array algorithms +procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF SUPPORTS_UNICODE_STRING} +{$IFNDEF FPC} +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF ~FPC} +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_EXTENDED} +procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF SUPPORTS_EXTENDED} +procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; + // Iterate algorithms procedure Iterate(const First: IJclIntfIterator; Count: Integer; F: TIntfIterateProcedure); overload; @@ -1035,7 +1058,628 @@ Result := Integer(AObject) and MaxInt; end; +procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; +procedure InitializeArray(var List: TDynIInterfaceArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynUnicodeStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; +{$ENDIF SUPPORTS_UNICODE_STRING} + +{$IFNDEF FPC} +procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; +{$ENDIF ~FPC} + +procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +{$IFDEF SUPPORTS_EXTENDED} +procedure InitializeArrayAfterMove(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; +{$ENDIF SUPPORTS_EXTENDED} + +procedure InitializeArrayAfterMove(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + + procedure Iterate(const First: IJclIntfIterator; Count: Integer; F: TIntfIterateProcedure); var I: Integer; Modified: trunk/jcl/source/common/JclArrayLists.pas =================================================================== --- trunk/jcl/source/common/JclArrayLists.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/common/JclArrayLists.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -46,9 +46,7 @@ {$IFDEF UNITVERSIONING} JclUnitVersioning, {$ENDIF UNITVERSIONING} - {$IFDEF SUPPORTS_GENERICS} JclAlgorithms, - {$ENDIF SUPPORTS_GENERICS} JclBase, JclAbstractContainers, JclContainerIntf, JclSynch; type Modified: trunk/jcl/source/common/JclBase.pas =================================================================== --- trunk/jcl/source/common/JclBase.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/common/JclBase.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -30,7 +30,7 @@ { } {**************************************************************************************************} { } -{ Last modified: $Date:: $ } +{ Last modified: $Date:: $ } { Revision: $Rev:: $ } { Author: $Author:: $ } { } @@ -264,27 +264,6 @@ procedure RaiseLastOSError; {$ENDIF ~XPLATFORM_RTL} -procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_UNICODE_STRING} -procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF SUPPORTS_UNICODE_STRING} -{$IFNDEF FPC} -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF ~FPC} -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_EXTENDED} -procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$ENDIF SUPPORTS_EXTENDED} -procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; procedure MoveChar(const Source: string; FromIndex: SizeInt; var Dest: string; ToIndex, Count: SizeInt); overload; // Index: 0..n-1 @@ -396,627 +375,6 @@ uses JclResources; -procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynIInterfaceArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -{$IFDEF SUPPORTS_UNICODE_STRING} -procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynUnicodeStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; -{$ENDIF SUPPORTS_UNICODE_STRING} - -{$IFNDEF FPC} -procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; -{$ENDIF ~FPC} - -procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - Assert(Count > 0); - if FromIndex < ToIndex then - begin - if Count > (ToIndex - FromIndex) then - Finalize(List[FromIndex + Count], ToIndex - FromIndex) - else - Finalize(List[ToIndex], Count); - end - else - if FromIndex > ToIndex then - begin - if Count > (FromIndex - ToIndex) then - Count := FromIndex - ToIndex; - Finalize(List[ToIndex], Count) - end; -end; - -procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - {$IFDEF FPC} - while Count > 0 do - begin - Initialize(List[FromIndex]); - Inc(FromIndex); - Dec(Count); - end; - {$ELSE ~FPC} - Initialize(List[FromIndex], Count); - {$ENDIF ~FPC} -end; - -procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Keep reference counting working } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - InitializeArray(List, FromIndex, Count); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) - else - InitializeArray(List, FromIndex, Count); - end; -end; - -procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -{$IFDEF SUPPORTS_EXTENDED} -procedure InitializeArrayAfterMove(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; -{$ENDIF SUPPORTS_EXTENDED} - -procedure InitializeArrayAfterMove(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - -procedure InitializeArrayAfterMove(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; -{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -begin - { Clean array } - if FromIndex < ToIndex then - begin - if (ToIndex - FromIndex) < Count then - Count := ToIndex - FromIndex; - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end - else - if FromIndex > ToIndex then - begin - if (FromIndex - ToIndex) < Count then - FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) - else - FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); - end; -end; - -procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; -begin - if Count > 0 then - begin - Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); - InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); - end; -end; - procedure MoveChar(const Source: string; FromIndex: SizeInt; var Dest: string; ToIndex, Count: SizeInt); begin Modified: trunk/jcl/source/common/JclQueues.pas =================================================================== --- trunk/jcl/source/common/JclQueues.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/common/JclQueues.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -45,9 +45,7 @@ {$IFDEF UNITVERSIONING} JclUnitVersioning, {$ENDIF UNITVERSIONING} - {$IFDEF SUPPORTS_GENERICS} JclAlgorithms, - {$ENDIF SUPPORTS_GENERICS} JclBase, JclAbstractContainers, JclContainerIntf, JclSynch; Modified: trunk/jcl/source/common/JclVectors.pas =================================================================== --- trunk/jcl/source/common/JclVectors.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/common/JclVectors.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -48,9 +48,7 @@ {$IFDEF UNITVERSIONING} JclUnitVersioning, {$ENDIF UNITVERSIONING} - {$IFDEF SUPPORTS_GENERICS} JclAlgorithms, - {$ENDIF SUPPORTS_GENERICS} Classes, JclBase, JclAbstractContainers, JclContainerIntf, JclSynch; Modified: trunk/jcl/source/prototypes/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 16:01:28 UTC (rev 3295) +++ trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 16:13:22 UTC (rev 3296) @@ -78,6 +78,29 @@ function UnicodeStrSimpleHashConvertI(const AString: UnicodeString): Integer; {$ENDIF SUPPORTS_UNICODE_STRING} +// move array algorithms +procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF SUPPORTS_UNICODE_STRING} +{$IFNDEF FPC} +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF ~FPC} +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_EXTENDED} +procedure MoveArray(var List: TDynExtendedArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$ENDIF SUPPORTS_EXTENDED} +procedure MoveArray(var List: TDynIntegerArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynCardinalArray; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynInt64Array; FromIndex, ToIndex, Count: SizeInt); overload; +procedure MoveArray(var List: TDynSizeIntArray; FromIndex, ToIndex, Count: SizeInt); overload; + // Iterate algorithms (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT {$JPPEXPANDMACRO ITERATEINT(Iterate,,, overload;)}*) @@ -766,6 +789,627 @@ Result := Integer(AObject) and MaxInt; end; +procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynIInterfaceArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynFloatArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynPointerArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynUnicodeStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; +{$ENDIF SUPPORTS_UNICODE_STRING} + +{$IFNDEF FPC} +procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynAnsiStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; +{$ENDIF ~FPC} + +procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + Assert(Count > 0); + if FromIndex < ToIndex then + begin + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) + end; +end; + +procedure InitializeArray(var List: TDynWideStringArray; FromIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + {$IFDEF FPC} + while Count > 0 do + begin + Initialize(List[FromIndex]); + Inc(FromIndex); + Dec(Count); + end; + {$ELSE ~FPC} + Initialize(List[FromIndex], Count); + {$ENDIF ~FPC} +end; + +procedure InitializeArrayAfterMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Keep reference counting working } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + InitializeArray(List, FromIndex, Count); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + InitializeArray(List, ToIndex + Count, FromIndex - ToIndex) + else + InitializeArray(List, FromIndex, Count); + end; +end; + +procedure MoveArray(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + FinalizeArrayBeforeMove(List, FromIndex, ToIndex, Count); + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynObjectArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillChar(List[ToIndex + Count], (FromIndex - ToIndex) * SizeOf(List[0]), 0) + else + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end; +end; + +procedure MoveArray(var List: TDynSingleArray; FromIndex, ToIndex, Count: SizeInt); overload; +begin + if Count > 0 then + begin + Move(List[FromIndex], List[ToIndex], Count * SizeOf(List[0])); + InitializeArrayAfterMove(List, FromIndex, ToIndex, Count); + end; +end; + +procedure InitializeArrayAfterMove(var List: TDynDoubleArray; FromIndex, ToIndex, Count: SizeInt); overload; +{$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} +begin + { Clean array } + if FromIndex < ToIndex then + begin + if (ToIndex - FromIndex) < Count then + Count := ToIndex - FromIndex; + FillChar(List[FromIndex], Count * SizeOf(List[0]), 0); + end + else + if FromIndex > ToIndex then + begin + if (FromIndex - ToIndex) < Count then + FillCh... [truncated message content] |
From: <ou...@us...> - 2010-08-10 16:01:35
|
Revision: 3295 http://jcl.svn.sourceforge.net/jcl/?rev=3295&view=rev Author: outchy Date: 2010-08-10 16:01:28 +0000 (Tue, 10 Aug 2010) Log Message: ----------- New code in JclContainerIntf and JclAlgorithms to iterate some iterator items. New example to test the MoveArray procedures. Modified Paths: -------------- trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas trunk/jcl/devtools/jpp/Templates/JclContainerIntfTemplates.pas trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas trunk/jcl/source/common/JclAlgorithms.pas trunk/jcl/source/common/JclContainerIntf.pas trunk/jcl/source/prototypes/JclAlgorithms.pas trunk/jcl/source/prototypes/JclContainerIntf.pas trunk/jcl/source/prototypes/containers/JclAlgorithms.imp trunk/jcl/source/prototypes/containers/JclAlgorithms.int trunk/jcl/source/prototypes/containers/JclContainerIntf.int Added Paths: ----------- trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dof trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr Modified: trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/devtools/jpp/Templates/JclAlgorithmsTemplates.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -66,6 +66,25 @@ property ProcName: string read GetProcName write SetProcName stored False; end; + (* ITERATEINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) *) + TJclIterateIntParams = class(TJclAlgorithmsIntProcParams) + protected + function GetProcName: string; override; + published + property Overload; + property ProcName; + property ItrInterfaceName: string index taIteratorInterfaceName read GetTypeAttribute write SetTypeAttribute stored False; + property CallbackType: string index taIterateProcedureName read GetTypeAttribute write SetTypeAttribute stored False; + end; + + (* ITERATEIMP(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE) *) + TJclIterateImpParams = class(TJclAlgorithmsImpProcParams) + published + property ProcName; + property ItrInterfaceName: string index taIteratorInterfaceName read GetTypeAttribute write SetTypeAttribute stored False; + property CallbackType: string index taIterateProcedureName read GetTypeAttribute write SetTypeAttribute stored False; + end; + (* APPLYINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) *) TJclApplyIntParams = class(TJclAlgorithmsIntProcParams) protected @@ -341,6 +360,7 @@ procedure RegisterJclContainers; begin + RegisterContainerParams('ITERATEINT', TJclIterateIntParams); RegisterContainerParams('APPLYINT', TJclApplyIntParams); RegisterContainerParams('SIMPLECOMPAREINT', TJclSimpleCompareIntParams); RegisterContainerParams('SIMPLEEQUALITYCOMPAREINT', TJclSimpleEqualityCompareIntParams); @@ -355,6 +375,7 @@ RegisterContainerParams('REVERSEINT', TJclReverseIntParams); RegisterContainerParams('SORTINT', TJclSortIntParams); + RegisterContainerParams('ITERATEIMP', TJclIterateImpParams, TJclIterateIntParams); RegisterContainerParams('APPLYIMP', TJclApplyImpParams, TJclApplyIntParams); RegisterContainerParams('FINDIMP', TJclFindImpParams, TJclFindIntParams); RegisterContainerParams('FINDEQIMP', TJclFindEqImpParams, TJclFindEqIntParams); @@ -392,6 +413,15 @@ (InterfaceParams as TJclAlgorithmsIntProcParams).ProcName := Value; end; +//=== { TJclIterateIntParams } =============================================== + +function TJclIterateIntParams.GetProcName: string; +begin + Result := inherited GetProcName; + if Result = '' then + Result := 'Iterate'; +end; + //=== { TJclApplyIntParams } ================================================= function TJclApplyIntParams.GetProcName: string; Modified: trunk/jcl/devtools/jpp/Templates/JclContainerIntfTemplates.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerIntfTemplates.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/devtools/jpp/Templates/JclContainerIntfTemplates.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -66,6 +66,17 @@ function GetAncestorName: string; override; end; + (* ITERPROCEDURE(PROCNAME, CONSTKEYWORD, PARAMETERNAME, TYPENAME) *) + TJclIterProcedureParams = class(TJclContainerIntf1DParams) + public + function AliasAttributeIDs: TAllTypeAttributeIDs; override; + published + property ProcName: string index taIterateProcedureName read GetTypeAttribute write SetTypeAttribute stored IsTypeAttributeStored; + property ConstKeyword: string index taConstKeyword read GetTypeAttribute write SetTypeAttribute stored False; + property ParameterName: string index taParameterName read GetTypeAttribute write SetTypeAttribute stored False; + property TypeName: string index taTypeName read GetTypeAttribute write SetTypeAttribute stored False; + end; + (* APPLYFUNCTION(FUNCNAME, CONSTKEYWORD, PARAMETERNAME, TYPENAME) *) TJclApplyFunctionParams = class(TJclContainerIntf1DParams) public @@ -350,7 +361,8 @@ procedure RegisterJclContainers; begin - RegisterContainerParams('APPLYFUNCTION', TJclApplyFunctionParams); + RegisterContainerParams('ITERPROCEDURE', TJclIterProcedureParams); + RegisterContainerParams('APPLYFUNCTION', TJclApplyFunctionParams); RegisterContainerParams('COMPAREFUNCTION', TJclCompareFunctionParams); RegisterContainerParams('EQUALITYCOMPAREFUNCTION', TJclEqualityCompareFunctionParams); RegisterContainerParams('HASHFUNCTION', TJclHashFunctionParams); @@ -416,6 +428,13 @@ Result := 'IJclContainer'; end; +//=== { TJclIterProcedureParams } ============================================ + +function TJclIterProcedureParams.AliasAttributeIDs: TAllTypeAttributeIDs; +begin + Result := [taIterateProcedureName]; +end; + //=== { TJclApplyFunctionParams } ============================================ function TJclApplyFunctionParams.AliasAttributeIDs: TAllTypeAttributeIDs; Modified: trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/devtools/jpp/Templates/JclContainerKnownTypes.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -55,6 +55,7 @@ {taArrayName} 'Objects', {taBaseContainer} 'TJclIntfAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TIntfIterateProcedure', {taApplyFunctionName} 'TIntfApplyFunction', {taCompareFunctionName} 'TIntfCompare', {taSimpleCompareFunctionName} 'IntfSimpleCompare', @@ -134,6 +135,7 @@ {taArrayName} 'Strings', {taBaseContainer} 'TJclAnsiStrAbstractContainer', {taBaseCollection} 'TJclAnsiStrAbstractCollection', + {taIterateProcedureName} 'TAnsiStrIterateProcedure', {taApplyFunctionName} 'TAnsiStrApplyFunction', {taCompareFunctionName} 'TAnsiStrCompare', {taSimpleCompareFunctionName} 'AnsiStrSimpleCompare', @@ -213,6 +215,7 @@ {taArrayName} 'Strings', {taBaseContainer} 'TJclWideStrAbstractContainer', {taBaseCollection} 'TJclWideStrAbstractCollection', + {taIterateProcedureName} 'TWideStrIterateProcedure', {taApplyFunctionName} 'TWideStrApplyFunction', {taCompareFunctionName} 'TWideStrCompare', {taSimpleCompareFunctionName} 'WideStrSimpleCompare', @@ -292,6 +295,7 @@ {taArrayName} 'Strings', {taBaseContainer} 'TJclUnicodeStrAbstractContainer', {taBaseCollection} 'TJclUnicodeStrAbstractCollection', + {taIterateProcedureName} 'TUnicodeStrIterateProcedure', {taApplyFunctionName} 'TUnicodeStrApplyFunction', {taCompareFunctionName} 'TUnicodeStrCompare', {taSimpleCompareFunctionName} 'UnicodeStrSimpleCompare', @@ -371,6 +375,7 @@ {taArrayName} 'Strings', {taBaseContainer} '', {taBaseCollection} '', + {taIterateProcedureName} 'TStrIterateProcedure', {taApplyFunctionName} 'TStrApplyFunction', {taCompareFunctionName} 'TStrCompare', {taSimpleCompareFunctionName} 'StrSimpleCompare', @@ -450,6 +455,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclSingleAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TSingleIterateProcedure', {taApplyFunctionName} 'TSingleApplyFunction', {taCompareFunctionName} 'TSingleCompare', {taSimpleCompareFunctionName} 'SingleSimpleCompare', @@ -529,6 +535,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclDoubleAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TDoubleIterateProcedure', {taApplyFunctionName} 'TDoubleApplyFunction', {taCompareFunctionName} 'TDoubleCompare', {taSimpleCompareFunctionName} 'DoubleSimpleCompare', @@ -608,6 +615,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclExtendedAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TExtendedIterateProcedure', {taApplyFunctionName} 'TExtendedApplyFunction', {taCompareFunctionName} 'TExtendedCompare', {taSimpleCompareFunctionName} 'ExtendedSimpleCompare', @@ -687,6 +695,7 @@ {taArrayName} 'Values', {taBaseContainer} '', {taBaseCollection} '', + {taIterateProcedureName} 'TFloatIterateProcedure', {taApplyFunctionName} 'TFloatApplyFunction', {taCompareFunctionName} 'TFloatCompare', {taSimpleCompareFunctionName} 'FloatSimpleCompare', @@ -766,6 +775,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclIntegerAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TIntegerIterateProcedure', {taApplyFunctionName} 'TIntegerApplyFunction', {taCompareFunctionName} 'TIntegerCompare', {taSimpleCompareFunctionName} 'IntegerSimpleCompare', @@ -845,6 +855,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclCardinalAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TCardinalIterateProcedure', {taApplyFunctionName} 'TCardinalApplyFunction', {taCompareFunctionName} 'TCardinalCompare', {taSimpleCompareFunctionName} 'CardinalSimpleCompare', @@ -924,6 +935,7 @@ {taArrayName} 'Values', {taBaseContainer} 'TJclInt64AbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TInt64IterateProcedure', {taApplyFunctionName} 'TInt64ApplyFunction', {taCompareFunctionName} 'TInt64Compare', {taSimpleCompareFunctionName} 'Int64SimpleCompare', @@ -1003,6 +1015,7 @@ {taArrayName} 'Pointers', {taBaseContainer} 'TJclPtrAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TPtrIterateProcedure', {taApplyFunctionName} 'TPtrApplyFunction', {taCompareFunctionName} 'TPtrCompare', {taSimpleCompareFunctionName} 'PtrSimpleCompare', @@ -1082,6 +1095,7 @@ {taArrayName} 'Objects', {taBaseContainer} 'TJclAbstractContainer', {taBaseCollection} '', + {taIterateProcedureName} 'TIterateProcedure', {taApplyFunctionName} 'TApplyFunction', {taCompareFunctionName} 'TCompare', {taSimpleCompareFunctionName} 'SimpleCompare', Modified: trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas =================================================================== --- trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/devtools/jpp/Templates/JclContainerTypes.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -20,7 +20,7 @@ { } {**************************************************************************************************} { } -{ Last modified: $Date:: $ } +{ Last modified: $Date:: $ } { Revision: $Rev:: $ } { Author: $Author:: $ } { } @@ -59,6 +59,7 @@ taArrayName, taBaseContainer, taBaseCollection, + taIterateProcedureName, taApplyFunctionName, taCompareFunctionName, taSimpleCompareFunctionName, @@ -199,6 +200,7 @@ {ArrayName} (IsGUID: False; DefaultValue: '%ss'), {BaseContainer} (IsGUID: False; DefaultValue: ''), {BaseCollection} (IsGUID: False; DefaultValue: ''), + {IterateProcedureName} (IsGUID: False; DefaultValue: 'T%sIterateFunction'), {ApplyFunctionName} (IsGUID: False; DefaultValue: 'T%sApplyFunction'), {CompareFunctionName} (IsGUID: False; DefaultValue: 'T%sCompareFunction'), {SimpleCompareFunctionName} (IsGUID: False; DefaultValue: '%sSimpleCompare'), Copied: trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dof (from rev 3293, trunk/jcl/examples/common/containers/algorithms/AlgorithmsExample.dof) =================================================================== --- trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dof (rev 0) +++ trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dof 2010-08-10 16:01:28 UTC (rev 3295) @@ -0,0 +1,2 @@ +[Directories] +OutputDir=..\..\..\..\bin Added: trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr =================================================================== --- trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr (rev 0) +++ trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr 2010-08-10 16:01:28 UTC (rev 3295) @@ -0,0 +1,403 @@ +program TestMoveArray; + +{$APPTYPE CONSOLE} + +uses + SysUtils, + JclBase, + JclAlgorithms; + +type + IRefCountInterface = interface + ['{9A7FEBD5-B31C-466D-9D72-7C80801FC232}'] + function GetRefCount: Integer; + function GetChar: Char; + procedure SetChar(C: Char); + end; + + TRefCountObject = class(TInterfacedObject, IInterface, IRefCountInterface) + var + FChar: Char; + public + function GetRefCount: Integer; + function GetChar: Char; + procedure SetChar(C: Char); + end; + +function TRefCountObject.GetChar: Char; +begin + Result := FChar; +end; + +function TRefCountObject.GetRefCount: Integer; +begin + Result := RefCount; +end; + +procedure TRefCountObject.SetChar(C: Char); +begin + FChar := C; +end; + +procedure PrintArray(const TestArray: TDynIInterfaceArray); +var + I: Integer; + AInterface: IInterface; + ARefCountInterface: IRefCountInterface; +begin + for I := Low(TestArray) to High(TestArray) do + begin + AInterface := TestArray[I]; + if AInterface = nil then + Write('-') + else + if not Supports(AInterface, IRefCountInterface, ARefCountInterface) then + raise Exception.Create('interface error') + else + Write(ARefCountInterface.GetChar); + end; +end; + +procedure AssertEqual(const TestInterface, RefInterface: IInterface); +begin + if TestInterface <> RefInterface then + raise Exception.Create('equality error'); +end; + +procedure AssertRefCount(const AInterface: IInterface; RefCount: Integer); +var + ARefCountInterface: IRefCountInterface; +begin + if not Supports(AInterface, IRefCountInterface, ARefCountInterface) then + raise Exception.Create('interface error') + else + // 1 additional ref-count because of ARefCountInterface + if ARefCountInterface.GetRefCount <> (RefCount + 1) then + raise Exception.CreateFmt('ref count error, exp %d, act %d', [RefCount, ARefCountInterface.GetRefCount - 1]); +end; + +procedure CreateTestArray(var TestArray, RefArray: TDynIInterfaceArray); +var + Item: IRefCountInterface; + I: Integer; +begin + // erase previous content + SetLength(TestArray, 0); + SetLength(TestArray, 26); + SetLength(RefArray, 0); + SetLength(RefArray, 26); + for I := Low(TestArray) to High(TestArray) do + begin + Item := TRefCountObject.Create; + Item.SetChar(Chr(Ord('A') + I)); + TestArray[I] := Item; + RefArray[I] := Item; + end; + Item := nil; + for I := Low(RefArray) to High(TestArray) do + AssertRefCount(RefArray[I], 2); +end; + +// case 1: (FromIndex < ToIndex) and (Count <= (ToIndex - FromIndex)) +procedure Test1; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test1, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test1, execute "MoveArray(TestArray, 5, 15, 5);"'); + + MoveArray(TestArray, 5, 15, 5); + + Write('Test1, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 4 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 5 to 9 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 10 to 14 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 15 to 19 do // overriden + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I-10]); + end; + for I := 20 to 25 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +// case 2: (FromIndex < ToIndex) and (Count <= (ToIndex - FromIndex)) +procedure Test2; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test2, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test2, execute "MoveArray(TestArray, 10, 15, 5);"'); + + MoveArray(TestArray, 10, 15, 5); + + Write('Test2, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 9 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 10 to 14 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 15 to 19 do // overriden + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I-5]); + end; + for I := 20 to 25 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +// case 3: (FromIndex < ToIndex) and (Count > (ToIndex - FromIndex)) +procedure Test3; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test3, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test3, execute "MoveArray(TestArray, 5, 10, 10);"'); + + MoveArray(TestArray, 5, 10, 10); + + Write('Test3, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 4 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 5 to 9 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 10 to 14 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I-5]); + end; + for I := 15 to 19 do // override + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I-5]); + end; + for I := 20 to 25 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +// case 4: (FromIndex > ToIndex) and (Count <= (FromIndex - ToIndex)) +procedure Test4; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test4, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test4, execute "MoveArray(TestArray, 15, 5, 5);"'); + + MoveArray(TestArray, 15, 5, 5); + + Write('Test4, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 4 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 5 to 9 do // overriden + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I+10]); + end; + for I := 10 to 14 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 15 to 19 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 20 to 25 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +// case 5: (FromIndex > ToIndex) and (Count <= (FromIndex - ToIndex)) +procedure Test5; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test5, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test5, execute "MoveArray(TestArray, 15, 10, 5);"'); + + MoveArray(TestArray, 15, 10, 5); + + Write('Test5, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 9 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 10 to 14 do // overriden + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I+5]); + end; + for I := 15 to 19 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 20 to 25 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +// case 6: (FromIndex > ToIndex) and (Count > (FromIndex - ToIndex)) +procedure Test6; +var + TestArray, RefArray: TDynIInterfaceArray; + I: Integer; +begin + CreateTestArray(TestArray, RefArray); + + Write('Test6, array is: '); + PrintArray(TestArray); + WriteLn; + WriteLn('Test6, execute "MoveArray(TestArray, 10, 5, 10);"'); + + MoveArray(TestArray, 10, 5, 10); + + Write('Test6, array is: '); + PrintArray(TestArray); + WriteLn; + + // [ From ] + // [ To ] + for I := 0 to 4 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; + for I := 5 to 9 do // overriden + begin + AssertRefCount(RefArray[I], 1); + AssertEqual(TestArray[I], RefArray[I+5]); + end; + for I := 10 to 14 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I+5]); + end; + for I := 15 to 19 do // were moved + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], nil); + end; + for I := 20 to 24 do // untouched + begin + AssertRefCount(RefArray[I], 2); + AssertEqual(TestArray[I], RefArray[I]); + end; +end; + +begin + try + Test1; + WriteLn; + WriteLn; + Test2; + WriteLn; + WriteLn; + Test3; + WriteLn; + WriteLn; + Test4; + WriteLn; + WriteLn; + Test5; + WriteLn; + WriteLn; + Test6; + ReadLn; + except + on E:Exception do + Writeln(E.Classname, ': ', E.Message); + end; +end. + Property changes on: trunk/jcl/examples/common/containers/algorithms/TestMoveArray.dpr ___________________________________________________________________ Added: svn:keywords + URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id Added: svn:eol-style + native Modified: trunk/jcl/source/common/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/common/JclAlgorithms.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -126,6 +126,23 @@ function UnicodeStrSimpleHashConvertI(const AString: UnicodeString): Integer; {$ENDIF SUPPORTS_UNICODE_STRING} +// Iterate algorithms + +procedure Iterate(const First: IJclIntfIterator; Count: Integer; F: TIntfIterateProcedure); overload; +procedure Iterate(const First: IJclAnsiStrIterator; Count: Integer; F: TAnsiStrIterateProcedure); overload; +procedure Iterate(const First: IJclWideStrIterator; Count: Integer; F: TWideStrIterateProcedure); overload; +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure Iterate(const First: IJclUnicodeStrIterator; Count: Integer; F: TUnicodeStrIterateProcedure); overload; +{$ENDIF SUPPORTS_UNICODE_STRING} +procedure Iterate(const First: IJclSingleIterator; Count: Integer; F: TSingleIterateProcedure); overload; +procedure Iterate(const First: IJclDoubleIterator; Count: Integer; F: TDoubleIterateProcedure); overload; +procedure Iterate(const First: IJclExtendedIterator; Count: Integer; F: TExtendedIterateProcedure); overload; +procedure Iterate(const First: IJclIntegerIterator; Count: Integer; F: TIntegerIterateProcedure); overload; +procedure Iterate(const First: IJclCardinalIterator; Count: Integer; F: TCardinalIterateProcedure); overload; +procedure Iterate(const First: IJclInt64Iterator; Count: Integer; F: TInt64IterateProcedure); overload; +procedure Iterate(const First: IJclPtrIterator; Count: Integer; F: TPtrIterateProcedure); overload; +procedure Iterate(const First: IJclIterator; Count: Integer; F: TIterateProcedure); overload; + // Apply algorithms procedure Apply(const First: IJclIntfIterator; Count: Integer; F: TIntfApplyFunction); overload; @@ -389,6 +406,7 @@ private //FSortProc: TSortProc; public + class procedure Iterate(const First: IJclIterator<T>; Count: Integer; F: TIterateProcedure<T>); class procedure Apply(const First: IJclIterator<T>; Count: Integer; F: TApplyFunction<T>); class function Find(const First: IJclIterator<T>; Count: Integer; const AItem: T; AComparator: TCompare<T>): IJclIterator<T>; overload; @@ -1018,6 +1036,141 @@ end; +procedure Iterate(const First: IJclIntfIterator; Count: Integer; F: TIntfIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclAnsiStrIterator; Count: Integer; F: TAnsiStrIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclWideStrIterator; Count: Integer; F: TWideStrIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +{$IFDEF SUPPORTS_UNICODE_STRING} +procedure Iterate(const First: IJclUnicodeStrIterator; Count: Integer; F: TUnicodeStrIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; +{$ENDIF SUPPORTS_UNICODE_STRING} + +procedure Iterate(const First: IJclSingleIterator; Count: Integer; F: TSingleIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclDoubleIterator; Count: Integer; F: TDoubleIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclExtendedIterator; Count: Integer; F: TExtendedIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclIntegerIterator; Count: Integer; F: TIntegerIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclCardinalIterator; Count: Integer; F: TCardinalIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclInt64Iterator; Count: Integer; F: TInt64IterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclPtrIterator; Count: Integer; F: TPtrIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + +procedure Iterate(const First: IJclIterator; Count: Integer; F: TIterateProcedure); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + + procedure Apply(const First: IJclIntfIterator; Count: Integer; F: TIntfApplyFunction); var I: Integer; @@ -3125,6 +3278,17 @@ end; {$IFDEF SUPPORTS_GENERICS} +class procedure TJclAlgorithms<T>.Iterate(const First: IJclIterator<T>; Count: Integer; F: TIterateProcedure<T>); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end; + class procedure TJclAlgorithms<T>.Apply(const First: IJclIterator<T>; Count: Integer; F: TApplyFunction<T>); var I: Integer; Modified: trunk/jcl/source/common/JclContainerIntf.pas =================================================================== --- trunk/jcl/source/common/JclContainerIntf.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/common/JclContainerIntf.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -68,6 +68,44 @@ type // function pointer types + // iterate functions Type -> (void) + + TIntfIterateProcedure = procedure(const AInterface: IInterface); + TAnsiStrIterateProcedure = procedure(const AString: AnsiString); + TWideStrIterateProcedure = procedure(const AString: WideString); + {$IFDEF SUPPORTS_UNICODE_STRING} + TUnicodeStrIterateProcedure = procedure(const AString: UnicodeString); + {$ENDIF SUPPORTS_UNICODE_STRING} + {$IFDEF CONTAINER_ANSISTR} + TStrIterateProcedure = TAnsiStrIterateProcedure; + {$ENDIF CONTAINER_ANSISTR} + {$IFDEF CONTAINER_WIDESTR} + TStrIterateProcedure = TWideStrIterateProcedure; + {$ENDIF CONTAINER_WIDESTR} + {$IFDEF CONTAINER_UNICODESTR} + TStrIterateProcedure = TUnicodeStrIterateProcedure; + {$ENDIF CONTAINER_UNICODESTR} + TSingleIterateProcedure = procedure(const AValue: Single); + TDoubleIterateProcedure = procedure(const AValue: Double); + TExtendedIterateProcedure = procedure(const AValue: Extended); + {$IFDEF MATH_SINGLE_PRECISION} + TFloatIterateProcedure = TSingleIterateProcedure; + {$ENDIF MATH_SINGLE_PRECISION} + {$IFDEF MATH_DOUBLE_PRECISION} + TFloatIterateProcedure = TDoubleIterateProcedure; + {$ENDIF MATH_DOUBLE_PRECISION} + {$IFDEF MATH_EXTENDED_PRECISION} + TFloatIterateProcedure = TExtendedIterateProcedure; + {$ENDIF MATH_EXTENDED_PRECISION} + TIntegerIterateProcedure = procedure(AValue: Integer); + TCardinalIterateProcedure = procedure(AValue: Cardinal); + TInt64IterateProcedure = procedure(const AValue: Int64); + TPtrIterateProcedure = procedure(APtr: Pointer); + TIterateProcedure = procedure(AObject: TObject); + {$IFDEF SUPPORTS_GENERICS} + TIterateProcedure<T> = procedure(const AItem: T); + {$ENDIF SUPPORTS_GENERICS} + // apply functions Type -> Type TIntfApplyFunction = function(const AInterface: IInterface): IInterface; Modified: trunk/jcl/source/prototypes/JclAlgorithms.pas =================================================================== --- trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/prototypes/JclAlgorithms.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -78,6 +78,10 @@ function UnicodeStrSimpleHashConvertI(const AString: UnicodeString): Integer; {$ENDIF SUPPORTS_UNICODE_STRING} +// Iterate algorithms +(*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT +{$JPPEXPANDMACRO ITERATEINT(Iterate,,, overload;)}*) + // Apply algorithms (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT {$JPPEXPANDMACRO APPLYINT(Apply,,, overload;)}*) @@ -138,6 +142,7 @@ private //FSortProc: TSortProc; public + class {$JPPEXPANDMACRO ITERATEINT(Iterate,IJclIterator<T>,TIterateProcedure<T>,)} class {$JPPEXPANDMACRO APPLYINT(Apply,IJclIterator<T>,TApplyFunction<T>,)} class {$JPPEXPANDMACRO FINDINT(Find,IJclIterator<T>,const ,AItem,T,TCompare<T>, overload;)} class {$JPPEXPANDMACRO FINDEQINT(Find,IJclIterator<T>,const ,AItem,T,TEqualityCompare<T>, overload;)} @@ -762,6 +767,9 @@ end; (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT +{$JPPEXPANDMACRO ITERATEIMP(Iterate,,)} +*) +(*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT {$JPPEXPANDMACRO APPLYIMP(Apply,,,)} *) (*$JPPLOOP TRUETYPEINDEX TRUETYPECOUNT @@ -853,6 +861,8 @@ end; {$IFDEF SUPPORTS_GENERICS} +class {$JPPEXPANDMACRO ITERATEIMP(TJclAlgorithms<T>.Iterate,IJclIterator<T>,TIterateProcedure<T>)} + class {$JPPEXPANDMACRO APPLYIMP(TJclAlgorithms<T>.Apply,IJclIterator<T>,TApplyFunction<T>,SetItem)} class {$JPPEXPANDMACRO FINDIMP(TJclAlgorithms<T>.Find,IJclIterator<T>,const ,AItem,T,TCompare<T>)} Modified: trunk/jcl/source/prototypes/JclContainerIntf.pas =================================================================== --- trunk/jcl/source/prototypes/JclContainerIntf.pas 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/prototypes/JclContainerIntf.pas 2010-08-10 16:01:28 UTC (rev 3295) @@ -64,6 +64,13 @@ type // function pointer types + // iterate functions Type -> (void) +(*$JPPLOOP ALLTYPEINDEX ALLTYPECOUNT + {$JPPEXPANDMACRO ITERPROCEDURE(,,,)}*) + {$IFDEF SUPPORTS_GENERICS} + {$JPPEXPANDMACRO ITERPROCEDURE(TIterateProcedure<T>,const ,AItem,T)} + {$ENDIF SUPPORTS_GENERICS} + // apply functions Type -> Type (*$JPPLOOP ALLTYPEINDEX ALLTYPECOUNT {$JPPEXPANDMACRO APPLYFUNCTION(,,,)}*) Modified: trunk/jcl/source/prototypes/containers/JclAlgorithms.imp =================================================================== --- trunk/jcl/source/prototypes/containers/JclAlgorithms.imp 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/prototypes/containers/JclAlgorithms.imp 2010-08-10 16:01:28 UTC (rev 3295) @@ -1,3 +1,14 @@ +(*$JPPDEFINEMACRO ITERATEIMP(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE) +procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE); +var + I: Integer; +begin + for I := Count - 1 downto 0 do + if First.HasNext then + F(First.Next) + else + Break; +end;*) (*$JPPDEFINEMACRO APPLYIMP(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, SETTERNAME) procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE); var Modified: trunk/jcl/source/prototypes/containers/JclAlgorithms.int =================================================================== --- trunk/jcl/source/prototypes/containers/JclAlgorithms.int 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/prototypes/containers/JclAlgorithms.int 2010-08-10 16:01:28 UTC (rev 3295) @@ -1,3 +1,5 @@ +(*$JPPDEFINEMACRO ITERATEINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) +procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE);OVERLOAD*) (*$JPPDEFINEMACRO APPLYINT(PROCNAME, ITRINTERFACENAME, CALLBACKTYPE, OVERLOAD) procedure PROCNAME(const First: ITRINTERFACENAME; Count: Integer; F: CALLBACKTYPE);OVERLOAD*) (*$JPPDEFINEMACRO SIMPLECOMPAREINT(PROCNAME, CONSTKEYWORD, TYPENAME) Modified: trunk/jcl/source/prototypes/containers/JclContainerIntf.int =================================================================== --- trunk/jcl/source/prototypes/containers/JclContainerIntf.int 2010-08-10 14:19:55 UTC (rev 3294) +++ trunk/jcl/source/prototypes/containers/JclContainerIntf.int 2010-08-10 16:01:28 UTC (rev 3295) @@ -1,3 +1,5 @@ +(*$JPPDEFINEMACRO ITERPROCEDURE(PROCNAME, CONSTKEYWORD, PARAMETERNAME, TYPENAME) +PROCNAME = procedure(CONSTKEYWORDPARAMETERNAME: TYPENAME);*) (*$JPPDEFINEMACRO APPLYFUNCTION(FUNCNAME, CONSTKEYWORD, PARAMETERNAME, TYPENAME) FUNCNAME = function(CONSTKEYWORDPARAMETERNAME: TYPENAME): TYPENAME;*) (*$JPPDEFINEMACRO COMPAREFUNCTION(FUNCNAME, CONSTKEYWORD, TYPENAME) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 14:20:02
|
Revision: 3294 http://jcl.svn.sourceforge.net/jcl/?rev=3294&view=rev Author: outchy Date: 2010-08-10 14:19:55 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Regenerated with new known map order (was reordered in revision 3291). Revision Links: -------------- http://jcl.svn.sourceforge.net/jcl/?rev=3291&view=rev Modified Paths: -------------- trunk/jcl/source/common/JclContainerIntf.pas Modified: trunk/jcl/source/common/JclContainerIntf.pas =================================================================== --- trunk/jcl/source/common/JclContainerIntf.pas 2010-08-10 13:59:22 UTC (rev 3293) +++ trunk/jcl/source/common/JclContainerIntf.pas 2010-08-10 14:19:55 UTC (rev 3294) @@ -2514,6 +2514,46 @@ {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} end; + IJclIntfAnsiStrMap = interface(IJclAnsiStrContainer) + ['{B10E324A-1D98-42FF-B9B4-7F99044591B2}'] + procedure Clear; + function ContainsKey(const Key: IInterface): Boolean; + function ContainsValue(const Value: AnsiString): Boolean; + function Extract(const Key: IInterface): AnsiString; + function GetValue(const Key: IInterface): AnsiString; + function IsEmpty: Boolean; + function KeyOfValue(const Value: AnsiString): IInterface; + function KeySet: IJclIntfSet; + function MapEquals(const AMap: IJclIntfAnsiStrMap): Boolean; + procedure PutAll(const AMap: IJclIntfAnsiStrMap); + procedure PutValue(const Key: IInterface; const Value: AnsiString); + function Remove(const Key: IInterface): AnsiString; + function Size: Integer; + function Values: IJclAnsiStrCollection; + property Items[const Key: IInterface]: AnsiString read GetValue write PutValue; + {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} + end; + + IJclAnsiStrAnsiStrMap = interface(IJclAnsiStrContainer) + ['{A4788A96-281A-4924-AA24-03776DDAAD8A}'] + procedure Clear; + function ContainsKey(const Key: AnsiString): Boolean; + function ContainsValue(const Value: AnsiString): Boolean; + function Extract(const Key: AnsiString): AnsiString; + function GetValue(const Key: AnsiString): AnsiString; + function IsEmpty: Boolean; + function KeyOfValue(const Value: AnsiString): AnsiString; + function KeySet: IJclAnsiStrSet; + function MapEquals(const AMap: IJclAnsiStrAnsiStrMap): Boolean; + procedure PutAll(const AMap: IJclAnsiStrAnsiStrMap); + procedure PutValue(const Key: AnsiString; const Value: AnsiString); + function Remove(const Key: AnsiString): AnsiString; + function Size: Integer; + function Values: IJclAnsiStrCollection; + property Items[const Key: AnsiString]: AnsiString read GetValue write PutValue; + {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} + end; + IJclWideStrIntfMap = interface(IJclWideStrContainer) ['{C959AB76-9CF0-4C2C-A2C6-8A1846563FAF}'] procedure Clear; @@ -2534,6 +2574,46 @@ {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} end; + IJclIntfWideStrMap = interface(IJclWideStrContainer) + ['{D9FD7887-B840-4636-8A8F-E586663E332C}'] + procedure Clear; + function ContainsKey(const Key: IInterface): Boolean; + function ContainsValue(const Value: WideString): Boolean; + function Extract(const Key: IInterface): WideString; + function GetValue(const Key: IInterface): WideString; + function IsEmpty: Boolean; + function KeyOfValue(const Value: WideString): IInterface; + function KeySet: IJclIntfSet; + function MapEquals(const AMap: IJclIntfWideStrMap): Boolean; + procedure PutAll(const AMap: IJclIntfWideStrMap); + procedure PutValue(const Key: IInterface; const Value: WideString); + function Remove(const Key: IInterface): WideString; + function Size: Integer; + function Values: IJclWideStrCollection; + property Items[const Key: IInterface]: WideString read GetValue write PutValue; + {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} + end; + + IJclWideStrWideStrMap = interface(IJclWideStrContainer) + ['{8E8D2735-C4FB-4F00-8802-B2102BCE3644}'] + procedure Clear; + function ContainsKey(const Key: WideString): Boolean; + function ContainsValue(const Value: WideString): Boolean; + function Extract(const Key: WideString): WideString; + function GetValue(const Key: WideString): WideString; + function IsEmpty: Boolean; + function KeyOfValue(const Value: WideString): WideString; + function KeySet: IJclWideStrSet; + function MapEquals(const AMap: IJclWideStrWideStrMap): Boolean; + procedure PutAll(const AMap: IJclWideStrWideStrMap); + procedure PutValue(const Key: WideString; const Value: WideString); + function Remove(const Key: WideString): WideString; + function Size: Integer; + function Values: IJclWideStrCollection; + property Items[const Key: WideString]: WideString read GetValue write PutValue; + {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} + end; + {$IFDEF SUPPORTS_UNICODE_STRING} IJclUnicodeStrIntfMap = interface(IJclUnicodeStrContainer) ['{C83D4F5E-8E66-41E9-83F6-338B44F24BE6}'] @@ -2556,56 +2636,6 @@ end; {$ENDIF SUPPORTS_UNICODE_STRING} - {$IFDEF CONTAINER_ANSISTR} - IJclStrIntfMap = IJclAnsiStrIntfMap; - {$ENDIF CONTAINER_ANSISTR} - {$IFDEF CONTAINER_WIDESTR} - IJclStrIntfMap = IJclWideStrIntfMap; - {$ENDIF CONTAINER_WIDESTR} - {$IFDEF CONTAINER_UNICODESTR} - IJclStrIntfMap = IJclUnicodeStrIntfMap; - {$ENDIF CONTAINER_UNICODESTR} - - IJclIntfAnsiStrMap = interface(IJclAnsiStrContainer) - ['{B10E324A-1D98-42FF-B9B4-7F99044591B2}'] - procedure Clear; - function ContainsKey(const Key: IInterface): Boolean; - function ContainsValue(const Value: AnsiString): Boolean; - function Extract(const Key: IInterface): AnsiString; - function GetValue(const Key: IInterface): AnsiString; - function IsEmpty: Boolean; - function KeyOfValue(const Value: AnsiString): IInterface; - function KeySet: IJclIntfSet; - function MapEquals(const AMap: IJclIntfAnsiStrMap): Boolean; - procedure PutAll(const AMap: IJclIntfAnsiStrMap); - procedure PutValue(const Key: IInterface; const Value: AnsiString); - function Remove(const Key: IInterface): AnsiString; - function Size: Integer; - function Values: IJclAnsiStrCollection; - property Items[const Key: IInterface]: AnsiString read GetValue write PutValue; - {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} - end; - - IJclIntfWideStrMap = interface(IJclWideStrContainer) - ['{D9FD7887-B840-4636-8A8F-E586663E332C}'] - procedure Clear; - function ContainsKey(const Key: IInterface): Boolean; - function ContainsValue(const Value: WideString): Boolean; - function Extract(const Key: IInterface): WideString; - function GetValue(const Key: IInterface): WideString; - function IsEmpty: Boolean; - function KeyOfValue(const Value: WideString): IInterface; - function KeySet: IJclIntfSet; - function MapEquals(const AMap: IJclIntfWideStrMap): Boolean; - procedure PutAll(const AMap: IJclIntfWideStrMap); - procedure PutValue(const Key: IInterface; const Value: WideString); - function Remove(const Key: IInterface): WideString; - function Size: Integer; - function Values: IJclWideStrCollection; - property Items[const Key: IInterface]: WideString read GetValue write PutValue; - {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} - end; - {$IFDEF SUPPORTS_UNICODE_STRING} IJclIntfUnicodeStrMap = interface(IJclUnicodeStrContainer) ['{40F8B873-B763-4A3C-8EC4-31DB3404BF73}'] @@ -2628,56 +2658,6 @@ end; {$ENDIF SUPPORTS_UNICODE_STRING} - {$IFDEF CONTAINER_ANSISTR} - IJclIntfStrMap = IJclIntfAnsiStrMap; - {$ENDIF CONTAINER_ANSISTR} - {$IFDEF CONTAINER_WIDESTR} - IJclIntfStrMap = IJclIntfWideStrMap; - {$ENDIF CONTAINER_WIDESTR} - {$IFDEF CONTAINER_UNICODESTR} - IJclIntfStrMap = IJclIntfUnicodeStrMap; - {$ENDIF CONTAINER_UNICODESTR} - - IJclAnsiStrAnsiStrMap = interface(IJclAnsiStrContainer) - ['{A4788A96-281A-4924-AA24-03776DDAAD8A}'] - procedure Clear; - function ContainsKey(const Key: AnsiString): Boolean; - function ContainsValue(const Value: AnsiString): Boolean; - function Extract(const Key: AnsiString): AnsiString; - function GetValue(const Key: AnsiString): AnsiString; - function IsEmpty: Boolean; - function KeyOfValue(const Value: AnsiString): AnsiString; - function KeySet: IJclAnsiStrSet; - function MapEquals(const AMap: IJclAnsiStrAnsiStrMap): Boolean; - procedure PutAll(const AMap: IJclAnsiStrAnsiStrMap); - procedure PutValue(const Key: AnsiString; const Value: AnsiString); - function Remove(const Key: AnsiString): AnsiString; - function Size: Integer; - function Values: IJclAnsiStrCollection; - property Items[const Key: AnsiString]: AnsiString read GetValue write PutValue; - {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} - end; - - IJclWideStrWideStrMap = interface(IJclWideStrContainer) - ['{8E8D2735-C4FB-4F00-8802-B2102BCE3644}'] - procedure Clear; - function ContainsKey(const Key: WideString): Boolean; - function ContainsValue(const Value: WideString): Boolean; - function Extract(const Key: WideString): WideString; - function GetValue(const Key: WideString): WideString; - function IsEmpty: Boolean; - function KeyOfValue(const Value: WideString): WideString; - function KeySet: IJclWideStrSet; - function MapEquals(const AMap: IJclWideStrWideStrMap): Boolean; - procedure PutAll(const AMap: IJclWideStrWideStrMap); - procedure PutValue(const Key: WideString; const Value: WideString); - function Remove(const Key: WideString): WideString; - function Size: Integer; - function Values: IJclWideStrCollection; - property Items[const Key: WideString]: WideString read GetValue write PutValue; - {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP} - end; - {$IFDEF SUPPORTS_UNICODE_STRING} IJclUnicodeStrUnicodeStrMap = interface(IJclUnicodeStrContainer) ['{557E1CBD-06AC-41C2-BAED-253709CBD0AE}'] @@ -2701,6 +2681,26 @@ {$ENDIF SUPPORTS_UNICODE_STRING} {$IFDEF CONTAINER_ANSISTR} + IJclStrIntfMap = IJclAnsiStrIntfMap; + {$ENDIF CONTAINER_ANSISTR} + {$IFDEF CONTAINER_WIDESTR} + IJclStrIntfMap = IJclWideStrIntfMap; + {$ENDIF CONTAINER_WIDESTR} + {$IFDEF CONTAINER_UNICODESTR} + IJclStrIntfMap = IJclUnicodeStrIntfMap; + {$ENDIF CONTAINER_UNICODESTR} + + {$IFDEF CONTAINER_ANSISTR} + IJclIntfStrMap = IJclIntfAnsiStrMap; + {$ENDIF CONTAINER_ANSISTR} + {$IFDEF CONTAINER_WIDESTR} + IJclIntfStrMap = IJclIntfWideStrMap; + {$ENDIF CONTAINER_WIDESTR} + {$IFDEF CONTAINER_UNICODESTR} + IJclIntfStrMap = IJclIntfUnicodeStrMap; + {$ENDIF CONTAINER_UNICODESTR} + + {$IFDEF CONTAINER_ANSISTR} IJclStrStrMap = IJclAnsiStrAnsiStrMap; {$ENDIF CONTAINER_ANSISTR} {$IFDEF CONTAINER_WIDESTR} @@ -3642,6 +3642,24 @@ function TailMap(const FromKey: AnsiString): IJclAnsiStrIntfSortedMap; end; + IJclIntfAnsiStrSortedMap = interface(IJclIntfAnsiStrMap) + ['{96E6AC5E-8C40-4795-9C8A-CFD098B58680}'] + function FirstKey: IInterface; + function HeadMap(const ToKey: IInterface): IJclIntfAnsiStrSortedMap; + function LastKey: IInterface; + function SubMap(const FromKey, ToKey: IInterface): IJclIntfAnsiStrSortedMap; + function TailMap(const FromKey: IInterface): IJclIntfAnsiStrSortedMap; + end; + + IJclAnsiStrAnsiStrSortedMap = interface(IJclAnsiStrAnsiStrMap) + ['{4F457799-5D03-413D-A46C-067DC4200CC3}'] + function FirstKey: AnsiString; + function HeadMap(const ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; + function LastKey: AnsiString; + function SubMap(const FromKey, ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; + function TailMap(const FromKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; + end; + IJclWideStrIntfSortedMap = interface(IJclWideStrIntfMap) ['{299FDCFD-2DB7-4D64-BF18-EE3668316430}'] function FirstKey: WideString; @@ -3651,6 +3669,24 @@ function TailMap(const FromKey: WideString): IJclWideStrIntfSortedMap; end; + IJclIntfWideStrSortedMap = interface(IJclIntfWideStrMap) + ['{FBE3AD2E-2781-4DC0-9E80-027027380E21}'] + function FirstKey: IInterface; + function HeadMap(const ToKey: IInterface): IJclIntfWideStrSortedMap; + function LastKey: IInterface; + function SubMap(const FromKey, ToKey: IInterface): IJclIntfWideStrSortedMap; + function TailMap(const FromKey: IInterface): IJclIntfWideStrSortedMap; + end; + + IJclWideStrWideStrSortedMap = interface(IJclWideStrWideStrMap) + ['{3B0757B2-2290-4AFA-880D-F9BA600E501E}'] + function FirstKey: WideString; + function HeadMap(const ToKey: WideString): IJclWideStrWideStrSortedMap; + function LastKey: WideString; + function SubMap(const FromKey, ToKey: WideString): IJclWideStrWideStrSortedMap; + function TailMap(const FromKey: WideString): IJclWideStrWideStrSortedMap; + end; + {$IFDEF SUPPORTS_UNICODE_STRING} IJclUnicodeStrIntfSortedMap = interface(IJclUnicodeStrIntfMap) ['{25FDE916-730D-449A-BA29-852D8A0470B6}'] @@ -3662,34 +3698,6 @@ end; {$ENDIF SUPPORTS_UNICODE_STRING} - {$IFDEF CONTAINER_ANSISTR} - IJclStrIntfSortedMap = IJclAnsiStrIntfSortedMap; - {$ENDIF CONTAINER_ANSISTR} - {$IFDEF CONTAINER_WIDESTR} - IJclStrIntfSortedMap = IJclWideStrIntfSortedMap; - {$ENDIF CONTAINER_WIDESTR} - {$IFDEF CONTAINER_UNICODESTR} - IJclStrIntfSortedMap = IJclUnicodeStrIntfSortedMap; - {$ENDIF CONTAINER_UNICODESTR} - - IJclIntfAnsiStrSortedMap = interface(IJclIntfAnsiStrMap) - ['{96E6AC5E-8C40-4795-9C8A-CFD098B58680}'] - function FirstKey: IInterface; - function HeadMap(const ToKey: IInterface): IJclIntfAnsiStrSortedMap; - function LastKey: IInterface; - function SubMap(const FromKey, ToKey: IInterface): IJclIntfAnsiStrSortedMap; - function TailMap(const FromKey: IInterface): IJclIntfAnsiStrSortedMap; - end; - - IJclIntfWideStrSortedMap = interface(IJclIntfWideStrMap) - ['{FBE3AD2E-2781-4DC0-9E80-027027380E21}'] - function FirstKey: IInterface; - function HeadMap(const ToKey: IInterface): IJclIntfWideStrSortedMap; - function LastKey: IInterface; - function SubMap(const FromKey, ToKey: IInterface): IJclIntfWideStrSortedMap; - function TailMap(const FromKey: IInterface): IJclIntfWideStrSortedMap; - end; - {$IFDEF SUPPORTS_UNICODE_STRING} IJclIntfUnicodeStrSortedMap = interface(IJclIntfUnicodeStrMap) ['{B0B0CB9B-268B-40D2-94A8-0B8B5BE2E1AC}'] @@ -3701,34 +3709,6 @@ end; {$ENDIF SUPPORTS_UNICODE_STRING} - {$IFDEF CONTAINER_ANSISTR} - IJclIntfStrSortedMap = IJclIntfAnsiStrSortedMap; - {$ENDIF CONTAINER_ANSISTR} - {$IFDEF CONTAINER_WIDESTR} - IJclIntfStrSortedMap = IJclIntfWideStrSortedMap; - {$ENDIF CONTAINER_WIDESTR} - {$IFDEF CONTAINER_UNICODESTR} - IJclIntfStrSortedMap = IJclIntfUnicodeStrSortedMap; - {$ENDIF CONTAINER_UNICODESTR} - - IJclAnsiStrAnsiStrSortedMap = interface(IJclAnsiStrAnsiStrMap) - ['{4F457799-5D03-413D-A46C-067DC4200CC3}'] - function FirstKey: AnsiString; - function HeadMap(const ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; - function LastKey: AnsiString; - function SubMap(const FromKey, ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; - function TailMap(const FromKey: AnsiString): IJclAnsiStrAnsiStrSortedMap; - end; - - IJclWideStrWideStrSortedMap = interface(IJclWideStrWideStrMap) - ['{3B0757B2-2290-4AFA-880D-F9BA600E501E}'] - function FirstKey: WideString; - function HeadMap(const ToKey: WideString): IJclWideStrWideStrSortedMap; - function LastKey: WideString; - function SubMap(const FromKey, ToKey: WideString): IJclWideStrWideStrSortedMap; - function TailMap(const FromKey: WideString): IJclWideStrWideStrSortedMap; - end; - {$IFDEF SUPPORTS_UNICODE_STRING} IJclUnicodeStrUnicodeStrSortedMap = interface(IJclUnicodeStrUnicodeStrMap) ['{D8EACC5D-B31E-47A8-9CC9-32B15A79CACA}'] @@ -3741,6 +3721,26 @@ {$ENDIF SUPPORTS_UNICODE_STRING} {$IFDEF CONTAINER_ANSISTR} + IJclStrIntfSortedMap = IJclAnsiStrIntfSortedMap; + {$ENDIF CONTAINER_ANSISTR} + {$IFDEF CONTAINER_WIDESTR} + IJclStrIntfSortedMap = IJclWideStrIntfSortedMap; + {$ENDIF CONTAINER_WIDESTR} + {$IFDEF CONTAINER_UNICODESTR} + IJclStrIntfSortedMap = IJclUnicodeStrIntfSortedMap; + {$ENDIF CONTAINER_UNICODESTR} + + {$IFDEF CONTAINER_ANSISTR} + IJclIntfStrSortedMap = IJclIntfAnsiStrSortedMap; + {$ENDIF CONTAINER_ANSISTR} + {$IFDEF CONTAINER_WIDESTR} + IJclIntfStrSortedMap = IJclIntfWideStrSortedMap; + {$ENDIF CONTAINER_WIDESTR} + {$IFDEF CONTAINER_UNICODESTR} + IJclIntfStrSortedMap = IJclIntfUnicodeStrSortedMap; + {$ENDIF CONTAINER_UNICODESTR} + + {$IFDEF CONTAINER_ANSISTR} IJclStrStrSortedMap = IJclAnsiStrAnsiStrSortedMap; {$ENDIF CONTAINER_ANSISTR} {$IFDEF CONTAINER_WIDESTR} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ou...@us...> - 2010-08-10 13:59:29
|
Revision: 3293 http://jcl.svn.sourceforge.net/jcl/?rev=3293&view=rev Author: outchy Date: 2010-08-10 13:59:22 +0000 (Tue, 10 Aug 2010) Log Message: ----------- For some reasons, the MoveArray functions did not correctly handle refcounts when FromIndex < ToIndex. TODO: test cases for all the possible array move schemes. Modified Paths: -------------- trunk/jcl/source/common/JclBase.pas Modified: trunk/jcl/source/common/JclBase.pas =================================================================== --- trunk/jcl/source/common/JclBase.pas 2010-08-10 11:01:50 UTC (rev 3292) +++ trunk/jcl/source/common/JclBase.pas 2010-08-10 13:59:22 UTC (rev 3293) @@ -398,16 +398,21 @@ procedure FinalizeArrayBeforeMove(var List: TDynIInterfaceArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -var - N: Integer; begin Assert(Count > 0); - N := FromIndex - ToIndex; - if N > 0 then + if FromIndex < ToIndex then begin - if N > Count then - N := Count; - Finalize(List[ToIndex], N); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; @@ -458,16 +463,21 @@ procedure FinalizeArrayBeforeMove(var List: TDynStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -var - N: Integer; begin Assert(Count > 0); - N := FromIndex - ToIndex; - if N > 0 then + if FromIndex < ToIndex then begin - if N > Count then - N := Count; - Finalize(List[ToIndex], N); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; @@ -577,16 +587,21 @@ {$IFDEF SUPPORTS_UNICODE_STRING} procedure FinalizeArrayBeforeMove(var List: TDynUnicodeStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -var - N: Integer; begin Assert(Count > 0); - N := FromIndex - ToIndex; - if N > 0 then + if FromIndex < ToIndex then begin - if N > Count then - N := Count; - Finalize(List[ToIndex], N); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; @@ -639,16 +654,21 @@ {$IFNDEF FPC} procedure FinalizeArrayBeforeMove(var List: TDynAnsiStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -var - N: Integer; begin Assert(Count > 0); - N := FromIndex - ToIndex; - if N > 0 then + if FromIndex < ToIndex then begin - if N > Count then - N := Count; - Finalize(List[ToIndex], N); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; @@ -700,16 +720,21 @@ procedure FinalizeArrayBeforeMove(var List: TDynWideStringArray; FromIndex, ToIndex, Count: SizeInt); overload; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF} -var - N: Integer; begin Assert(Count > 0); - N := FromIndex - ToIndex; - if N > 0 then + if FromIndex < ToIndex then begin - if N > Count then - N := Count; - Finalize(List[ToIndex], N); + if Count > (ToIndex - FromIndex) then + Finalize(List[FromIndex + Count], ToIndex - FromIndex) + else + Finalize(List[ToIndex], Count); + end + else + if FromIndex > ToIndex then + begin + if Count > (FromIndex - ToIndex) then + Count := FromIndex - ToIndex; + Finalize(List[ToIndex], Count) end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |