* more ptruint type casts to avoid 64 bit comparisons on 32 bit

platforms

git-svn-id: trunk@9693 -
This commit is contained in:
Jonas Maebe 2008-01-09 18:32:37 +00:00
parent 284ebc9d4a
commit 588822b14d
2 changed files with 4 additions and 4 deletions

View File

@ -828,7 +828,7 @@ begin
maximum of $ffff elements are allowed, otherwise
there will be an overflow }
chunksize := chunkindex shl blockshift;
if size-chunksize>maxsize then
if ptruint(size-chunksize)>maxsize then
HandleError(204);
{ we need to align the user pointers to 8 byte at least for
mmx/sse and doubles on sparc, align to 16 bytes }
@ -839,7 +839,7 @@ begin
repeat
pmc^.size := fixedsizeflag or chunksize or (i shl fixedoffsetshift);
inc(i, chunksize);
if i > size - chunksize then break;
if i > ptruint(size - chunksize) then break;
pmc_next := pmemchunk_fixed(pointer(pmc)+chunksize);
pmc^.next_fixed := pmc_next;
pmc_next^.prev_fixed := pmc;
@ -858,7 +858,7 @@ begin
mmx/sse and doubles on sparc, align to 16 bytes }
result := pointer(poc)+varfirstoffset;
pmcv := pmemchunk_var(result);
pmcv^.size := ((size-varfirstoffset) and sizemask) or (firstblockflag or lastblockflag);
pmcv^.size := (ptruint(size-varfirstoffset) and sizemask) or (firstblockflag or lastblockflag);
pmcv^.prevsize := 0;
pmcv^.freelists := loc_freelists;
append_to_list_var(pmcv);

View File

@ -1652,7 +1652,7 @@ function UnicodeToUtf8(Dest: PChar; MaxDestBytes: SizeUInt; Source: PWideChar; S
inc(i);
end;
if j>MaxDestBytes-1 then
if j>SizeUInt(MaxDestBytes-1) then
j:=MaxDestBytes-1;
Dest[j]:=#0;