mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 19:09:16 +02:00
* merged fixes branch fixes
This commit is contained in:
parent
d1376c5cdb
commit
12a3b11cdb
@ -745,30 +745,40 @@ end;
|
|||||||
|
|
||||||
procedure int_str(l : longint;var s : string);
|
procedure int_str(l : longint;var s : string);
|
||||||
var
|
var
|
||||||
sign : boolean;
|
value: longint;
|
||||||
begin
|
negative: boolean;
|
||||||
{ Workaround: }
|
|
||||||
if l=$80000000 then
|
begin
|
||||||
begin
|
negative := false;
|
||||||
s:='-2147483648';
|
s:='';
|
||||||
exit;
|
{ Workaround: }
|
||||||
end;
|
if l=$80000000 then
|
||||||
if l<0 then
|
begin
|
||||||
begin
|
s:='-2147483648';
|
||||||
sign:=true;
|
exit;
|
||||||
l:=-l;
|
end;
|
||||||
end
|
{ handle case where l = 0 }
|
||||||
else
|
if l = 0 then
|
||||||
sign:=false;
|
begin
|
||||||
s:='';
|
s:='0';
|
||||||
while l>0 do
|
exit;
|
||||||
begin
|
end;
|
||||||
s:=char(ord('0')+(l mod 10))+s;
|
If l < 0 then
|
||||||
l:=l div 10;
|
begin
|
||||||
end;
|
negative := true;
|
||||||
if sign then
|
value:=abs(l);
|
||||||
s:='-'+s;
|
end
|
||||||
end;
|
else
|
||||||
|
value:=l;
|
||||||
|
{ handle non-zero case }
|
||||||
|
while value>0 do
|
||||||
|
begin
|
||||||
|
s:=char((value mod 10)+ord('0'))+s;
|
||||||
|
value := value div 10;
|
||||||
|
end;
|
||||||
|
if negative then
|
||||||
|
s := '-' + s;
|
||||||
|
end;
|
||||||
|
|
||||||
{$endif ndef FPC_SYSTEM_HAS_INT_STR_LONGINT}
|
{$endif ndef FPC_SYSTEM_HAS_INT_STR_LONGINT}
|
||||||
|
|
||||||
@ -777,6 +787,11 @@ end;
|
|||||||
procedure int_str(l : cardinal;var s : string);
|
procedure int_str(l : cardinal;var s : string);
|
||||||
begin
|
begin
|
||||||
s:='';
|
s:='';
|
||||||
|
if l = 0 then
|
||||||
|
begin
|
||||||
|
s := '0';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
while l>0 do
|
while l>0 do
|
||||||
begin
|
begin
|
||||||
s:=char(ord('0')+(l mod 10))+s;
|
s:=char(ord('0')+(l mod 10))+s;
|
||||||
@ -811,7 +826,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2001-05-16 17:44:25 jonas
|
Revision 1.12 2001-05-18 22:59:59 peter
|
||||||
|
* merged fixes branch fixes
|
||||||
|
|
||||||
|
Revision 1.11 2001/05/16 17:44:25 jonas
|
||||||
+ odd() for cardinal, int64 and qword (merged)
|
+ odd() for cardinal, int64 and qword (merged)
|
||||||
|
|
||||||
Revision 1.10 2001/05/09 19:57:07 peter
|
Revision 1.10 2001/05/09 19:57:07 peter
|
||||||
|
@ -95,7 +95,11 @@
|
|||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_SET_IN_BYTE}
|
{$ifndef FPC_SYSTEM_HAS_FPC_SET_IN_BYTE}
|
||||||
function do_in_byte(p : pointer;b : byte):boolean;[public,alias:'FPC_SET_IN_BYTE'];
|
|
||||||
|
{ saveregisters is a bit of overkill, but this routine should save all registers }
|
||||||
|
{ and it should be overriden for each platform and be written in assembler }
|
||||||
|
{ by saving all required registers. }
|
||||||
|
function do_in_byte(p : pointer;b : byte):boolean;[public,alias:'FPC_SET_IN_BYTE'];saveregisters;
|
||||||
{
|
{
|
||||||
tests if the element b is in the set p the carryflag is set if it present
|
tests if the element b is in the set p the carryflag is set if it present
|
||||||
}
|
}
|
||||||
@ -167,7 +171,10 @@
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_SET_COMP_SETS}
|
{$ifndef FPC_SYSTEM_HAS_FPC_SET_COMP_SETS}
|
||||||
function do_comp_sets(set1,set2 : pointer):boolean;[public,alias:'FPC_SET_COMP_SETS'];
|
{ saveregisters is a bit of overkill, but this routine should save all registers }
|
||||||
|
{ and it should be overriden for each platform and be written in assembler }
|
||||||
|
{ by saving all required registers. }
|
||||||
|
function do_comp_sets(set1,set2 : pointer):boolean;[public,alias:'FPC_SET_COMP_SETS'];saveregisters;
|
||||||
{
|
{
|
||||||
compares set1 and set2 zeroflag is set if they are equal
|
compares set1 and set2 zeroflag is set if they are equal
|
||||||
}
|
}
|
||||||
@ -185,7 +192,10 @@
|
|||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_FPC_SET_CONTAINS_SET}
|
{$ifndef FPC_SYSTEM_HAS_FPC_SET_CONTAINS_SET}
|
||||||
function do_contains_sets(set1,set2 : pointer):boolean;[public,alias:'FPC_SET_CONTAINS_SETS'];
|
{ saveregisters is a bit of overkill, but this routine should save all registers }
|
||||||
|
{ and it should be overriden for each platform and be written in assembler }
|
||||||
|
{ by saving all required registers. }
|
||||||
|
function do_contains_sets(set1,set2 : pointer):boolean;[public,alias:'FPC_SET_CONTAINS_SETS'];saveregisters;
|
||||||
{
|
{
|
||||||
on exit, zero flag is set if set1 <= set2 (set2 contains set1)
|
on exit, zero flag is set if set1 <= set2 (set2 contains set1)
|
||||||
}
|
}
|
||||||
@ -202,7 +212,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2001-05-09 19:57:07 peter
|
Revision 1.3 2001-05-18 22:59:59 peter
|
||||||
|
* merged fixes branch fixes
|
||||||
|
|
||||||
|
Revision 1.2 2001/05/09 19:57:07 peter
|
||||||
*** empty log message ***
|
*** empty log message ***
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user