|
From: <wp...@us...> - 2009-07-09 21:40:59
|
Revision: 809
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=809&view=rev
Author: wp2udk
Date: 2009-07-09 21:40:48 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
Fixed some Delphi 2009 Unicode Compiler Warnings regarding the use of the Char data type in Sets.
Modified Paths:
--------------
trunk/Source/Core/InstantClasses.pas
trunk/Source/Core/InstantCode.pas
trunk/Source/Core/InstantCommand.pas
trunk/Source/Core/InstantMetadata.pas
trunk/Source/Core/InstantPersistence.pas
trunk/Source/Core/InstantTextFiler.pas
trunk/Source/Core/InstantUtils.pas
trunk/Source/Design/InstantCommandEditor.pas
Modified: trunk/Source/Core/InstantClasses.pas
===================================================================
--- trunk/Source/Core/InstantClasses.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantClasses.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -50,7 +50,12 @@
InstantBufferSize = 4096;
type
+{$IFDEF D12+}
+ TChars = set of AnsiChar;
+{$ELSE}
TChars = set of Char;
+{$ENDIF}
+
{$IFDEF LINUX}
TDate = type TDateTime;
TTime = type TDateTime;
@@ -1386,7 +1391,11 @@
for I := 1 to Length(Data) do
begin
C := Data[I];
+{$IFDEF D12+}
+ if CharInSet(C, [#34, #38, #39, #60, #62]) then
+{$ELSE}
if C in [#34, #38, #39, #60, #62] then
+{$ENDIF}
begin
case C of
#34:
Modified: trunk/Source/Core/InstantCode.pas
===================================================================
--- trunk/Source/Core/InstantCode.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantCode.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -2689,7 +2689,12 @@
begin
Name := Reader.ReadToken;
Reader.SkipSpace;
+
+{$IFDEF D12+}
+ Result := CharInSet(Reader.ReadChar, [':', ',']);
+{$ELSE}
Result := Reader.ReadChar in [':', ','];
+{$ENDIF}
end;
procedure TInstantCodeSymbol.InternalRead(Reader: TInstantCodeReader);
@@ -3933,14 +3938,28 @@
if Copy(Result, i, 1) = 's' then
begin
If (i > 3) and (Copy(Result, i - 2, 3) = 'ies') and
+{$IFDEF D12+}
+ not (CharInSet(Result[i - 3], Vowels)) then
+{$ELSE}
not (Result[i - 3] in Vowels) then
+{$ENDIF}
begin
Result := Copy(Result, 1, i - 3) + 'y';
end
else If (i > 3) and (Copy(Result, i - 1, 2) = 'es') and
+{$IFDEF D12+}
+ (CharInSet(Result[i - 2], SpChars)) then
+{$ELSE}
(Result[i - 2] in SpChars) then
+{$ENDIF}
begin
- if (Result[i - 2] = 'h') and not (Result[i - 3] in ['c', 's']) then
+ if (Result[i - 2] = 'h') and
+{$IFDEF D12+}
+ not (CharInSet(Result[i - 3], ['c', 's'])) then
+{$ELSE}
+ not (Result[i - 3] in ['c', 's']) then
+{$ENDIF}
+
begin
//not ch or sh
Result := Copy(Result, 1, i - 1);
@@ -5761,7 +5780,11 @@
Reader.SkipSpace;
Reader.ReadToken;
Reader.SkipSpace;
+{$IFDEF D12+}
+ Result := CharInSet(Reader.NextChar, [':', '=']);
+{$ELSE}
Result := Reader.NextChar in [':', '='];
+{$ENDIF}
finally
Reader.Position := SavePos;
end;
@@ -8688,7 +8711,11 @@
if FCode^[I] = #10 then
begin
Inc(I);
+{$IFDEF D12+}
+ while CharInSet(FCode^[I], [' ', #9]) do
+{$ELSE}
while FCode^[I] in [' ', #9] do
+{$ENDIF}
begin
Result := Result + FCode^[I];
Inc(I);
Modified: trunk/Source/Core/InstantCommand.pas
===================================================================
--- trunk/Source/Core/InstantCommand.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantCommand.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -1121,7 +1121,12 @@
begin
Token := Reader.ReadToken;
Result := IsConstantToken(Token) or InstantIsNumeric(Token) or
- ((Length(Token) > 0) and (Token[1] in ['"', '''', '[']));
+ ((Length(Token) > 0) and
+{$IFDEF D12+}
+ (CharInSet(Token[1], ['"', '''', '['])));
+{$ELSE}
+ (Token[1] in ['"', '''', '[']));
+{$ENDIF}
end;
procedure TInstantIQLConstant.InternalClear;
Modified: trunk/Source/Core/InstantMetadata.pas
===================================================================
--- trunk/Source/Core/InstantMetadata.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantMetadata.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -67,7 +67,7 @@
protected
function InternalEquals(const Other: TInstantMetadata): Boolean; virtual;
public
- function Equals(const Other: TInstantMetadata): Boolean;
+ function Equals(const Other: TInstantMetadata): Boolean; {$IFDEF D12+} reintroduce; {$ENDIF}
property Collection: TInstantMetadatas read GetCollection
write SetCollection;
end;
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantPersistence.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -129,8 +129,8 @@
function Dereference(Connector: TInstantConnector = nil;
AOwnsInstance: Boolean = True; Retry: Boolean = False): TInstantObject;
procedure DestroyInstance;
- function Equals(const AObjectClassName, AObjectId: string): Boolean; overload;
- function Equals(AObject: TInstantObject): Boolean; overload;
+ function Equals(const AObjectClassName, AObjectId: string): Boolean; {$IFDEF D12+}reintroduce;{$ENDIF} overload;
+ function Equals(AObject: TInstantObject): Boolean; {$IFDEF D12+}reintroduce;{$ENDIF} overload;
function HasInstance: Boolean;
function HasReference: Boolean;
function IsBroken: Boolean;
@@ -1622,7 +1622,12 @@
begin
Result := True;
for I := 0 to Pred(BufferLength div SizeOf(Char)) do
- if (ValidChars <> []) and not (Buffer[I] in ValidChars + [#8, #10, #13]) then
+ if (ValidChars <> []) and not
+{$IFDEF D12+}
+ (CharInSet(Buffer[I], ValidChars + [#8, #10, #13]))
+{$ELSE}
+ (Buffer[I] in ValidChars + [#8, #10, #13])
+{$ENDIF} then
begin
Result := False;
InvalidChar := Buffer[I];
Modified: trunk/Source/Core/InstantTextFiler.pas
===================================================================
--- trunk/Source/Core/InstantTextFiler.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantTextFiler.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -236,7 +236,11 @@
function TInstantTextFiler.IsSpace(Ch: Char): Boolean;
begin
+{$IFDEF D12+}
+ Result := CharInSet(Ch, [' ', #9, #10, #13]);
+{$ELSE}
Result := Ch in [' ', #9, #10, #13];
+{$ENDIF}
end;
function TInstantTextFiler.IsText(Ch: Char): Boolean;
@@ -244,7 +248,11 @@
Result := ((Ch >= 'a') and (Ch <= 'z'))
or ((Ch >= 'A') and (Ch <= 'Z'))
or ((Ch >= '0') and (Ch <= '9'))
+{$IFDEF D12+}
+ or (CharInSet(Ch, ['#', '_']));
+{$ELSE}
or (Ch in ['#', '_']);
+{$ENDIF}
end;
procedure TInstantTextFiler.Reset;
@@ -325,7 +333,12 @@
function TInstantTextReader.IsStringDelimiter(Ch: Char): Boolean;
begin
- Result := ConstAware and (Ch in ['''', '"']);
+ Result := ConstAware and
+{$IFDEF D12+}
+ (CharInSet(Ch, ['''', '"']));
+{$ELSE}
+ (Ch in ['''', '"']);
+{$ENDIF}
end;
function TInstantTextReader.NextChar: Char;
Modified: trunk/Source/Core/InstantUtils.pas
===================================================================
--- trunk/Source/Core/InstantUtils.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Core/InstantUtils.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -112,7 +112,11 @@
begin
Result := '';
for I := 0 to 255 do
+{$IFDEF D12+}
+ if CharInSet(Chr(I), C) then
+{$ELSE}
if Chr(I) in C then
+{$ENDIF}
S := S + Chr(I);
I := 1;
L := Length(S);
@@ -566,7 +570,7 @@
I: Integer;
begin
I := Pos;
- while (I <= Length(Str)) and not (Str[I] in Delimiters) do
+ while (I <= Length(Str)) and not {$IFDEF D12+}CharInSet(Str[I], Delimiters){$ELSE}(Str[I] in Delimiters){$ENDIF} do
Inc(I);
Result := Copy(Str, Pos, I - Pos);
if I <= Length(Str) then
Modified: trunk/Source/Design/InstantCommandEditor.pas
===================================================================
--- trunk/Source/Design/InstantCommandEditor.pas 2009-07-09 20:01:14 UTC (rev 808)
+++ trunk/Source/Design/InstantCommandEditor.pas 2009-07-09 21:40:48 UTC (rev 809)
@@ -177,7 +177,11 @@
function IsSpace(Ch: Char): Boolean;
begin
+{$IFDEF D12+}
+ Result := CharInSet(Ch, [' ', #9, #10, #13]);
+{$ELSE}
Result := Ch in [' ', #9, #10, #13];
+{$ENDIF}
end;
var
|