mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 03:51:39 +02:00
* Cosmetic cleanup of constexprint leftovers.
git-svn-id: trunk@7657 -
This commit is contained in:
parent
2e57912288
commit
11c7fcef7b
@ -449,9 +449,6 @@ implementation
|
||||
|
||||
function is_in_limit(def_from,def_to : tdef) : boolean;
|
||||
|
||||
var
|
||||
fromqword, toqword: boolean;
|
||||
|
||||
begin
|
||||
if (def_from.typ <> orddef) or (def_to.typ <> orddef) then
|
||||
begin
|
||||
@ -693,8 +690,7 @@ implementation
|
||||
case longint(todef.size) of
|
||||
1: l := l and $ff;
|
||||
2: l := l and $ffff;
|
||||
{ work around sign extension bug (to be fixed) (JM) }
|
||||
4: l := l and (int64($fffffff) shl 4 + $f);
|
||||
4: l := l and $ffffffff;
|
||||
end;
|
||||
{reset sign, i.e. converting -1 to qword changes the value to high(qword)}
|
||||
l.signed:=false;
|
||||
|
||||
@ -1298,42 +1298,8 @@ implementation
|
||||
v:=torddef(def).low
|
||||
else
|
||||
v:=torddef(def).high;
|
||||
(*
|
||||
Low and high are not anymore longints, but Tconstexprints (DM)
|
||||
{ low/high of torddef are longints, so we need special }
|
||||
{ handling for cardinal and 64bit types (JM) }
|
||||
{ 1.0.x doesn't support int64($ffffffff) correct, it'll expand
|
||||
to -1 instead of staying $ffffffff. Therefor we use $ffff with
|
||||
shl twice (PFV) }
|
||||
case torddef(def).ordtype of
|
||||
s64bit,scurrency :
|
||||
begin
|
||||
if (inlinenumber=in_low_x) then
|
||||
v := int64($80000000) shl 32
|
||||
else
|
||||
v := (int64($7fffffff) shl 32) or int64($ffff) shl 16 or int64($ffff)
|
||||
end;
|
||||
u64bit :
|
||||
begin
|
||||
{ we have to use a dirty trick for high(qword), }
|
||||
{ because it's bigger than high(tconstexprint) (JM) }
|
||||
v := 0
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not is_signed(def) then
|
||||
v := cardinal(v);
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
hp:=cordconstnode.create(v,def,true);
|
||||
typecheckpass(hp);
|
||||
(*
|
||||
{ fix high(qword) }
|
||||
if (torddef(def).ordtype=u64bit) and
|
||||
(inlinenumber = in_high_x) then
|
||||
tordconstnode(hp).value := int64(-1); { is the same as qword($ffffffffffffffff) }
|
||||
*)
|
||||
do_lowhigh:=hp;
|
||||
end;
|
||||
enumdef:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user