diff --git a/rtl/inc/sstrings.inc b/rtl/inc/sstrings.inc index a200602b91..bd3d31671e 100644 --- a/rtl/inc/sstrings.inc +++ b/rtl/inc/sstrings.inc @@ -1483,7 +1483,7 @@ end; base : byte; negative : boolean; - const maxlongword=longword($ffffffff); + const UpperLimit=High(longword); begin fpc_val_longword_shortstr:=0; @@ -1498,22 +1498,20 @@ end; end; while Code<=Length(s) do begin - case s[Code] of - '0'..'9' : u:=Ord(S[Code])-Ord('0'); - 'A'..'F' : u:=Ord(S[Code])-(Ord('A')-10); - 'a'..'f' : u:=Ord(S[Code])-(Ord('a')-10); + u:=16; + case s[code] of + '0'..'f' : u:=ValValueArray[S[Code]]; #0 : break; else - u:=16; + ; end; - prev := fpc_val_longword_shortstr; If (u>=base) or - ((LongWord(maxlongword-u) div LongWord(base))=base) or - ((LongWord(maxlongword-u) div LongWord(base))