mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:59:08 +02:00
* Use fpc_Write_Text_Currency and fpc_Read_Text_Currency for currency.
git-svn-id: trunk@5875 -
This commit is contained in:
parent
71961bb8ce
commit
b3c82a05c5
@ -602,117 +602,119 @@ implementation
|
|||||||
para.left:=p1;
|
para.left:=p1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Currency will be written using the bestreal }
|
|
||||||
if is_currency(para.left.resultdef) then
|
if is_currency(para.left.resultdef) then
|
||||||
inserttypeconv(para.left,pbestrealtype^);
|
begin
|
||||||
|
is_real:=true;
|
||||||
case para.left.resultdef.typ of
|
name := procprefix+'currency';
|
||||||
stringdef :
|
end
|
||||||
begin
|
else
|
||||||
name := procprefix+tstringdef(para.left.resultdef).stringtypname;
|
case para.left.resultdef.typ of
|
||||||
end;
|
stringdef :
|
||||||
pointerdef :
|
begin
|
||||||
begin
|
name := procprefix+tstringdef(para.left.resultdef).stringtypname;
|
||||||
if (not is_pchar(para.left.resultdef)) or do_read then
|
end;
|
||||||
begin
|
pointerdef :
|
||||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
begin
|
||||||
error_para := true;
|
if (not is_pchar(para.left.resultdef)) or do_read then
|
||||||
end
|
|
||||||
else
|
|
||||||
name := procprefix+'pchar_as_pointer';
|
|
||||||
end;
|
|
||||||
floatdef :
|
|
||||||
begin
|
|
||||||
is_real:=true;
|
|
||||||
name := procprefix+'float';
|
|
||||||
readfunctype:=pbestrealtype^;
|
|
||||||
end;
|
|
||||||
orddef :
|
|
||||||
begin
|
|
||||||
case torddef(para.left.resultdef).ordtype of
|
|
||||||
{$ifdef cpu64bit}
|
|
||||||
s64bit,
|
|
||||||
{$endif cpu64bit}
|
|
||||||
s8bit,
|
|
||||||
s16bit,
|
|
||||||
s32bit :
|
|
||||||
begin
|
begin
|
||||||
name := procprefix+'sint';
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
readfunctype:=sinttype;
|
error_para := true;
|
||||||
end;
|
|
||||||
{$ifdef cpu64bit}
|
|
||||||
u64bit,
|
|
||||||
{$endif cpu64bit}
|
|
||||||
u8bit,
|
|
||||||
u16bit,
|
|
||||||
u32bit :
|
|
||||||
begin
|
|
||||||
name := procprefix+'uint';
|
|
||||||
readfunctype:=uinttype;
|
|
||||||
end;
|
|
||||||
uchar :
|
|
||||||
begin
|
|
||||||
name := procprefix+'char';
|
|
||||||
readfunctype:=cchartype;
|
|
||||||
end;
|
|
||||||
uwidechar :
|
|
||||||
begin
|
|
||||||
name := procprefix+'widechar';
|
|
||||||
readfunctype:=cwidechartype;
|
|
||||||
end;
|
|
||||||
{$ifndef cpu64bit}
|
|
||||||
s64bit :
|
|
||||||
begin
|
|
||||||
name := procprefix+'int64';
|
|
||||||
readfunctype:=s64inttype;
|
|
||||||
end;
|
|
||||||
u64bit :
|
|
||||||
begin
|
|
||||||
name := procprefix+'qword';
|
|
||||||
readfunctype:=u64inttype;
|
|
||||||
end;
|
|
||||||
{$endif cpu64bit}
|
|
||||||
bool8bit,
|
|
||||||
bool16bit,
|
|
||||||
bool32bit,
|
|
||||||
bool64bit:
|
|
||||||
begin
|
|
||||||
if do_read then
|
|
||||||
begin
|
|
||||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
|
||||||
error_para := true;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
name := procprefix+'boolean';
|
|
||||||
readfunctype:=booltype;
|
|
||||||
end;
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
name := procprefix+'pchar_as_pointer';
|
||||||
|
end;
|
||||||
|
floatdef :
|
||||||
|
begin
|
||||||
|
is_real:=true;
|
||||||
|
name := procprefix+'float';
|
||||||
|
readfunctype:=pbestrealtype^;
|
||||||
|
end;
|
||||||
|
orddef :
|
||||||
|
begin
|
||||||
|
case torddef(para.left.resultdef).ordtype of
|
||||||
|
{$ifdef cpu64bit}
|
||||||
|
s64bit,
|
||||||
|
{$endif cpu64bit}
|
||||||
|
s8bit,
|
||||||
|
s16bit,
|
||||||
|
s32bit :
|
||||||
|
begin
|
||||||
|
name := procprefix+'sint';
|
||||||
|
readfunctype:=sinttype;
|
||||||
|
end;
|
||||||
|
{$ifdef cpu64bit}
|
||||||
|
u64bit,
|
||||||
|
{$endif cpu64bit}
|
||||||
|
u8bit,
|
||||||
|
u16bit,
|
||||||
|
u32bit :
|
||||||
|
begin
|
||||||
|
name := procprefix+'uint';
|
||||||
|
readfunctype:=uinttype;
|
||||||
|
end;
|
||||||
|
uchar :
|
||||||
|
begin
|
||||||
|
name := procprefix+'char';
|
||||||
|
readfunctype:=cchartype;
|
||||||
|
end;
|
||||||
|
uwidechar :
|
||||||
|
begin
|
||||||
|
name := procprefix+'widechar';
|
||||||
|
readfunctype:=cwidechartype;
|
||||||
|
end;
|
||||||
|
{$ifndef cpu64bit}
|
||||||
|
s64bit :
|
||||||
|
begin
|
||||||
|
name := procprefix+'int64';
|
||||||
|
readfunctype:=s64inttype;
|
||||||
|
end;
|
||||||
|
u64bit :
|
||||||
|
begin
|
||||||
|
name := procprefix+'qword';
|
||||||
|
readfunctype:=u64inttype;
|
||||||
|
end;
|
||||||
|
{$endif cpu64bit}
|
||||||
|
bool8bit,
|
||||||
|
bool16bit,
|
||||||
|
bool32bit,
|
||||||
|
bool64bit:
|
||||||
|
begin
|
||||||
|
if do_read then
|
||||||
|
begin
|
||||||
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
|
error_para := true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
name := procprefix+'boolean';
|
||||||
|
readfunctype:=booltype;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
|
error_para := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
variantdef :
|
||||||
|
name:=procprefix+'variant';
|
||||||
|
arraydef :
|
||||||
|
begin
|
||||||
|
if is_chararray(para.left.resultdef) then
|
||||||
|
name := procprefix+'pchar_as_array'
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
error_para := true;
|
error_para := true;
|
||||||
end;
|
end
|
||||||
end;
|
end
|
||||||
end;
|
else
|
||||||
variantdef :
|
begin
|
||||||
name:=procprefix+'variant';
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
arraydef :
|
error_para := true;
|
||||||
begin
|
end
|
||||||
if is_chararray(para.left.resultdef) then
|
end;
|
||||||
name := procprefix+'pchar_as_array'
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
|
||||||
error_para := true;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
|
||||||
error_para := true;
|
|
||||||
end
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ check for length/fractional colon para's }
|
{ check for length/fractional colon para's }
|
||||||
fracpara := nil;
|
fracpara := nil;
|
||||||
@ -779,11 +781,14 @@ implementation
|
|||||||
cordconstnode.create(-1,s32inttype,false),nil);
|
cordconstnode.create(-1,s32inttype,false),nil);
|
||||||
{ add it to the lenpara }
|
{ add it to the lenpara }
|
||||||
lenpara.right := fracpara;
|
lenpara.right := fracpara;
|
||||||
{ and add the realtype para (this also removes the link }
|
if not is_currency(para.left.resultdef) then
|
||||||
{ to any parameters coming after it) }
|
begin
|
||||||
fracpara.right := ccallparanode.create(
|
{ and add the realtype para (this also removes the link }
|
||||||
cordconstnode.create(ord(tfloatdef(para.left.resultdef).floattype),
|
{ to any parameters coming after it) }
|
||||||
s32inttype,true),nil);
|
fracpara.right := ccallparanode.create(
|
||||||
|
cordconstnode.create(ord(tfloatdef(para.left.resultdef).floattype),
|
||||||
|
s32inttype,true),nil);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user