mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 12:00:57 +02:00
* fixed small tp7 things
* boolean:=longbool and longbool fixed
This commit is contained in:
parent
ef7da87e66
commit
7c2bb05a9a
@ -146,16 +146,22 @@ implementation
|
||||
{ we walk the wanted (def_to) types and check then the def_from
|
||||
types if there is a conversion possible }
|
||||
case def_to^.deftype of
|
||||
orddef : begin
|
||||
orddef :
|
||||
begin
|
||||
if (def_from^.deftype=orddef) then
|
||||
begin
|
||||
doconv:=basedefconverts[porddef(def_from)^.typ,porddef(def_to)^.typ];
|
||||
if (doconv<>tc_not_possible) and
|
||||
(explicit or not(doconv in [tc_int_2_bool])) then
|
||||
b:=true;
|
||||
if (doconv=tc_not_possible) or
|
||||
((doconv=tc_int_2_bool) and
|
||||
(not explicit) and
|
||||
(not is_boolean(def_from))) then
|
||||
b:=true;
|
||||
end;
|
||||
end;
|
||||
stringdef : begin
|
||||
|
||||
stringdef :
|
||||
begin
|
||||
case def_from^.deftype of
|
||||
stringdef : begin
|
||||
doconv:=tc_string_to_string;
|
||||
@ -187,7 +193,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
floatdef : begin
|
||||
|
||||
floatdef :
|
||||
begin
|
||||
case def_from^.deftype of
|
||||
orddef : begin { ordinal to real }
|
||||
if pfloatdef(def_to)^.typ=f32bit then
|
||||
@ -220,7 +228,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
enumdef : begin
|
||||
|
||||
enumdef :
|
||||
begin
|
||||
if (def_from^.deftype=enumdef) then
|
||||
begin
|
||||
if assigned(penumdef(def_from)^.basedef) then
|
||||
@ -234,7 +244,9 @@ implementation
|
||||
b:=(hd1=hd2);
|
||||
end;
|
||||
end;
|
||||
arraydef : begin
|
||||
|
||||
arraydef :
|
||||
begin
|
||||
{ open array is also compatible with a single element of its base type }
|
||||
if is_open_array(def_to) and
|
||||
is_equal(parraydef(def_to)^.definition,def_from) then
|
||||
@ -264,7 +276,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
pointerdef : begin
|
||||
|
||||
pointerdef :
|
||||
begin
|
||||
case def_from^.deftype of
|
||||
stringdef : begin
|
||||
{ string constant to zero terminated string constant }
|
||||
@ -339,7 +353,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
setdef : begin
|
||||
|
||||
setdef :
|
||||
begin
|
||||
{ automatic arrayconstructor -> set conversion }
|
||||
if (def_from^.deftype=arraydef) and (parraydef(def_from)^.IsConstructor) then
|
||||
begin
|
||||
@ -347,7 +363,9 @@ implementation
|
||||
b:=true;
|
||||
end;
|
||||
end;
|
||||
procvardef : begin
|
||||
|
||||
procvardef :
|
||||
begin
|
||||
{ proc -> procvar }
|
||||
if (def_from^.deftype=procdef) then
|
||||
begin
|
||||
@ -375,7 +393,9 @@ implementation
|
||||
b:=true;
|
||||
end;
|
||||
end;
|
||||
objectdef : begin
|
||||
|
||||
objectdef :
|
||||
begin
|
||||
{ object pascal objects }
|
||||
if (def_from^.deftype=objectdef) {and
|
||||
pobjectdef(def_from)^.isclass and pobjectdef(def_to)^.isclass }then
|
||||
@ -391,7 +411,9 @@ implementation
|
||||
b:=true;
|
||||
end;
|
||||
end;
|
||||
classrefdef : begin
|
||||
|
||||
classrefdef :
|
||||
begin
|
||||
{ class reference types }
|
||||
if (def_from^.deftype=classrefdef) then
|
||||
begin
|
||||
@ -407,7 +429,9 @@ implementation
|
||||
b:=true;
|
||||
end;
|
||||
end;
|
||||
filedef : begin
|
||||
|
||||
filedef :
|
||||
begin
|
||||
{ typed files are all equal to the abstract file type
|
||||
name TYPEDFILE in system.pp in is_equal in types.pas
|
||||
the problem is that it sholud be also compatible to FILE
|
||||
@ -441,6 +465,7 @@ implementation
|
||||
b:=true;
|
||||
end
|
||||
end;
|
||||
|
||||
else
|
||||
begin
|
||||
{ assignment overwritten ?? }
|
||||
@ -650,7 +675,11 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 1998-10-12 09:49:58 florian
|
||||
Revision 1.6 1998-10-14 12:53:38 peter
|
||||
* fixed small tp7 things
|
||||
* boolean:=longbool and longbool fixed
|
||||
|
||||
Revision 1.5 1998/10/12 09:49:58 florian
|
||||
+ support of <procedure var type>:=<pointer> in delphi mode added
|
||||
|
||||
Revision 1.4 1998/09/30 16:42:52 peter
|
||||
|
@ -379,6 +379,7 @@ implementation
|
||||
case p^.treetype of
|
||||
andn,orn : begin
|
||||
calcregisters(p,0,0,0);
|
||||
make_bool_equal_size(p);
|
||||
p^.location.loc:=LOC_JUMP;
|
||||
end;
|
||||
unequaln,
|
||||
@ -406,7 +407,6 @@ implementation
|
||||
p^.treetype:=equaln;
|
||||
end;
|
||||
end;
|
||||
|
||||
make_bool_equal_size(p);
|
||||
calcregisters(p,1,0,0);
|
||||
end
|
||||
@ -905,7 +905,11 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.3 1998-10-11 14:31:19 peter
|
||||
Revision 1.4 1998-10-14 12:53:39 peter
|
||||
* fixed small tp7 things
|
||||
* boolean:=longbool and longbool fixed
|
||||
|
||||
Revision 1.3 1998/10/11 14:31:19 peter
|
||||
+ checks for division by zero
|
||||
|
||||
Revision 1.2 1998/10/05 21:33:31 peter
|
||||
|
Loading…
Reference in New Issue
Block a user