Browse Source

* pointer fixes

peter 26 years ago
parent
commit
38a2727fb2
8 changed files with 162 additions and 148 deletions
  1. 18 14
      rtl/inc/heap.inc
  2. 14 11
      rtl/inc/heaptrc.pp
  3. 10 7
      rtl/inc/objpas.inc
  4. 6 3
      rtl/linux/dos.pp
  5. 70 62
      rtl/linux/linux.pp
  6. 6 3
      rtl/linux/printer.pp
  7. 5 2
      rtl/linux/syslinux.pp
  8. 33 46
      rtl/objpas/typinfo.pp

+ 18 - 14
rtl/inc/heap.inc

@@ -594,8 +594,9 @@ begin
 { walk free list }
   repeat
     again:=false;
-    { search the freelist }
-    if assigned(freelist) then
+    { search the freelist, not for blocks that fit heapblocks }
+    if assigned(freelist) and
+       (not(heapblocks) or (size>max_size)) then
      begin
        last:=nil;
        hp:=freelist;
@@ -619,18 +620,18 @@ begin
                     freelist:=hp^.next;
                    { insert in chain }
                    s:=(hpsize-size) div 8;
-                   ppointer(hp+size)^:=blocks^[s];
-                   blocks^[s]:=hp+size;
+                   ppointer(pointer(hp)+size)^:=blocks^[s];
+                   blocks^[s]:=pointer(hp)+size;
                    inc(nblocks^[s]);
                  end
                 else
                  begin
-                   (hp+size)^.size:=hpsize-size;
-                   (hp+size)^.next:=hp^.next;
+                   pfreerecord(pointer(hp)+size)^.size:=hpsize-size;
+                   pfreerecord(pointer(hp)+size)^.next:=hp^.next;
                    if assigned(last) then
-                    last^.next:=hp+size
+                    last^.next:=pointer(hp)+size
                    else
-                    freelist:=hp+size;
+                    freelist:=pointer(hp)+size;
                  end;
               end
              else
@@ -829,7 +830,7 @@ begin
          { but now it can also connect the next block !!}
          if p+pfreerecord(p)^.size=pfreerecord(p)^.next then
           begin
-            pfreerecord(p)^.size:=pfreerecord(p)^.size+pfreerecord(p)^.next^.size;
+            inc(pfreerecord(p)^.size,pfreerecord(p)^.next^.size);
 {$ifdef CHECKHEAP}
             dec(freerecord_list_length);
 {$endif CHECKHEAP}
@@ -841,7 +842,7 @@ begin
      hp:=freelist;
      while assigned(hp) do
       begin
-        if p<hp+hp^.size then
+        if p<pointer(hp)+hp^.size then
          begin
 {$ifdef CHECKHEAP}
            writeln('pointer to dispose at ',hexstr(longint(p),8),' has already been disposed');
@@ -849,11 +850,11 @@ begin
            HandleError(204);
          end;
         { connecting two blocks ? }
-        if hp+hp^.size=p then
+        if pointer(hp)+hp^.size=p then
          begin
            inc(hp^.size,size);
            { connecting also to next block ? }
-           if hp+hp^.size=hp^.next then
+           if pointer(hp)+hp^.size=hp^.next then
             begin
               inc(hp^.size,hp^.next^.size);
 {$ifdef CHECKHEAP}
@@ -862,7 +863,7 @@ begin
               hp^.next:=hp^.next^.next;
             end
            else
-            if (hp^.next<>nil) and (hp+hp^.size>hp^.next) then
+            if (hp^.next<>nil) and (pointer(hp)+hp^.size>hp^.next) then
              begin
 {$ifdef CHECKHEAP}
                writeln('pointer to dispose at ',hexstr(longint(p),8),' is too big !!');
