From a19528efa1145e2403104931dcd153515c215810 Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 2 Nov 2018 19:22:46 +0000 Subject: [PATCH] * Fixed warnings. git-svn-id: trunk@40188 - --- rtl/inc/generic.inc | 2 +- rtl/inc/ustrings.inc | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index f61a6bb153..52240a2120 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -29,7 +29,7 @@ function align(addr : Pointer;alignment : PtrUInt) : Pointer;{$ifdef SYSTEMINLIN tmp: PtrUInt; begin tmp:=PtrUInt(addr)+(alignment-1); - result:=pointer(tmp-(tmp mod alignment)); + result:=pointer(ptruint(tmp-(tmp mod alignment))); end; {$endif} diff --git a/rtl/inc/ustrings.inc b/rtl/inc/ustrings.inc index b38a7a458e..355dba5d3c 100644 --- a/rtl/inc/ustrings.inc +++ b/rtl/inc/ustrings.inc @@ -1835,6 +1835,7 @@ end; //One character US-ASCII, convert it to unicode if IBYTE = 10 then begin +(* If (PreChar<>13) and FALSE then begin //Expand to crlf, conform UTF-8. @@ -1855,6 +1856,7 @@ end; end; end else +*) begin Dest[OutputUnicode]:=WideChar(IBYTE); inc(OutputUnicode); @@ -1978,6 +1980,7 @@ end; //One character US-ASCII, convert it to unicode if IBYTE = 10 then begin +(* if (PreChar<>13) and FALSE then begin //Expand to crlf, conform UTF-8. @@ -1987,6 +1990,7 @@ end; PreChar:=10; end else +*) begin inc(OutputUnicode); PreChar:=IBYTE; @@ -2242,7 +2246,7 @@ function UCS4StringToUnicodeString(const s : UCS4String) : UnicodeString; begin reslen:=0; for i:=0 to length(s)-2 do { skip terminating #0 } - Inc(reslen,1+ord((s[i]>$ffff) and (s[i]<=$10ffff))); + Inc(reslen,1+ord((s[i]>$ffff) and (cardinal(s[i])<=$10ffff))); SetLength(result,reslen); UCS4Decode(s,pointer(result)); end; @@ -2255,7 +2259,7 @@ function UCS4StringToWideString(const s : UCS4String) : WideString; begin reslen:=0; for i:=0 to length(s)-2 do { skip terminating #0 } - Inc(reslen,1+ord((s[i]>$ffff) and (s[i]<=$10ffff))); + Inc(reslen,1+ord((s[i]>$ffff) and (cardinal(s[i])<=$10ffff))); SetLength(result,reslen); UCS4Decode(s,pointer(result)); end;