Quellcode durchsuchen

Merged revisions 11708,11711 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r11708 | jonas | 2008-09-04 22:42:51 +0100 (Thu, 04 Sep 2008) | 3 lines

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

........
r11711 | jonas | 2008-09-05 14:14:41 +0100 (Fri, 05 Sep 2008) | 4 lines

* fixed syntax errors in r11708 (and it wasn't tested in the nightly
Sparc regressions tests because Solaris is an FPC_USE_LIBC platform,
and these use memset rather than the generic fillchar)

........

git-svn-id: branches/fixes_2_2@11714 -

Jonas Maebe vor 17 Jahren
Ursprung
Commit
1c2510adf5
1 geänderte Dateien mit 2 neuen und 4 gelöschten Zeilen
  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-pdest);
       while pdest<pend do
         begin
           pdest^:=value;