@@ -1098,7 +1099,10 @@ end;
 
 {
   $Log$
-  Revision 1.13  1999-08-20 13:26:20  michael
+  Revision 1.14  1999-09-08 16:14:41  peter
+    * pointer fixes
+
+  Revision 1.13  1999/08/20 13:26:20  michael
   + reverted to previous heap
 
   Revision 1.11  1999/05/31 20:36:34  peter

+ 14 - 11
rtl/inc/heaptrc.pp

@@ -227,12 +227,12 @@ procedure call_stack(pp : pheap_mem_info;var ptext : text);
 var
   i  : longint;
 begin
-  writeln(ptext,'Call trace for block 0x',hexstr(longint(pp+sizeof(theap_mem_info)),8),' size ',pp^.size);
+  writeln(ptext,'Call trace for block 0x',hexstr(longint(pointer(pp)+sizeof(theap_mem_info)),8),' size ',pp^.size);
   for i:=1 to tracesize do
    if pp^.calls[i]<>0 then
      writeln(ptext,'  0x',hexstr(pp^.calls[i],8));
   for i:=0 to (exact_info_size div 4)-1 do
-    writeln(ptext,'info ',i,'=',plongint(@pp^.extra_info+4*i)^);
+    writeln(ptext,'info ',i,'=',plongint(pointer(@pp^.extra_info)+4*i)^);
 end;
 
 procedure call_free_stack(pp : pheap_mem_info;var ptext : text);
@@ -240,7 +240,7 @@ var
   i  : longint;
 
 begin
-  writeln(ptext,'Call trace for block 0x',hexstr(longint(pp+sizeof(theap_mem_info)),8),' size ',pp^.size);
+  writeln(ptext,'Call trace for block 0x',hexstr(longint(pointer(pp)+sizeof(theap_mem_info)),8),' size ',pp^.size);
   for i:=1 to tracesize div 2 do
    if pp^.calls[i]<>0 then
      writeln(ptext,'  0x',hexstr(pp^.calls[i],8));
@@ -249,13 +249,13 @@ begin
    if pp^.calls[i]<>0 then
      writeln(ptext,'  0x',hexstr(pp^.calls[i],8));
   for i:=0 to (exact_info_size div 4)-1 do
-    writeln(ptext,'info ',i,'=',plongint(@pp^.extra_info+4*i)^);
+    writeln(ptext,'info ',i,'=',plongint(pointer(@pp^.extra_info)+4*i)^);
 end;
 
 
 procedure dump_already_free(p : pheap_mem_info;var ptext : text);
 begin
-  Writeln(ptext,'Marked memory at ',HexStr(longint(p+sizeof(theap_mem_info)),8),' released');
+  Writeln(ptext,'Marked memory at ',HexStr(longint(pointer(p)+sizeof(theap_mem_info)),8),' released');
   call_free_stack(p,ptext);
   Writeln(ptext,'freed again at');
   dump_stack(ptext,get_caller_frame(get_frame));
@@ -263,7 +263,7 @@ end;
 
 procedure dump_error(p : pheap_mem_info;var ptext : text);
 begin
-  Writeln(ptext,'Marked memory at ',HexStr(longint(p+sizeof(theap_mem_info)),8),' invalid');
+  Writeln(ptext,'Marked memory at ',HexStr(longint(pointer(p)+sizeof(theap_mem_info)),8),' invalid');
   Writeln(ptext,'Wrong signature $',hexstr(p^.sig,8)
     ,' instead of ',hexstr(calculate_sig(p),8));
   dump_stack(ptext,get_caller_frame(get_frame));
@@ -274,12 +274,12 @@ procedure dump_change_after(p : pheap_mem_info;var ptext : text);
  var pp : pchar;
      i : longint;
 begin
-  Writeln(ptext,'Marked memory at ',HexStr(longint(p+sizeof(theap_mem_info)),8),' invalid');
+  Writeln(ptext,'Marked memory at ',HexStr(longint(pointer(p)+sizeof(theap_mem_info)),8),' invalid');
   Writeln(ptext,'Wrong release CRC $',hexstr(p^.release_sig,8)
     ,' instead of ',hexstr(calculate_release_sig(p),8));
   Writeln(ptext,'This memory was changed after call to freemem !');
   call_free_stack(p,ptext);
-  pp:=pchar(p)+sizeof(theap_mem_info)+extra_info_size;
+  pp:=pointer(p)+sizeof(theap_mem_info)+extra_info_size;
   for i:=0 to p^.size-1 do
     if byte(pp[i])<>$F0 then
       Writeln(ptext,'offset',i,':$',hexstr(i,8),'"',pp[i],'"');
@@ -290,7 +290,7 @@ procedure dump_wrong_size(p : pheap_mem_info;size : longint;var ptext : text);
 var
   i : longint;
 begin
-  Writeln(ptext,'Marked memory at ',HexStr(longint(p+sizeof(theap_mem_info)),8),' invalid');
+  Writeln(ptext,'Marked memory at ',HexStr(longint(pointer(p)+sizeof(theap_mem_info)),8),' invalid');
   Writeln(ptext,'Wrong size : ',p^.size,' allocated ',size,' freed');
   dump_stack(ptext,get_caller_frame(get_frame));
   for i:=0 to (exact_info_size div 4)-1 do
@@ -340,7 +340,7 @@ begin
 { Do the real GetMem, but alloc also for the info block }
   bp:=size+sizeof(theap_mem_info)+extra_info_size;
   if add_tail then
-    bp:=bp+sizeof(longint);
+    inc(bp,sizeof(longint));
   SysGetMem(p,bp);
 { Create the info block }
   pheap_mem_info(p)^.sig:=$DEADBEEF;
@@ -758,7 +758,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.21  1999-08-18 12:03:16  peter
+  Revision 1.22  1999-09-08 16:14:41  peter
+    * pointer fixes
+
+  Revision 1.21  1999/08/18 12:03:16  peter
     * objfpc mode for 0.99.12
 
   Revision 1.20  1999/08/17 14:56:03  michael

+ 10 - 7
rtl/inc/objpas.inc

@@ -81,7 +81,7 @@
         begin
            { type of self is class of tobject => it points to the vmt }
            { the parent vmt is saved at offset vmtParent              }
-           classparent:=(pclass(self)+vmtParent)^;
+           classparent:=pclass(pointer(self)+vmtParent)^;
         end;
 
       class function TObject.NewInstance : tobject;
@@ -142,13 +142,13 @@
       class function TObject.ClassInfo : pointer;
 
         begin
-           ClassInfo:=(PPointer(self)+vmtTypeInfo)^;
+           ClassInfo:=ppointer(Pointer(self)+vmtTypeInfo)^;
         end;
 
       class function TObject.ClassName : ShortString;
 
         begin
-           ClassName:=PShortString((PPointer(Self)+vmtClassName)^)^;
+           ClassName:=PShortString((Pointer(Self)+vmtClassName)^)^;
         end;
 
       class function TObject.ClassNameIs(const name : string) : boolean;
@@ -182,7 +182,7 @@
            pdword = ^dword;
 
         begin
-           stringmessagetable:=pstringmessagetable((pdword(Self)+vmtMsgStrPtr)^);
+           stringmessagetable:=pstringmessagetable((pointer(Self)+vmtMsgStrPtr)^);
         end;
 
       procedure TObject.Dispatch(var message);
@@ -210,7 +210,7 @@
            while assigned(vmt) do
              begin
                 // See if we have messages at all in this class.
-                p:=pdword(vmt)+vmtDynamicTable;
+                p:=pointer(vmt)+vmtDynamicTable;
                 If Assigned(p) and (Pdword(p)^<>0) then
                   begin
                   msgtable:=pmsgtable(pdword(P)^+4);
@@ -255,7 +255,7 @@
            vmt:=ClassType;
            while assigned(vmt) do
              begin
-                p:=(pdword(vmt)+vmtMsgStrPtr);
+                p:=(pointer(vmt)+vmtMsgStrPtr);
                 If (P<>Nil) and (PDWord(P)^<>0) then
                   begin
                   count:=pdword(pdword(p)^)^;
@@ -330,7 +330,10 @@
 
 {
   $Log$
-  Revision 1.7  1999-07-11 14:10:48  michael
+  Revision 1.8  1999-09-08 16:14:41  peter
+    * pointer fixes
+
+  Revision 1.7  1999/07/11 14:10:48  michael
   + Adaptes Dispatch(STr) to cope with empty/non-existent message tables
 
   Revision 1.6  1999/07/11 14:05:50  michael

+ 6 - 3
rtl/linux/dos.pp

@@ -886,7 +886,7 @@ Begin
   while (p^<>nil) do
    begin
      inc(envcnt);
-     p:=p+4
+     inc(p);
    end;
   EnvCount := envcnt
 {$ENDIF}
@@ -913,7 +913,7 @@ Begin
   while (i<Index) and (p^<>nil) do
    begin
      inc(i);
-     p:=p+4;
+     inc(p);
    end;
   if p=nil then
    envstr:=''
@@ -1046,7 +1046,10 @@ End.
 
 {
   $Log$
-  Revision 1.12  1999-07-28 23:18:35  peter
+  Revision 1.13  1999-09-08 16:14:41  peter
+    * pointer fixes
+
+  Revision 1.12  1999/07/28 23:18:35  peter
     * closedir fixes, which now disposes the pdir itself
 
   Revision 1.11  1999/07/24 11:18:11  peter

+ 70 - 62
rtl/linux/linux.pp

@@ -725,12 +725,13 @@ var
 begin
   getmem(pp,4*4);
   temp:='/bin/sh'#0'-c'#0+prog+#0;
-  pp^:=@temp[1];
-  p:=pp+4;
+  p:=pp;
+  p^:=@temp[1];
+  inc(p);
   p^:=@temp[9];
-  p:=p+4;
+  inc(p);
   p^:=@temp[12];
-  p:=p+4;
+  inc(p);
   p^:=Nil;
   CreateShellArgV:=pp;
 end;
@@ -746,13 +747,14 @@ var
 begin
   getmem(pp,4*4);
   temp:='/bin/sh'#0'-c'#0+prog+#0;
-  GetMem(PP[0],Length(Temp));
-  Move(@Temp[1],PP[0]^,Length(Temp));
-  p:=pp+SizeOf(Pointer);
+  p:=pp;
+  GetMem(p^,Length(Temp));
+  Move(@Temp[1],p^^,Length(Temp));
+  inc(p);
   p^:=@pp[0][8];
-  p:=p+SizeOf(Pointer);
+  inc(p);
   p^:=@pp[0][11];
-  p:=p+SizeOf(Pointer);
+  inc(p);
   p^:=Nil;
   CreateShellArgV:=pp;
 end;
@@ -907,7 +909,6 @@ begin
   p:=StringToPPChar(ToDo);
   if (p=nil) or (p^=nil) then
    exit;
-
   ExecVE(p^,p,EP);
 end;
 
@@ -1001,6 +1002,8 @@ begin
   Shell:=temp;{ Return exit status }
 end;
 
+
+
 Function Shell(const Command:AnsiString):Longint;
 {
   AnsiString version of Shell
@@ -1476,7 +1479,6 @@ var
   sr : Syscallregs;
 begin
   if (cmd in [F_GetFd,F_GetFl,F_GetOwn]) then
-
    begin
      sr.reg2:=Fd;
      sr.reg3:=cmd;
@@ -1765,7 +1767,6 @@ end;
 
 
 Function  FRename (OldName,NewName : Pchar) : Boolean;
-
 begin
   FRename:=Sys_rename(OldName,NewName)=0;
   LinuxError:=Errno;
@@ -1773,7 +1774,6 @@ end;
 
 
 Function  FRename (OldName,NewName : String) : Boolean;
-
 begin
   OldName:=OldName+#0;
   NewName:=NewName+#0;
@@ -1826,10 +1826,10 @@ Function  Dup(oldfile:longint;var newfile:longint):Boolean;
 var
   sr : Syscallregs;
 begin
- sr.reg2:=oldfile;
- newfile:=Syscall(Syscall_nr_dup,sr);
- linuxerror:=errno;
- Dup:=(LinuxError=0);
+  sr.reg2:=oldfile;
+  newfile:=Syscall(Syscall_nr_dup,sr);
+  linuxerror:=errno;
+  Dup:=(LinuxError=0);
 end;
 
 
@@ -1842,10 +1842,10 @@ Function Dup(var oldfile,newfile:text):Boolean;
   close_on_exit flag.
 }
 begin
- flush(oldfile);{ We cannot share buffers, so we flush them. }
- textrec(newfile):=textrec(oldfile);
- textrec(newfile).bufptr:=@(textrec(newfile).buffer);{ No shared buffer. }
- Dup:=Dup(textrec(oldfile).handle,textrec(newfile).handle);
+  flush(oldfile);{ We cannot share buffers, so we flush them. }
+  textrec(newfile):=textrec(oldfile);
+  textrec(newfile).bufptr:=@(textrec(newfile).buffer);{ No shared buffer. }
+  Dup:=Dup(textrec(oldfile).handle,textrec(newfile).handle);
 end;
 
 
@@ -1866,11 +1866,11 @@ Function Dup2(oldfile,newfile:longint):Boolean;
 var
   sr : Syscallregs;
 begin
- sr.reg2:=oldfile;
- sr.reg3:=newfile;
- SysCall(Syscall_nr_dup2,sr);
- linuxerror:=errno;
- Dup2:=(LinuxError=0);
+  sr.reg2:=oldfile;
+  sr.reg3:=newfile;
+  SysCall(Syscall_nr_dup2,sr);
+  linuxerror:=errno;
+  Dup2:=(LinuxError=0);
 end;
 
 
@@ -2023,12 +2023,14 @@ end;
 Procedure OpenPipe(var F:Text);
 begin
   case textrec(f).mode of
-   fmoutput : if textrec(f).userdata[1]<>P_OUT then
-               textrec(f).mode:=fmclosed;
-    fminput : if textrec(f).userdata[1]<>P_IN then
-               textrec(f).mode:=fmclosed;
-  else
-   textrec(f).mode:=fmclosed;
+    fmoutput :
+      if textrec(f).userdata[1]<>P_OUT then
+        textrec(f).mode:=fmclosed;
+    fminput :
+      if textrec(f).userdata[1]<>P_IN then
+        textrec(f).mode:=fmclosed;
+    else
+      textrec(f).mode:=fmclosed;
   end;
 end;
 
@@ -2036,13 +2038,15 @@ end;
 Procedure IOPipe(var F:text);
 begin
   case textrec(f).mode of
-   fmoutput : begin
-                { first check if we need something to write, else we may
-                  get a SigPipe when Close() is called (PFV) }
-                if textrec(f).bufpos>0 then
-                 Sys_write(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufpos);
-              end;
-    fminput : textrec(f).bufend:=Sys_read(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufsize);
+    fmoutput :
+      begin
+        { first check if we need something to write, else we may
+          get a SigPipe when Close() is called (PFV) }
+        if textrec(f).bufpos>0 then
+          Sys_write(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufpos);
+      end;
+    fminput :
+      textrec(f).bufend:=Sys_read(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufsize);
   end;
   textrec(f).bufpos:=0;
 end;
@@ -2322,12 +2326,13 @@ begin
       end;
      getmem(pp,sizeof(pchar)*4);
      temp:='/bin/sh'#0'-c'#0+prog+#0;
-     pp^:=@temp[1];
-     p:=pp+sizeof(pchar);
+     p:=pp;
+     p^:=@temp[1];
+     inc(p);
      p^:=@temp[9];
-     p:=p+sizeof(pchar);
+     inc(p);
      p^:=@temp[12];
-     p:=p+sizeof(pchar);
+     inc(p);
      p^:=Nil;
      Execve('/bin/sh',pp,envp);
      halt(127);
@@ -2380,7 +2385,6 @@ var
   pipo : text;
   pid  : longint;
   pl   : ^Longint;
-
 begin
   LinuxError:=0;
   AssignPipe(streamin,pipo);
@@ -2417,20 +2421,21 @@ begin
    end
   else
    begin
-   { we're in the parent}
-   close(pipo);
-   close(pipi);
-   {Save the process ID - needed when closing }
-   pl:=@(textrec(StreamIn).userdata[2]);
-   pl^:=pid;
-   textrec(StreamIn).closefunc:=@PCloseText;
-   {Save the process ID - needed when closing }
-   pl:=@(textrec(StreamOut).userdata[2]);
-   pl^:=pid;
-   textrec(StreamOut).closefunc:=@PCloseText;
+     { we're in the parent}
+     close(pipo);
+     close(pipi);
+     {Save the process ID - needed when closing }
+     pl:=@(textrec(StreamIn).userdata[2]);
+     pl^:=pid;
+     textrec(StreamIn).closefunc:=@PCloseText;
+     {Save the process ID - needed when closing }
+     pl:=@(textrec(StreamOut).userdata[2]);
+     pl^:=pid;
+     textrec(StreamOut).closefunc:=@PCloseText;
    end;
 end;
 
+
 function AssignStream(var StreamIn, StreamOut, StreamErr: Text; const prog: String): LongInt;
 {
   Starts the program in 'prog' and makes its input, output and error output the
@@ -2577,7 +2582,7 @@ Begin
         if strlcomp(@p[1],(ep^),length(p))=0 then
          found:=true
         else
-         ep:=ep+4;
+         inc(ep);
       end;
    end;
   if found then
@@ -2989,10 +2994,10 @@ begin
   while(buf^<>#0) do
    begin
      while (buf^ in [' ',#8,#10]) do
-      buf:=buf+1;
+      inc(buf);
      inc(nr);
      while not (buf^ in [' ',#0,#8,#10]) do
-      buf:=buf+1;
+      inc(buf);
    end;
   getmem(p,nr*4);
   StringToPPChar:=p;
@@ -3007,13 +3012,13 @@ begin
      while (buf^ in [' ',#8,#10]) do
       begin
         buf^:=#0;
-        buf:=buf+1;
+        inc(buf);
       end;
      p^:=buf;
-     p:=p+4;
+     inc(p);
      p^:=nil;
      while not (buf^ in [' ',#0,#8,#10]) do
-      buf:=buf+1;
+      inc(buf);
    end;
 end;
 
@@ -3737,7 +3742,10 @@ End.
 
 {
   $Log$
-  Revision 1.45  1999-08-11 22:02:25  peter
+  Revision 1.46  1999-09-08 16:14:41  peter
+    * pointer fixes
+
+  Revision 1.45  1999/08/11 22:02:25  peter
     * removed old integer versions of localtoepoch and epochtolocal, you
       need to use the word versions instead else you got an overloaded bug
 

+ 6 - 3
rtl/linux/printer.pp

@@ -98,9 +98,9 @@ begin
       halt(127);
      pp:=p;
      pp^:=@lpr[1];
-     pp:=pp+4;
+     inc(pp);
      pp^:=@f[1];
-     pp:=pp+4;
+     inc(pp);
      pp^:=nil;
      Execve(lpr,p,envp);
      { In trouble here ! }
@@ -254,7 +254,10 @@ end.
 
 {
   $Log$
-  Revision 1.3  1998-11-16 10:21:29  peter
+  Revision 1.4  1999-09-08 16:14:43  peter
+    * pointer fixes
+
+  Revision 1.3  1998/11/16 10:21:29  peter
     * fixes for H+
 
   Revision 1.2  1998/05/06 12:35:26  michael

+ 5 - 2
rtl/linux/syslinux.pp

@@ -136,7 +136,7 @@ Begin
   i:=0;
   while (i<l) and (pp^<>nil) do
    begin
-     pp:=pp+4;
+     inc(pp);
      inc(i);
    end;
   if pp^<>nil then
@@ -724,7 +724,10 @@ End.
 
 {
   $Log$
-  Revision 1.25  1999-07-28 23:18:36  peter
+  Revision 1.26  1999-09-08 16:14:43  peter
+    * pointer fixes
+
+  Revision 1.25  1999/07/28 23:18:36  peter
     * closedir fixes, which now disposes the pdir itself
 
   Revision 1.24  1999/05/17 21:52:42  florian

+ 33 - 46
rtl/objpas/typinfo.pp

@@ -255,7 +255,7 @@ uses sysutils;
       .LINoPush:
          push %esi
          call %edi
-         // 
+         //
       end;
 
     function CallExtendedProc(s : Pointer;Address : Pointer;Value : Extended; INdex,IVAlue : Longint) : Integer;assembler;
@@ -336,7 +336,7 @@ uses sysutils;
     function GetTypeData(TypeInfo : PTypeInfo) : PTypeData;
 
       begin
-         GetTypeData:=PTypeData(TypeInfo)+2+PByte(TypeInfo+1)^;
+         GetTypeData:=PTypeData(pointer(TypeInfo)+2+PByte(pointer(TypeInfo)+1)^);
       end;
 
     function GetPropInfo(TypeInfo : PTypeInfo;const PropName : string) : PPropInfo;
@@ -354,7 +354,7 @@ uses sysutils;
 
               // the class info rtti the property rtti follows
               // immediatly
-              Result:=PPropInfo(@hp^.UnitName)+Length(hp^.UnitName)+1+SizeOF(Word);
+              Result:=PPropInfo(pointer(@hp^.UnitName)+Length(hp^.UnitName)+1+SizeOF(Word));
               for i:=1 to hp^.PropCount do
                 begin
                    // found a property of that name ?
@@ -362,7 +362,7 @@ uses sysutils;
                      exit;
 
                    // skip to next property
-                   Result:=PPropInfo(@Result^.Name)+byte(Result^.Name[0])+1;
+                   Result:=PPropInfo(pointer(@Result^.Name)+byte(Result^.Name[0])+1);
                 end;
               // parent class
               Typeinfo:=hp^.ParentInfo;
@@ -378,7 +378,7 @@ uses sysutils;
             ptstatic:
               IsStoredProp:=CallBooleanFunc(Instance,PropInfo^.StoredProc,0,0);
             ptvirtual:
-              IsStoredProp:=CallBooleanFunc(Instance,(PPointer(Instance.ClassType)+Longint(PropInfo^.StoredProc))^,0,0);
+              IsStoredProp:=CallBooleanFunc(Instance,ppointer(Pointer(Instance.ClassType)+Longint(PropInfo^.StoredProc))^,0,0);
             ptconst:
               IsStoredProp:=LongBool(PropInfo^.StoredProc);
          end;
@@ -409,7 +409,7 @@ uses sysutils;
         Inc(Longint(PropList),SizeOf(Pointer));
         // Point to TP next propinfo record.
         // Located at Name[Length(Name)+1] !
-        TP:=PPropInfo((@TP^.Name)+PByte(@TP^.Name)^+1);
+        TP:=PPropInfo(pointer(@TP^.Name)+PByte(@TP^.Name)^+1);
         Dec(Count);
         end;
       // recursive call for parent info.
@@ -487,9 +487,7 @@ uses sysutils;
             ptstatic:
               Value:=CallIntegerFunc(Instance,PropInfo^.GetProc,Index,IValue);
             ptvirtual:
-              Value:=CallIntegerFunc(Instance,
-                                     (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                                     Index,IValue);
+              Value:=CallIntegerFunc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Index,IValue);
          end;
          { cut off unnecessary stuff }
          case GetTypeData(PropInfo^.PropType)^.OrdType of
@@ -506,35 +504,33 @@ uses sysutils;
 
       var
         Index,IValue : Longint;
-	DataSize: Integer;
+        DataSize: Integer;
 
       begin
          { cut off unnecessary stuff }
          case GetTypeData(PropInfo^.PropType)^.OrdType of
             otSWord,otUWord: begin
                 Value:=Value and $ffff;
-	        DataSize := 2;
-	      end;
+                DataSize := 2;
+              end;
             otSByte,otUByte: begin
                 Value:=Value and $ff;
-	        DataSize := 1;
-	    end;
-	   else DataSize := 4;
+                DataSize := 1;
+            end;
+           else DataSize := 4;
          end;
          SetIndexValues(PropInfo,Index,Ivalue);
          case (PropInfo^.PropProcs shr 2) and 3 of
             ptfield:
-	      case DataSize of
-	        1: PByte(Pointer(Instance)+Longint(PropInfo^.SetProc))^:=Byte(Value);
-		2: PWord(Pointer(Instance)+Longint(PropInfo^.SetProc))^:=Word(Value);
+              case DataSize of
+                1: PByte(Pointer(Instance)+Longint(PropInfo^.SetProc))^:=Byte(Value);
+                2: PWord(Pointer(Instance)+Longint(PropInfo^.SetProc))^:=Word(Value);
                 4: PLongint(Pointer(Instance)+Longint(PropInfo^.SetProc))^:=Value;
-	      end;
+              end;
             ptstatic:
               CallIntegerProc(Instance,PropInfo^.SetProc,Value,Index,IValue);
             ptvirtual:
-              CallIntegerProc(Instance,
-                              (PPointer(Instance.ClassType)+Longint(PropInfo^.SetProc))^,
-                              Value,Index,IValue);
+              CallIntegerProc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.SetProc))^,Value,Index,IValue);
          end;
       end;
 
@@ -557,9 +553,7 @@ uses sysutils;
             ptstatic:
               Value:=Pointer(CallIntegerFunc(Instance,PropInfo^.GetProc,Index,IValue));
             ptvirtual:
-              Value:=Pointer(CallIntegerFunc(Instance,
-                                     (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                                     Index,IValue));
+              Value:=Pointer(CallIntegerFunc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Index,IValue));
          end;
          GetAstrProp:=Value;
       end;
@@ -578,9 +572,7 @@ uses sysutils;
             ptstatic:
              CallSStringFunc(Instance,PropInfo^.GetProc,Index,IValue,Value);
             ptvirtual:
-             CallSSTringFunc(Instance,
-                                     (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                                     Index,Ivalue,Value);
+             CallSSTringFunc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Index,Ivalue,Value);
          end;
          GetSStrProp:=Value;
       end;
@@ -614,9 +606,7 @@ uses sysutils;
             ptstatic:
               CallIntegerProc(Instance,PropInfo^.SetProc,Longint(Pointer(Value)),Index,IValue);
             ptvirtual:
-              CallIntegerProc(Instance,
-                              (PPointer(Instance.ClassType)+Longint(PropInfo^.SetProc))^,
-                              Longint(Pointer(Value)),Index,IValue);
+              CallIntegerProc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.SetProc))^,Longint(Pointer(Value)),Index,IValue);
          end;
       end;
 
@@ -633,9 +623,7 @@ uses sysutils;
             ptstatic:
               CallSStringProc(Instance,PropInfo^.GetProc,Value,Index,IValue);
             ptvirtual:
-              CallSStringProc(Instance,
-                              (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                              Value,Index,IValue);
+              CallSStringProc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Value,Index,IValue);
          end;
     end;
 
@@ -679,9 +667,7 @@ uses sysutils;
             ptstatic:
               Value:=CallExtendedFunc(Instance,PropInfo^.GetProc,Index,IValue);
             ptvirtual:
-              Value:=CallExtendedFunc(Instance,
-                                     (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                                     Index,IValue);
+              Value:=CallExtendedFunc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Index,IValue);
          end;
          Result:=Value;
       end;
@@ -714,9 +700,7 @@ uses sysutils;
             ptstatic:
               CallExtendedProc(Instance,PropInfo^.SetProc,Value,Index,IValue);
             ptvirtual:
-              CallExtendedProc(Instance,
-                               (PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,
-                               Value,Index,IValue);
+              CallExtendedProc(Instance,PPointer(Pointer(Instance.ClassType)+Longint(PropInfo^.GetProc))^,Value,Index,IValue);
          end;
       end;
 
@@ -759,10 +743,10 @@ uses sysutils;
        //      If PT^.MinValue<0 then Value:=Ord(Value<>0); {map to 0/1}
        PS:=@PT^.NameList;
        While Value>0 Do
-         begin
-         PS:=PS+PByte(PS)^+1;
-         Dec(Value);
-         end;
+        begin
+          PS:=PShortString(pointer(PS)+PByte(PS)^+1);
+          Dec(Value);
+        end;
        Result:=PS^;
       end;
 
@@ -782,7 +766,7 @@ uses sysutils;
           begin
           If PS^=Name then
             Result:=Count;
-          PS:=PS+PByte(PS)^;
+          PS:=PShortString(pointer(PS)+PByte(PS)^);
           Inc(Count);
           end;
       end;
@@ -791,7 +775,10 @@ end.
 
 {
   $Log$
-  Revision 1.26  1999-09-03 15:39:23  michael
+  Revision 1.27  1999-09-08 16:14:43  peter
+    * pointer fixes
+
+  Revision 1.26  1999/09/03 15:39:23  michael
   * Fixes from Sebastian Guenther
 
   Revision 1.25  1999/08/29 22:21:27  michael