Browse Source

* Replace more ptrint by ptruint.

git-svn-id: trunk@5003 -
daniel 19 years ago
parent
commit
badacd3808

+ 1 - 1
packages/base/paszlib/infblock.pas

@@ -812,7 +812,7 @@ begin
         {$IFDEF ZLIB_DEBUG}
         {$IFDEF ZLIB_DEBUG}
         if (ptruint(q) >= ptruint(s.read)) then
         if (ptruint(q) >= ptruint(s.read)) then
           Tracev('inflate:       codes end '+
           Tracev('inflate:       codes end '+
-              IntToStr(z.total_out + ptrint(q) - ptruint(s.read)) + ' total out')
+              IntToStr(z.total_out + ptruint(q) - ptruint(s.read)) + ' total out')
         else
         else
           Tracev('inflate:       codes end '+
           Tracev('inflate:       codes end '+
                   IntToStr(z.total_out + ptruint(s.zend) - ptruint(s.read) +
                   IntToStr(z.total_out + ptruint(s.zend) - ptruint(s.read) +

+ 9 - 9
packages/base/paszlib/inffast.pas

@@ -65,10 +65,10 @@ begin
   b := s.bitb;
   b := s.bitb;
   k := s.bitk;
   k := s.bitk;
   q := s.write;
   q := s.write;
-  if ptrint(q) < ptrint(s.read) then
-    m := cardinal(ptrint(s.read)-ptrint(q)-1)
+  if ptruint(q) < ptruint(s.read) then
+    m := cardinal(ptruint(s.read)-ptruint(q)-1)
   else
   else
-    m := cardinal(ptrint(s.zend)-ptrint(q));
+    m := cardinal(ptruint(s.zend)-ptruint(q));
 
 
   { initialize masks }
   { initialize masks }
   ml := inflate_mask[bl];
   ml := inflate_mask[bl];
@@ -161,7 +161,7 @@ begin
             {$ENDIF}
             {$ENDIF}
             { do the copy }
             { do the copy }
             dec(m, c);
             dec(m, c);
-            if (cardinal(ptrint(q) - ptrint(s.window)) >= d) then     { offset before dest }
+            if (cardinal(ptruint(q) - ptruint(s.window)) >= d) then     { offset before dest }
             begin                                  {  just copy }
             begin                                  {  just copy }
               r := q;
               r := q;
               dec(r, d);
               dec(r, d);
@@ -170,7 +170,7 @@ begin
             end
             end
             else                        { else offset after destination }
             else                        { else offset after destination }
             begin
             begin
-              e := d - cardinal(ptrint(q) - ptrint(s.window)); { bytes from offset to end }
+              e := d - cardinal(ptruint(q) - ptruint(s.window)); { bytes from offset to end }
               r := s.zend;
               r := s.zend;
               dec(r, e);                  { pointer to offset }
               dec(r, e);                  { pointer to offset }
               if (c > e) then             { if source crosses, }
               if (c > e) then             { if source crosses, }
@@ -213,7 +213,7 @@ begin
             s.bitb := b;
             s.bitb := b;
             s.bitk := k;
             s.bitk := k;
             z.avail_in := n;
             z.avail_in := n;
-            inc(z.total_in, ptrint(p)-ptrint(z.next_in));
+            inc(z.total_in, ptruint(p)-ptruint(z.next_in));
             z.next_in := p;
             z.next_in := p;
             s.write := q;
             s.write := q;
 
 
@@ -265,7 +265,7 @@ begin
           s.bitb := b;
           s.bitb := b;
           s.bitk := k;
           s.bitk := k;
           z.avail_in := n;
           z.avail_in := n;
-          inc(z.total_in, ptrint(p)-ptrint(z.next_in));
+          inc(z.total_in, ptruint(p)-ptruint(z.next_in));
           z.next_in := p;
           z.next_in := p;
           s.write := q;
           s.write := q;
           inflate_fast := Z_STREAM_END;
           inflate_fast := Z_STREAM_END;
@@ -285,7 +285,7 @@ begin
           s.bitb := b;
           s.bitb := b;
           s.bitk := k;
           s.bitk := k;
           z.avail_in := n;
           z.avail_in := n;
-          inc(z.total_in, ptrint(p)-ptrint(z.next_in));
+          inc(z.total_in, ptruint(p)-ptruint(z.next_in));
           z.next_in := p;
           z.next_in := p;
           s.write := q;
           s.write := q;
           inflate_fast := Z_DATA_ERROR;
           inflate_fast := Z_DATA_ERROR;
@@ -306,7 +306,7 @@ begin
   s.bitb := b;
   s.bitb := b;
   s.bitk := k;
   s.bitk := k;
   z.avail_in := n;
   z.avail_in := n;
-  inc(z.total_in, ptrint(p)-ptrint(z.next_in));
+  inc(z.total_in, ptruint(p)-ptruint(z.next_in));
   z.next_in := p;
   z.next_in := p;
   s.write := q;
   s.write := q;
   inflate_fast := Z_OK;
   inflate_fast := Z_OK;

+ 2 - 2
packages/base/paszlib/inftrees.pas

@@ -366,7 +366,7 @@ Begin
           r.exop := byte(j);     { bits in this table }
           r.exop := byte(j);     { bits in this table }
           j := i shr (w - l);
           j := i shr (w - l);
           {r.base := cardinal( q - u[h-1] -j);}   { offset to this table }
           {r.base := cardinal( q - u[h-1] -j);}   { offset to this table }
-          r.base := (ptrint(q) - ptrint(u[h-1]) ) div sizeof(q^) - j;
+          r.base := (ptruint(q) - ptruint(u[h-1]) ) div sizeof(q^) - j;
           huft_Ptr(u[h-1])^[j] := r;  { connect to last table }
           huft_Ptr(u[h-1])^[j] := r;  { connect to last table }
         end
         end
         else
         else
@@ -378,7 +378,7 @@ Begin
 
 
       { C-code: if (p >= v + n) - see ZUTIL.PAS for comments }
       { C-code: if (p >= v + n) - see ZUTIL.PAS for comments }
 
 
-      if ptrint(p)>=ptrint(@(v[n])) then  { also works under DPMI ?? }
+      if ptruint(p)>=ptruint(@(v[n])) then  { also works under DPMI ?? }
         r.exop := 128 + 64                  { out of values--invalid code }
         r.exop := 128 + 64                  { out of values--invalid code }
       else
       else
         if (p^ < s) then
         if (p^ < s) then

+ 4 - 4
packages/base/paszlib/infutil.pas

@@ -152,10 +152,10 @@ begin
   q := s.read;
   q := s.read;
 
 
   { compute number of bytes to copy as far as end of window }
   { compute number of bytes to copy as far as end of window }
-  if ptrint(q) <= ptrint(s.write) then
-    n := cardinal(ptrint(s.write) - ptrint(q))
+  if ptruint(q) <= ptruint(s.write) then
+    n := cardinal(ptruint(s.write) - ptruint(q))
   else
   else
-    n := cardinal(ptrint(s.zend) - ptrint(q));
+    n := cardinal(ptruint(s.zend) - ptruint(q));
   if (n > z.avail_out) then
   if (n > z.avail_out) then
     n := z.avail_out;
     n := z.avail_out;
   if (n <> 0) and (r = Z_BUF_ERROR) then
   if (n <> 0) and (r = Z_BUF_ERROR) then
@@ -187,7 +187,7 @@ begin
       s.write := s.window;
       s.write := s.window;
 
 
     { compute bytes to copy }
     { compute bytes to copy }
-    n := cardinal(ptrint(s.write) - ptrint(q));
+    n := cardinal(ptruint(s.write) - ptruint(q));
     if (n > z.avail_out) then
     if (n > z.avail_out) then
       n := z.avail_out;
       n := z.avail_out;
     if (n <> 0) and (r = Z_BUF_ERROR) then
     if (n <> 0) and (r = Z_BUF_ERROR) then

+ 25 - 25
packages/base/paszlib/zdeflate.pas

@@ -1113,7 +1113,7 @@ begin
   move(Pbyte(ss^.head)^,Pbyte(ds^.head)^,ds^.hash_size * sizeof(pos));
   move(Pbyte(ss^.head)^,Pbyte(ds^.head)^,ds^.hash_size * sizeof(pos));
   move(Pbyte(ss^.pending_buf)^,Pbyte(ds^.pending_buf)^,cardinal(ds^.pending_buf_size));
   move(Pbyte(ss^.pending_buf)^,Pbyte(ds^.pending_buf)^,cardinal(ds^.pending_buf_size));
 
 
-  ds^.pending_out := @ds^.pending_buf^[ptrint(ss^.pending_out) - ptrint(ss^.pending_buf)];
+  ds^.pending_out := @ds^.pending_buf^[ptruint(ss^.pending_out) - ptruint(ss^.pending_buf)];
   ds^.d_buf := Pwordarray(@overlay^[ds^.lit_bufsize div sizeof(word)] );
   ds^.d_buf := Pwordarray(@overlay^[ds^.lit_bufsize div sizeof(word)] );
   ds^.l_buf := Pbytearray(@ds^.pending_buf^[(1+sizeof(word))*ds^.lit_bufsize]);
   ds^.l_buf := Pbytearray(@ds^.pending_buf^[(1+sizeof(word))*ds^.lit_bufsize]);
 
 
@@ -1305,8 +1305,8 @@ distances are limited to MAX_DIST instead of WSIZE. }
         { This code assumes sizeof(cardinal short) = 2. Do not use
         { This code assumes sizeof(cardinal short) = 2. Do not use
           UNALIGNED_OK if your compiler uses a different size. }
           UNALIGNED_OK if your compiler uses a different size. }
   {$IFOPT R+} {$R-} {$DEFINE NoRangeCheck} {$ENDIF}
   {$IFOPT R+} {$R-} {$DEFINE NoRangeCheck} {$ENDIF}
-        if (pushfArray(match)^[best_len-1] <> scan_end) or
-           (pushf(match)^ <> scan_start) then
+        if (match[best_len-1]<>scan_end) or
+           (match^ <> scan_start) then
           goto nextstep; {continue;}
           goto nextstep; {continue;}
   {$IFDEF NoRangeCheck} {$R+} {$UNDEF NoRangeCheck} {$ENDIF}
   {$IFDEF NoRangeCheck} {$R+} {$UNDEF NoRangeCheck} {$ENDIF}
 
 
@@ -1325,25 +1325,25 @@ distances are limited to MAX_DIST instead of WSIZE. }
         inc(match);
         inc(match);
 
 
         repeat
         repeat
-          inc(scan,2); inc(match,2); if (pushf(scan)^<>pushf(match)^) then break;
-          inc(scan,2); inc(match,2); if (pushf(scan)^<>pushf(match)^) then break;
-          inc(scan,2); inc(match,2); if (pushf(scan)^<>pushf(match)^) then break;
-          inc(scan,2); inc(match,2); if (pushf(scan)^<>pushf(match)^) then break;
-        until (ptrint(scan) >= ptrint(strend));
+          inc(scan,2); inc(match,2); if scan^<>match^ then break;
+          inc(scan,2); inc(match,2); if scan^<>match^ then break;
+          inc(scan,2); inc(match,2); if scan^<>match^ then break;
+          inc(scan,2); inc(match,2); if scan^<>match^ then break;
+        until ptruint(scan)>=ptruint(strend);
         { The funny "do while" generates better code on most compilers }
         { The funny "do while" generates better code on most compilers }
 
 
         { Here, scan <= window+strstart+257 }
         { Here, scan <= window+strstart+257 }
         {$IFDEF ZLIB_DEBUG}
         {$IFDEF ZLIB_DEBUG}
         {$ifopt R+} {$define RangeCheck} {$endif} {$R-}
         {$ifopt R+} {$define RangeCheck} {$endif} {$R-}
-        Assert(ptrint(scan) <=
-               ptrint(@(s.window^[cardinal(s.window_size-1)])),
+        Assert(ptruint(scan) <=
+               ptruint(@(s.window^[cardinal(s.window_size-1)])),
                'wild scan');
                'wild scan');
         {$ifdef RangeCheck} {$R+} {$undef RangeCheck} {$endif}
         {$ifdef RangeCheck} {$R+} {$undef RangeCheck} {$endif}
         {$ENDIF}
         {$ENDIF}
-        if (scan^ = match^) then
+        if scan^=match^ then
           inc(scan);
           inc(scan);
 
 
-        len := (MAX_MATCH - 1) - integer(ptrint(strend)) + integer(ptrint(scan));
+        len := (MAX_MATCH - 1) - integer(ptruint(strend)) + integer(ptruint(scan));
         scan := strend;
         scan := strend;
         dec(scan, (MAX_MATCH-1));
         dec(scan, (MAX_MATCH-1));
 
 
@@ -1374,23 +1374,23 @@ distances are limited to MAX_DIST instead of WSIZE. }
           the 256th check will be made at strstart+258. }
           the 256th check will be made at strstart+258. }
 
 
         repeat
         repeat
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-          inc(scan); inc(match); if (scan^ <> match^) then break;
-        until (ptrint(scan) >= ptrint(strend));
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+          inc(scan); inc(match); if scan^ <> match^ then break;
+        until ptruint(scan)>=ptruint(strend);
 
 
         {$IFDEF ZLIB_DEBUG}
         {$IFDEF ZLIB_DEBUG}
