mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:29:17 +02:00
* fixed web bug #1665 (allow char to chararray type conversion) ("merged")
This commit is contained in:
parent
887f6ba34c
commit
a87a30b831
@ -385,6 +385,7 @@ implementation
|
|||||||
@second_nothing, {not_possible}
|
@second_nothing, {not_possible}
|
||||||
@second_nothing, {second_string_to_string, handled in resulttype pass }
|
@second_nothing, {second_string_to_string, handled in resulttype pass }
|
||||||
@second_char_to_string,
|
@second_char_to_string,
|
||||||
|
@second_nothing, {char_to_charray}
|
||||||
@second_nothing, { pchar_to_string, handled in resulttype pass }
|
@second_nothing, { pchar_to_string, handled in resulttype pass }
|
||||||
@second_nothing, {cchar_to_pchar}
|
@second_nothing, {cchar_to_pchar}
|
||||||
@second_cstring_to_pchar,
|
@second_cstring_to_pchar,
|
||||||
@ -490,7 +491,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.26 2001-09-30 21:28:34 peter
|
Revision 1.27 2001-11-02 23:24:12 jonas
|
||||||
|
* fixed web bug 1665 (allow char to chararray type conversion) ("merged")
|
||||||
|
|
||||||
|
Revision 1.26 2001/09/30 21:28:34 peter
|
||||||
* int64->boolean fixed
|
* int64->boolean fixed
|
||||||
|
|
||||||
Revision 1.25 2001/09/30 16:12:47 jonas
|
Revision 1.25 2001/09/30 16:12:47 jonas
|
||||||
|
@ -46,6 +46,7 @@ interface
|
|||||||
function resulttype_string_to_chararray : tnode;
|
function resulttype_string_to_chararray : tnode;
|
||||||
function resulttype_string_to_string : tnode;
|
function resulttype_string_to_string : tnode;
|
||||||
function resulttype_char_to_string : tnode;
|
function resulttype_char_to_string : tnode;
|
||||||
|
function resulttype_char_to_chararray : tnode;
|
||||||
function resulttype_int_to_real : tnode;
|
function resulttype_int_to_real : tnode;
|
||||||
function resulttype_real_to_real : tnode;
|
function resulttype_real_to_real : tnode;
|
||||||
function resulttype_cchar_to_pchar : tnode;
|
function resulttype_cchar_to_pchar : tnode;
|
||||||
@ -591,6 +592,24 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ttypeconvnode.resulttype_char_to_chararray : tnode;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if resulttype.def.size <> 1 then
|
||||||
|
begin
|
||||||
|
{ convert first to string, then to chararray }
|
||||||
|
inserttypeconv(left,cshortstringtype);
|
||||||
|
inserttypeconv(left,resulttype);
|
||||||
|
result:=left;
|
||||||
|
left := nil;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
result := nil;
|
||||||
|
{ a chararray with 1 element is the same as a char }
|
||||||
|
set_location(location,left.location);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ttypeconvnode.resulttype_char_to_char : tnode;
|
function ttypeconvnode.resulttype_char_to_char : tnode;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -720,6 +739,7 @@ implementation
|
|||||||
{not_possible} nil,
|
{not_possible} nil,
|
||||||
{ string_2_string } @ttypeconvnode.resulttype_string_to_string,
|
{ string_2_string } @ttypeconvnode.resulttype_string_to_string,
|
||||||
{ char_2_string } @ttypeconvnode.resulttype_char_to_string,
|
{ char_2_string } @ttypeconvnode.resulttype_char_to_string,
|
||||||
|
{ char_2_chararray } @ttypeconvnode.resulttype_char_to_chararray,
|
||||||
{ pchar_2_string } @ttypeconvnode.resulttype_pchar_to_string,
|
{ pchar_2_string } @ttypeconvnode.resulttype_pchar_to_string,
|
||||||
{ cchar_2_pchar } @ttypeconvnode.resulttype_cchar_to_pchar,
|
{ cchar_2_pchar } @ttypeconvnode.resulttype_cchar_to_pchar,
|
||||||
{ cstring_2_pchar } @ttypeconvnode.resulttype_cstring_to_pchar,
|
{ cstring_2_pchar } @ttypeconvnode.resulttype_cstring_to_pchar,
|
||||||
@ -1361,6 +1381,7 @@ implementation
|
|||||||
@ttypeconvnode.first_nothing, {not_possible}
|
@ttypeconvnode.first_nothing, {not_possible}
|
||||||
nil, { removed in resulttype_string_to_string }
|
nil, { removed in resulttype_string_to_string }
|
||||||
@ttypeconvnode.first_char_to_string,
|
@ttypeconvnode.first_char_to_string,
|
||||||
|
@ttypeconvnode.first_nothing, { char_2_chararray, needs nothing extra }
|
||||||
nil, { removed in resulttype_chararray_to_string }
|
nil, { removed in resulttype_chararray_to_string }
|
||||||
@ttypeconvnode.first_cchar_to_pchar,
|
@ttypeconvnode.first_cchar_to_pchar,
|
||||||
@ttypeconvnode.first_cstring_to_pchar,
|
@ttypeconvnode.first_cstring_to_pchar,
|
||||||
@ -1597,7 +1618,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.43 2001-11-02 22:58:02 peter
|
Revision 1.44 2001-11-02 23:24:11 jonas
|
||||||
|
* fixed web bug 1665 (allow char to chararray type conversion) ("merged")
|
||||||
|
|
||||||
|
Revision 1.43 2001/11/02 22:58:02 peter
|
||||||
* procsym definition rewrite
|
* procsym definition rewrite
|
||||||
|
|
||||||
Revision 1.42 2001/10/28 17:22:25 peter
|
Revision 1.42 2001/10/28 17:22:25 peter
|
||||||
|
@ -163,6 +163,7 @@ interface
|
|||||||
tc_not_possible,
|
tc_not_possible,
|
||||||
tc_string_2_string,
|
tc_string_2_string,
|
||||||
tc_char_2_string,
|
tc_char_2_string,
|
||||||
|
tc_char_2_chararray,
|
||||||
tc_pchar_2_string,
|
tc_pchar_2_string,
|
||||||
tc_cchar_2_pchar,
|
tc_cchar_2_pchar,
|
||||||
tc_cstring_2_pchar,
|
tc_cstring_2_pchar,
|
||||||
@ -1548,6 +1549,15 @@ implementation
|
|||||||
b:=1;
|
b:=1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
orddef:
|
||||||
|
begin
|
||||||
|
if is_chararray(def_to) and
|
||||||
|
is_char(def_from) then
|
||||||
|
begin
|
||||||
|
doconv:=tc_char_2_chararray;
|
||||||
|
b:=2;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
recorddef :
|
recorddef :
|
||||||
begin
|
begin
|
||||||
{ tvarrec -> array of constconst }
|
{ tvarrec -> array of constconst }
|
||||||
@ -1858,7 +1868,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.55 2001-11-02 22:58:09 peter
|
Revision 1.56 2001-11-02 23:24:12 jonas
|
||||||
|
* fixed web bug 1665 (allow char to chararray type conversion) ("merged")
|
||||||
|
|
||||||
|
Revision 1.55 2001/11/02 22:58:09 peter
|
||||||
* procsym definition rewrite
|
* procsym definition rewrite
|
||||||
|
|
||||||
Revision 1.54 2001/10/28 17:22:25 peter
|
Revision 1.54 2001/10/28 17:22:25 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user