* removed divisions from val() for unsigned types

git-svn-id: trunk@7790 -
This commit is contained in:
Jonas Maebe 2007-06-24 13:04:44 +00:00
parent 62b9198b55
commit 76c783f0a1

View File

@ -874,13 +874,13 @@ begin
u:=16;
end;
prev := fpc_Val_UInt_Shortstr;
fpc_Val_UInt_Shortstr:=fpc_Val_UInt_Shortstr*ValUInt(base) + u;
If (u>=base) or
(ValUInt(MaxUIntValue-u) div ValUInt(Base)<prev) then
(prev>fpc_Val_UInt_Shortstr) then
begin
fpc_Val_UInt_Shortstr:=0;
exit;
end;
fpc_Val_UInt_Shortstr:=fpc_Val_UInt_Shortstr*ValUInt(base) + u;
inc(code);
end;
code := 0;
@ -975,13 +975,13 @@ end;
u:=16;
end;
prev := fpc_val_qword_shortstr;
fpc_val_qword_shortstr:=fpc_val_qword_shortstr*QWord(base) + u;
If (u>=base) or
((QWord(maxqword-u) div QWord(base))<prev) then
(prev>fpc_val_qword_shortstr) then
Begin
fpc_val_qword_shortstr := 0;
Exit
End;
fpc_val_qword_shortstr:=fpc_val_qword_shortstr*QWord(base) + u;
inc(code);
end;
code := 0;