-        Assert(ptrint(scan) <=
-               ptrint(@(s.window^[cardinal(s.window_size-1)])),
+        Assert(ptruint(scan) <=
+               ptruint(@(s.window^[cardinal(s.window_size-1)])),
                'wild scan');
                'wild scan');
         {$ENDIF}
         {$ENDIF}
 
 
-        len := MAX_MATCH - integer(ptrint(strend) - ptrint(scan));
+        len := MAX_MATCH - (ptruint(strend) - ptruint(scan));
         scan := strend;
         scan := strend;
         dec(scan, MAX_MATCH);
         dec(scan, MAX_MATCH);
 
 
@@ -1481,7 +1481,7 @@ begin
       inc(scan); inc(match); if scan^<>match^ then break;
       inc(scan); inc(match); if scan^<>match^ then break;
       inc(scan); inc(match); if scan^<>match^ then break;
       inc(scan); inc(match); if scan^<>match^ then break;
       inc(scan); inc(match); if scan^<>match^ then break;
       inc(scan); inc(match); if scan^<>match^ then break;
-    until (ptrint(scan) >= ptrint(strend));
+    until (ptruint(scan) >= ptruint(strend));
 
 
     Assert(scan <= s.window+cardinal(s.window_size-1), 'wild scan');
     Assert(scan <= s.window+cardinal(s.window_size-1), 'wild scan');
 
 

+ 1 - 1
packages/base/paszlib/zinflate.pas

@@ -686,7 +686,7 @@ begin
   end;
   end;
 
 
   { restore }
   { restore }
-  inc(z.total_in, ptrint(p) - ptrint(z.next_in));
+  inc(z.total_in, ptruint(p) - ptruint(z.next_in));
   z.next_in := p;
   z.next_in := p;
   z.avail_in := n;
   z.avail_in := n;
   z.state^.sub.marker := m;
   z.state^.sub.marker := m;