* aligntoptr needs to use unsigned calculations, patch by Thomas

git-svn-id: trunk@1148 -
This commit is contained in:
peter 2005-09-20 13:53:54 +00:00
parent 32fa578b58
commit 22a20e15e4

View File

@ -310,10 +310,10 @@ type
function aligntoptr(p : pointer) : pointer;
begin
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
if (ptrint(p) mod sizeof(ptrint))<>0 then
inc(ptrint(p),sizeof(ptrint)-ptrint(p) mod sizeof(ptrint));
if (ptruint(p) and (sizeof(ptruint)-1))<>0 then
ptruint(p) := (ptruint(p) + sizeof(ptruint) - 1) and not (sizeof(ptruint) - 1);
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
result:=p;
aligntoptr:=p;
end;