mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 05:29:26 +02:00
fix compiler hints in LazUtils
This commit is contained in:
parent
33df1460d5
commit
6970b3aef1
@ -101,7 +101,7 @@ constructor THTML2TextRenderer.Create(const Stream: TStream);
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
SetLength(s,Stream.Size);
|
||||
SetLength(s{%H-},Stream.Size);
|
||||
if s<>'' then
|
||||
Stream.Read(s[1],length(s));
|
||||
Create(s); // Call the constructor above.
|
||||
|
@ -300,9 +300,9 @@ begin
|
||||
exit;
|
||||
end;
|
||||
{$IFDEF NotLiteralFilenames}
|
||||
SetLength(File1,Len1);
|
||||
SetLength(File1{%H-},Len1);
|
||||
System.Move(Filename1^,File1[1],Len1);
|
||||
SetLength(File2,Len2);
|
||||
SetLength(File2{%H-},Len2);
|
||||
System.Move(Filename2^,File2[1],Len2);
|
||||
Result:=CompareFilenames(File1,File2);
|
||||
{$ELSE}
|
||||
|
@ -12,7 +12,7 @@ begin
|
||||
if Win32MajorVersion >= 5 then
|
||||
begin
|
||||
WideFileName := UTF8ToUTF16(FileName);
|
||||
SetLength(WideResult,Max_Path);
|
||||
SetLength(WideResult{%H-},MAX_PATH);
|
||||
lPathSize := GetShortPathNameW(PWideChar(WideFileName), PWideChar(WideResult), Length(WideResult));
|
||||
SetLength(WideResult,lPathSize);
|
||||
Result := UTF16ToUTF8(WideResult);
|
||||
|
@ -204,7 +204,7 @@ begin
|
||||
if SHGetFolderPathW(0,ID or CSIDL_FLAG_CREATE,0,0,@APATH[0]) = S_OK then
|
||||
begin
|
||||
Len := StrLen(APath);
|
||||
SetLength(WS, Len);
|
||||
SetLength(WS{%H-}, Len);
|
||||
System.Move(APath[0], WS[1], Len * SizeOf(WideChar));
|
||||
Result := AppendPathDelim(Utf16ToUtf8(WS));
|
||||
end;
|
||||
|
@ -94,7 +94,7 @@ begin
|
||||
|
||||
//writeln('StrLen(PCmdLineW) = ',CmdLen);
|
||||
|
||||
SetLength(CmdLineW, CmdLen);
|
||||
SetLength(CmdLineW{%H-}, CmdLen);
|
||||
Move(PCmdLineW^, CmdLineW[1], CmdLen * SizeOf(WChar));
|
||||
|
||||
|
||||
@ -357,7 +357,7 @@ begin
|
||||
// this will null-terminate
|
||||
if UTF16WordCnt>0 then
|
||||
begin
|
||||
setlength(UTF16Str, UTF16WordCnt);
|
||||
setlength(UTF16Str{%H-}, UTF16WordCnt);
|
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, Pointer(s), length(s), @UTF16Str[1], UTF16WordCnt);
|
||||
Result:=UTF8Encode(UTF16Str);
|
||||
{$ifdef FPC_HAS_CPSTRING}
|
||||
@ -569,9 +569,9 @@ var
|
||||
U1, U2: String;
|
||||
begin
|
||||
if Count>0 then begin
|
||||
SetLength(U1,Count);
|
||||
SetLength(U1{%H-},Count);
|
||||
Move(S1^,PByte(U1)^,Count);
|
||||
SetLength(U2,Count);
|
||||
SetLength(U2{%H-},Count);
|
||||
Move(S2^,PByte(U2)^,Count);
|
||||
Result:=UTF8CompareText(U1,U2);
|
||||
end else
|
||||
|
Loading…
Reference in New Issue
Block a user