* A number of conversion functions in System and SysUtils are now pure

This commit is contained in:
J. Gareth "Curious Kit" Moreton 2024-04-07 01:43:25 +01:00 committed by J. Gareth "Kit" Moreton
parent f15284c3ed
commit 9c215fba02
3 changed files with 31 additions and 31 deletions

View File

@ -1329,8 +1329,8 @@ Function HexStr(Val:Pointer):shortstring;
{$if defined(VER3_2)}
Function Chr(b : byte) : AnsiChar; [INTERNPROC: fpc_in_chr_byte];
{$endif defined(VER3_2)}
Function UpCase(c:AnsiChar):AnsiChar;
Function LowerCase(c:AnsiChar):AnsiChar; overload;
Function UpCase(c:AnsiChar):AnsiChar; {$ifdef FPC_HAS_PURE}pure;{$endif FPC_HAS_PURE}
Function LowerCase(c:AnsiChar):AnsiChar; overload; {$ifdef FPC_HAS_PURE}pure;{$endif FPC_HAS_PURE}
function Pos(const substr : shortstring;c:Ansichar; Offset: Sizeint = 1): SizeInt;

View File

@ -116,40 +116,40 @@ function AnsiExtractQuotedStr(var Src: PWideChar; Quote: AnsiChar): Widestring;
function AdjustLineBreaks(const S: string): string;
function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle): string;
function IsValidIdent(const Ident: string; AllowDots: Boolean = False; StrictDots: Boolean = False): Boolean;
function IntToStr(Value: Longint): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToStr(Value: Int64): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToStr(Value: QWord): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function UIntToStr(Value: QWord): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function UIntToStr(Value: Cardinal): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Longint; Digits: integer): string;
function IntToHex(Value: Int64; Digits: integer): string;
function IntToHex(Value: QWord; Digits: integer): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int8): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt8): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int16): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt16): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int32): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt32): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int64): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt64): string; {$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToStr(Value: Longint): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToStr(Value: Int64): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToStr(Value: QWord): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function UIntToStr(Value: QWord): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function UIntToStr(Value: Cardinal): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Longint; Digits: integer): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function IntToHex(Value: Int64; Digits: integer): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function IntToHex(Value: QWord; Digits: integer): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int8): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt8): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int16): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt16): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int32): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt32): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: Int64): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function IntToHex(Value: UInt64): string; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function StrToInt(const s: string): Longint;
function StrToDWord(const s: string): DWord;
function StrToUInt(const s: string): Cardinal;
function StrToInt64(const s: string): int64;
function StrToQWord(const s: string): QWord;
function StrToUInt64(const s: string): UInt64; inline;
function TryStrToInt(const s: string; Out i : Longint) : boolean;
function TryStrToDWord(const s: string; Out D : DWord) : boolean;
function TryStrToUInt(const s: string; out C: Cardinal): Boolean;
function TryStrToInt64(const s: string; Out i : int64) : boolean;
function TryStrToQWord(const s: string; Out Q : QWord) : boolean;
function TryStrToUInt64(const s: string; Out u : UInt64) : boolean; inline;
function StrToIntDef(const S: string; Default: Longint): Longint;
function StrToDWordDef(const S: string; Default: DWord): DWord;
function StrToUIntDef(const S: string; Default: Cardinal): Cardinal;
function StrToInt64Def(const S: string; Default: int64): int64;
function StrToQWordDef(const S: string; Default: QWord): QWord;
function StrToUInt64Def(const S: string; Default: UInt64): UInt64; inline;
function TryStrToInt(const s: string; Out i : Longint) : boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function TryStrToDWord(const s: string; Out D : DWord) : boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function TryStrToUInt(const s: string; out C: Cardinal): Boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function TryStrToInt64(const s: string; Out i : int64) : boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function TryStrToQWord(const s: string; Out Q : QWord) : boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function TryStrToUInt64(const s: string; Out u : UInt64) : boolean; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function StrToIntDef(const S: string; Default: Longint): Longint; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function StrToDWordDef(const S: string; Default: DWord): DWord; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function StrToUIntDef(const S: string; Default: Cardinal): Cardinal; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function StrToInt64Def(const S: string; Default: int64): int64; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function StrToQWordDef(const S: string; Default: QWord): QWord; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}
function StrToUInt64Def(const S: string; Default: UInt64): UInt64; {$ifdef FPC_HAS_PURE}pure;{$ENDIF}{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
function LoadStr(Ident: integer): string;{$ifdef SYSUTILSINLINE}inline;{$ENDIF}
// function FmtLoadStr(Ident: integer; const Args: array of const): string;
Function Format (Const Fmt : AnsiString; const Args : Array of const) : AnsiString;

View File

@ -326,7 +326,7 @@ function strlcomp(str1,str2 : pwidechar;l : SizeInt) : SizeInt;
{ the str* functions are not supposed to support internationalisation;
system.upcase(widechar) does support it (although this is
Delphi-incompatible) }
function simplewideupcase(w: widechar): widechar;
function simplewideupcase(w: widechar): widechar; {$ifdef FPC_HAS_PURE}pure;{$endif FPC_HAS_PURE}
begin
if w in ['a'..'z'] then
result:=widechar(ord(w)-32)