Browse Source

* use ptrint

peter 21 years ago
parent
commit
e89a336c16
2 changed files with 16 additions and 13 deletions
  1. 8 5
      tests/webtbf/tw2053.pp
  2. 8 8
      tests/webtbf/tw2053b.pp

+ 8 - 5
tests/webtbf/tw2053.pp

@@ -11,13 +11,13 @@ type
 
   TMyRecord = record
     mr_sglDummy1: array[0..3] of Single;
-    mr_lDummy2  : Longint;
+    mr_lDummy2  : ptrint;
     mr_iDummy3  : Integer;
     mr_iDummy4  : Integer;
   end;
 
 {  TMyRecordArray = array[Integer] of TMyRecord;} { Error }
-  TMyRecordArray = array[Longint] of TMyRecord; { OK }
+  TMyRecordArray = array[Ptrint] of TMyRecord; { OK }
   PMyRecordArray = ^TMyRecordArray;
 
 var
@@ -28,8 +28,8 @@ begin
   GetMem(pArray, 50 * SizeOf(TMyRecord));
   Assert(Assigned(pArray));
 
-  WriteLn('pArray = ', Longint(pArray));
-  WriteLn('@(pArray^[0]) = ', Longint(@(pArray^[0])));
+  WriteLn('pArray = ', ptrint(pArray));
+  WriteLn('@(pArray^[0]) = ', ptrint(@(pArray^[0])));
   pArray^[0].mr_lDummy2 := 0;
 
   FreeMem(pArray, 50 * SizeOf(TMyRecord));
@@ -38,7 +38,10 @@ end.
 
 {
    $Log$
-   Revision 1.4  2002-10-15 15:48:25  carl
+   Revision 1.5  2004-11-01 22:31:12  peter
+     * use ptrint
+
+   Revision 1.4  2002/10/15 15:48:25  carl
     - remove Pierre's diff.
 
    Revision 1.3  2002/10/15 06:38:29  pierre

+ 8 - 8
tests/webtbf/tw2053b.pp

@@ -12,17 +12,17 @@ program tb2;
 type
 
   PosInteger = 0 .. high(integer);
-  PosLongint = 0 .. high(longint);
+  Posptrint = 0 .. high(ptrint);
 
   TMyRecord = record
     mr_sglDummy1: array[0..3] of Single;
-    mr_lDummy2  : Longint;
+    mr_lDummy2  : ptrint;
     mr_iDummy3  : Integer;
     mr_iDummy4  : Integer;
   end;
 
   TMyRecordArray = array[PosInteger] of TMyRecord;
-  TMyLongRecordArray = array[Longint] of TMyRecord;
+  TMyLongRecordArray = array[ptrint] of TMyRecord;
   PMyRecordArray = ^TMyRecordArray;
   PMyLongRecordArray = ^TMyLongRecordArray;
 
@@ -30,7 +30,7 @@ var
 
   pArray: PMyRecordArray;
   pLongArray : PMyLongRecordArray;
-  size : longint;
+  size : ptrint;
 
 begin
 
@@ -44,8 +44,8 @@ begin
 
   Assert(Assigned(pArray));
 
-  WriteLn('pArray = ', Longint(pArray));
-  WriteLn('@(pArray^[0]) = ', Longint(@(pArray^[0])));
+  WriteLn('pArray = ', ptrint(pArray));
+  WriteLn('@(pArray^[0]) = ', ptrint(@(pArray^[0])));
   pArray^[0].mr_lDummy2 := 24;
 
   if (pArray^[0].mr_lDummy2<>24) then
@@ -53,8 +53,8 @@ begin
       Halt(1);
     end;
 
-  WriteLn('pLongArray = ', Longint(pLongArray));
-  WriteLn('@(pLongArray^[0]) = ', Longint(@(pLongArray^[0])));
+  WriteLn('pLongArray = ', ptrint(pLongArray));
+  WriteLn('@(pLongArray^[0]) = ', ptrint(@(pLongArray^[0])));
   pLongArray^[0].mr_lDummy2 := 25;
 
   if (pLongArray^[0].mr_lDummy2<>25) then