mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 12:31:01 +02:00
* some things regarding ansistrings fixed
This commit is contained in:
parent
150f565d58
commit
84e20b561c
@ -400,10 +400,10 @@ implementation
|
|||||||
{$ifdef UseAnsiString}
|
{$ifdef UseAnsiString}
|
||||||
{ does anybody know a better solution than this big case statement ? }
|
{ does anybody know a better solution than this big case statement ? }
|
||||||
{ ok, a proc table would do the job }
|
{ ok, a proc table would do the job }
|
||||||
case pstringdef(p)^.string_typ of
|
case pstringdef(p^.resulttype)^.string_typ of
|
||||||
|
|
||||||
st_shortstring:
|
st_shortstring:
|
||||||
case pstringdef(p^.left)^.string_typ of
|
case pstringdef(p^.left^.resulttype)^.string_typ of
|
||||||
st_shortstring:
|
st_shortstring:
|
||||||
begin
|
begin
|
||||||
stringdispose(p^.location.reference.symbol);
|
stringdispose(p^.location.reference.symbol);
|
||||||
@ -419,8 +419,8 @@ implementation
|
|||||||
end;
|
end;
|
||||||
st_ansistring:
|
st_ansistring:
|
||||||
begin
|
begin
|
||||||
{!!!!!!!}
|
gettempofsizereference(p^.resulttype^.size,p^.location.reference);
|
||||||
internalerror(8888);
|
loadansi2short(p^.left,p);
|
||||||
end;
|
end;
|
||||||
st_widestring:
|
st_widestring:
|
||||||
begin
|
begin
|
||||||
@ -1253,7 +1253,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.20 1998-09-17 09:42:12 peter
|
Revision 1.21 1998-09-20 17:46:47 florian
|
||||||
|
* some things regarding ansistrings fixed
|
||||||
|
|
||||||
|
Revision 1.20 1998/09/17 09:42:12 peter
|
||||||
+ pass_2 for cg386
|
+ pass_2 for cg386
|
||||||
* Message() -> CGMessage() for pass_1/pass_2
|
* Message() -> CGMessage() for pass_1/pass_2
|
||||||
|
|
||||||
|
@ -253,6 +253,7 @@ implementation
|
|||||||
hregister : tregister;
|
hregister : tregister;
|
||||||
loc : tloc;
|
loc : tloc;
|
||||||
r : preference;
|
r : preference;
|
||||||
|
pushed : tpushed;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
otlabel:=truelabel;
|
otlabel:=truelabel;
|
||||||
@ -350,13 +351,19 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif UseAnsiString}
|
{$endif UseAnsiString}
|
||||||
if not (p^.concat_string) then
|
if is_shortstring(p^.left^.resulttype) and
|
||||||
|
not (p^.concat_string) then
|
||||||
begin
|
begin
|
||||||
{ we do not need destination anymore }
|
if is_ansistring(p^.right^.resulttype) then
|
||||||
del_reference(p^.left^.location.reference);
|
loadansi2short(p^.right,p^.left)
|
||||||
del_reference(p^.right^.location.reference);
|
else
|
||||||
loadstring(p);
|
begin
|
||||||
ungetiftemp(p^.right^.location.reference);
|
{ we do not need destination anymore }
|
||||||
|
del_reference(p^.left^.location.reference);
|
||||||
|
del_reference(p^.right^.location.reference);
|
||||||
|
loadstring(p);
|
||||||
|
ungetiftemp(p^.right^.location.reference);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -552,7 +559,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 1998-09-17 09:42:16 peter
|
Revision 1.16 1998-09-20 17:46:48 florian
|
||||||
|
* some things regarding ansistrings fixed
|
||||||
|
|
||||||
|
Revision 1.15 1998/09/17 09:42:16 peter
|
||||||
+ pass_2 for cg386
|
+ pass_2 for cg386
|
||||||
* Message() -> CGMessage() for pass_1/pass_2
|
* Message() -> CGMessage() for pass_1/pass_2
|
||||||
|
|
||||||
|
@ -493,14 +493,17 @@ unit pass_1;
|
|||||||
else
|
else
|
||||||
|
|
||||||
{ nil is compatible with ansi- and wide strings }
|
{ nil is compatible with ansi- and wide strings }
|
||||||
|
{ no, that isn't true, (FK)
|
||||||
if (fromtreetype=niln) and (def_to^.deftype=stringdef)
|
if (fromtreetype=niln) and (def_to^.deftype=stringdef)
|
||||||
and (pstringdef(def_to)^.string_typ in [st_ansistring,st_widestring]) then
|
and (pstringdef(def_to)^.string_typ in [st_ansistring,st_widestring]) then
|
||||||
begin
|
begin
|
||||||
doconv:=tc_equal;
|
doconv:=tc_equal;
|
||||||
b:=true;
|
b:=true;
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
{ ansi- and wide strings can be assigned to void pointers }
|
{ ansi- and wide strings can be assigned to void pointers }
|
||||||
|
{ no, (FK)
|
||||||
if (def_from^.deftype=stringdef) and
|
if (def_from^.deftype=stringdef) and
|
||||||
(pstringdef(def_from)^.string_typ in [st_ansistring,st_widestring]) and
|
(pstringdef(def_from)^.string_typ in [st_ansistring,st_widestring]) and
|
||||||
(def_to^.deftype=pointerdef) and
|
(def_to^.deftype=pointerdef) and
|
||||||
@ -510,8 +513,11 @@ unit pass_1;
|
|||||||
doconv:=tc_equal;
|
doconv:=tc_equal;
|
||||||
b:=true;
|
b:=true;
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
{ ansistrings can be assigned to pchar }
|
}
|
||||||
|
{ ansistrings can be assigned to pchar
|
||||||
|
this needs an explicit type cast (FK)
|
||||||
if is_ansistring(def_from) and
|
if is_ansistring(def_from) and
|
||||||
(def_to^.deftype=pointerdef) and
|
(def_to^.deftype=pointerdef) and
|
||||||
(ppointerdef(def_to)^.definition^.deftype=orddef) and
|
(ppointerdef(def_to)^.definition^.deftype=orddef) and
|
||||||
@ -521,6 +527,7 @@ unit pass_1;
|
|||||||
b:=true;
|
b:=true;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
}
|
||||||
{ pchar can be assigned to ansistrings }
|
{ pchar can be assigned to ansistrings }
|
||||||
if ((def_from^.deftype=pointerdef) and
|
if ((def_from^.deftype=pointerdef) and
|
||||||
(ppointerdef(def_from)^.definition^.deftype=orddef) and
|
(ppointerdef(def_from)^.definition^.deftype=orddef) and
|
||||||
@ -1957,7 +1964,8 @@ unit pass_1;
|
|||||||
|
|
||||||
if is_shortstring(p^.left^.resulttype) and (assigned(p^.right^.resulttype)) then
|
if is_shortstring(p^.left^.resulttype) and (assigned(p^.right^.resulttype)) then
|
||||||
begin
|
begin
|
||||||
if not ((p^.right^.resulttype^.deftype=stringdef) or
|
if not (is_shortstring(p^.right^.resulttype) or
|
||||||
|
is_ansistring(p^.right^.resulttype) or
|
||||||
((p^.right^.resulttype^.deftype=orddef) and (porddef(p^.right^.resulttype)^.typ=uchar))) then
|
((p^.right^.resulttype^.deftype=orddef) and (porddef(p^.right^.resulttype)^.typ=uchar))) then
|
||||||
begin
|
begin
|
||||||
p^.right:=gentypeconvnode(p^.right,p^.left^.resulttype);
|
p^.right:=gentypeconvnode(p^.right,p^.left^.resulttype);
|
||||||
@ -2238,7 +2246,12 @@ unit pass_1;
|
|||||||
pstringdef(p^.left^.resulttype)^.string_typ then
|
pstringdef(p^.left^.resulttype)^.string_typ then
|
||||||
begin
|
begin
|
||||||
if p^.left^.treetype=stringconstn then
|
if p^.left^.treetype=stringconstn then
|
||||||
p^.left^.stringtype:=pstringdef(p^.resulttype)^.string_typ
|
begin
|
||||||
|
p^.left^.stringtype:=pstringdef(p^.resulttype)^.string_typ;
|
||||||
|
{ we don't have to do anything, the const }
|
||||||
|
{ node generates an ansistring }
|
||||||
|
p^.convtyp:=tc_equal;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
procinfo.flags:=procinfo.flags or pi_do_call;
|
procinfo.flags:=procinfo.flags or pi_do_call;
|
||||||
end;
|
end;
|
||||||
@ -5502,7 +5515,10 @@ unit pass_1;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.85 1998-09-17 09:42:38 peter
|
Revision 1.86 1998-09-20 17:46:50 florian
|
||||||
|
* some things regarding ansistrings fixed
|
||||||
|
|
||||||
|
Revision 1.85 1998/09/17 09:42:38 peter
|
||||||
+ pass_2 for cg386
|
+ pass_2 for cg386
|
||||||
* Message() -> CGMessage() for pass_1/pass_2
|
* Message() -> CGMessage() for pass_1/pass_2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user