* 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 -
This commit is contained in:
Jonas Maebe 2008-09-04 21:42:51 +00:00
parent 65f5557fc4
commit af05770a7c

View File

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