Преглед изворни кода

* fixed alignment code in generic fillchar (not sure why
tests/test/tfillchr didn't fail in the nightly sparc tests)

git-svn-id: trunk@11708 -

Jonas Maebe пре 17 година
родитељ
комит
af05770a7c
1 измењених фајлова са 2 додато и 4 уклоњено
  1. 2 4
      rtl/inc/generic.inc

+ 2 - 4
rtl/inc/generic.inc

@@ -114,7 +114,6 @@ end;
 {$ifndef FPC_SYSTEM_HAS_FILLCHAR}
 Procedure FillChar(var x;count:SizeInt;value:byte);
 var
-  aligncount : sizeint;
   pdest,pend : pbyte;
   v : ptruint;
 begin
@@ -128,9 +127,8 @@ begin
       if sizeof(ptruint)=8 then
         v:=(v shl 32) or v;
       { Align on native pointer size }
-      aligncount:=(PtrUInt(pdest) and (sizeof(PtrUInt)-1));
-      dec(count,aligncount);
-      pend:=pdest+aligncount;
+      pend:=pbyte(align(pdest,sizeof(PtrUInt));
+      dec(count,pend-dest);
       while pdest<pend do
         begin
           pdest^:=value;