* made resultype_char_to_char a little bit robuster

This commit is contained in:
florian 2001-05-13 15:43:46 +00:00
parent b9cb031a39
commit f56c9c6855

View File

@ -457,20 +457,24 @@ implementation
hp : tordconstnode; hp : tordconstnode;
begin begin
result:=nil; result:=nil;
if torddef(resulttype.def).typ=uchar then if (torddef(resulttype.def).typ=uchar) and
(torddef(left.resulttype.def).typ=uwidechar) then
begin begin
hp:=cordconstnode.create( hp:=cordconstnode.create(
ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),cchartype); ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),cchartype);
resulttypepass(hp); resulttypepass(hp);
result:=hp; result:=hp;
end end
else else if (torddef(resulttype.def).typ=uwidechar) and
(torddef(left.resulttype.def).typ=uchar) then
begin begin
hp:=cordconstnode.create( hp:=cordconstnode.create(
asciichar2unicode(chr(tordconstnode(left).value)),cwidechartype); asciichar2unicode(chr(tordconstnode(left).value)),cwidechartype);
resulttypepass(hp); resulttypepass(hp);
result:=hp; result:=hp;
end; end
else
internalerror(200105131);
end; end;
@ -1363,7 +1367,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.27 2001-05-08 21:06:30 florian Revision 1.28 2001-05-13 15:43:46 florian
* made resultype_char_to_char a little bit robuster
Revision 1.27 2001/05/08 21:06:30 florian
* some more support for widechars commited especially * some more support for widechars commited especially
regarding type casting and constants regarding type casting and constants