[PATCH] * use the sizes of the floatx80 and float128 structs for arrays having their...
authorsvenbarth <pascaldragon@googlemail.com>
Sun, 25 Oct 2020 15:36:31 +0000 (15:36 +0000)
committerAbou Al Montacir <abou.almontacir@sfr.fr>
Fri, 5 Jan 2024 07:40:08 +0000 (08:40 +0100)
git-svn-id: trunk@47198 -
(cherry picked from commit 16eb670e67cc8243cf2122e992f1cebf00cf4904)

Gbp-Pq: Name 0-dba65567f1b2fb3fd283886b262dc72875a6360b.patch

fpcsrc/rtl/inc/ufloat128.pp
fpcsrc/rtl/inc/ufloatx80.pp

index 59388cc1e37ec3fcd5388b30ce937efe18f8be99..14c4339479e1f0a7cda1725b1137e4a381a6a190 100644 (file)
@@ -39,11 +39,11 @@ unit ufloat128;
 
     procedure DumpFloat128(const f : float128);
       type
-        ta = packed array[0..15] of byte;
+        ta = packed array[0..SizeOf(float128)-1] of byte;
       var
         i : longint;
       begin
-        for i:=15 downto 0 do
+        for i:=SizeOf(float128)-1 downto 0 do
           begin
             write(hexstr(ta(f)[i],2));
             if i<15 then
index 17bd822d408c0736e9937e921dee64ce827e4012..7927bca19dcbbefa2326eef14b1ab41e6671e011 100644 (file)
@@ -39,11 +39,11 @@ unit ufloatx80;
 
     procedure DumpFloatx80(const f : floatx80);
       type
-        ta = packed array[0..15] of byte;
+        ta = packed array[0..SizeOf(floatx80)-1] of byte;
       var
         i : longint;
       begin
-        for i:=15 downto 0 do
+        for i:=SizeOf(floatx80)-1 downto 0 do
           begin
             write(hexstr(ta(f)[i],2));
             if i<15 then