Browse Source

* fixes for newppu, remake3 works now with it

peter 27 years ago
parent
commit
f4db879aed
4 changed files with 229 additions and 114 deletions
  1. 16 3
      compiler/pmodules.pas
  2. 144 50
      compiler/ppu.pas
  3. 41 39
      compiler/symppu.inc
  4. 28 22
      compiler/symsym.inc

+ 16 - 3
compiler/pmodules.pas

@@ -330,7 +330,7 @@ unit pmodules;
                 Message(unit_f_too_much_units);
                 Message(unit_f_too_much_units);
              end;
              end;
           { ok, now load the unit }
           { ok, now load the unit }
-            hp^.symtable:=new(punitsymtable,load(hp^.modulename^));
+            hp^.symtable:=new(punitsymtable,load(hp));
           { if this is the system unit insert the intern symbols }
           { if this is the system unit insert the intern symbols }
             make_ref:=false;
             make_ref:=false;
             if compile_system then
             if compile_system then
@@ -352,6 +352,16 @@ unit pmodules;
                 exit;
                 exit;
              end;
              end;
           end;
           end;
+{$ifdef NEWPPU}
+       { The next entry should be an ibendimplementation }
+         b:=hp^.ppufile^.readentry;
+         if b <> ibendimplementation then
+          Message1(unit_f_ppu_invalid_entry,tostr(b));
+       { The next entry should be an ibend }
+         b:=hp^.ppufile^.readentry;
+         if b <> ibend then
+          Message1(unit_f_ppu_invalid_entry,tostr(b));
+{$endif}
          hp^.ppufile^.close;
          hp^.ppufile^.close;
 {!         dispose(hp^.ppufile,done);}
 {!         dispose(hp^.ppufile,done);}
 {$else}
 {$else}
@@ -404,7 +414,7 @@ unit pmodules;
               hp^.ppufile^.read_data(b,1,count);
               hp^.ppufile^.read_data(b,1,count);
            end;
            end;
          { ok, now load the unit }
          { ok, now load the unit }
-         hp^.symtable:=new(punitsymtable,load(hp^.modulename^));
+         hp^.symtable:=new(punitsymtable,load(hp));
          { if this is the system unit insert the intern }
          { if this is the system unit insert the intern }
          { symbols                                      }
          { symbols                                      }
          make_ref:=false;
          make_ref:=false;
@@ -1110,7 +1120,10 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1998-05-27 19:45:06  peter
+  Revision 1.17  1998-05-28 14:40:25  peter
+    * fixes for newppu, remake3 works now with it
+
+  Revision 1.16  1998/05/27 19:45:06  peter
     * symtable.pas splitted into includefiles
     * symtable.pas splitted into includefiles
     * symtable adapted for $ifdef NEWPPU
     * symtable adapted for $ifdef NEWPPU
 
 

+ 144 - 50
compiler/ppu.pas

@@ -20,6 +20,9 @@
 
 
  ****************************************************************************
  ****************************************************************************
 }
 }
+{$ifdef TP}
+  {$N+,E+}
+{$endif}
 unit ppu;
 unit ppu;
 interface
 interface
 
 
@@ -33,21 +36,25 @@ const
 {$endif}
 {$endif}
 
 
 {ppu entries}
 {ppu entries}
-  ibmodulename    = 1;
-  ibsourcefile    = 2;
-  ibloadunit_int  = 3;
-  ibloadunit_imp  = 4;
-  ibinitunit      = 5;
-  iblinkofile     = 6;
-  ibsharedlibs    = 7;
-  ibstaticlibs    = 8;
-  ibdbxcount      = 9;
-  ibref           = 10;
-  ibenddefs       = 250;
-  ibendsyms       = 251;
-  ibendheader     = 252;
-  ibentry         = 254;
-  ibend           = 255;
+  {special}
+  iberror             = 0;
+  ibenddefs           = 250;
+  ibendsyms           = 251;
+  ibendinterface      = 252;
+  ibendimplementation = 253;
+  ibentry             = 254;
+  ibend               = 255;
+  {general}
+  ibmodulename     = 1;
+  ibsourcefiles    = 2;
+  ibloadunit_int   = 3;
+  ibloadunit_imp   = 4;
+  ibinitunit       = 5;
+  iblinkofiles     = 6;
+  iblinksharedlibs = 7;
+  iblinkstaticlibs = 8;
+  ibdbxcount       = 9;
+  ibref            = 10;
   {syms}
   {syms}
   ibtypesym       = 20;
   ibtypesym       = 20;
   ibprocsym       = 21;
   ibprocsym       = 21;
@@ -97,8 +104,8 @@ type
     compiler : word;
     compiler : word;
     target   : word;
     target   : word;
     flags    : longint;
     flags    : longint;
-    size     : longint;
-    checksum : longint;
+    size     : longint; { size of the ppufile without header }
+    checksum : longint; { checksum for this ppufile }
   end;
   end;
 
 
   tppuentry=packed record
   tppuentry=packed record
@@ -125,6 +132,7 @@ type
     bufsize,
     bufsize,
     bufidx   : longint;
     bufidx   : longint;
     entry    : tppuentry;
     entry    : tppuentry;
+    entrybufstart,
     entrystart,
     entrystart,
     entryidx : longint;
     entryidx : longint;
 
 
@@ -136,16 +144,18 @@ type
     function  GetPPUVersion:longint;
     function  GetPPUVersion:longint;
     procedure NewHeader;
     procedure NewHeader;
     procedure NewEntry;
     procedure NewEntry;
-    function  EndOfEntry:boolean;
   {read}
   {read}
     function  open:boolean;
     function  open:boolean;
     procedure reloadbuf;
     procedure reloadbuf;
     procedure readdata(var b;len:longint);
     procedure readdata(var b;len:longint);
+    procedure skipdata(len:longint);
     function  readentry:byte;
     function  readentry:byte;
+    function  EndOfEntry:boolean;
     procedure getdata(var b;len:longint);
     procedure getdata(var b;len:longint);
     function  getbyte:byte;
     function  getbyte:byte;
     function  getword:word;
     function  getword:word;
     function  getlongint:longint;
     function  getlongint:longint;
+    function  getdouble:double;
     function  getstring:string;
     function  getstring:string;
   {write}
   {write}
     function  create:boolean;
     function  create:boolean;
@@ -157,6 +167,7 @@ type
     procedure putbyte(b:byte);
     procedure putbyte(b:byte);
     procedure putword(w:word);
     procedure putword(w:word);
     procedure putlongint(l:longint);
     procedure putlongint(l:longint);
+    procedure putdouble(d:double);
     procedure putstring(s:string);
     procedure putstring(s:string);
   end;
   end;
 
 
@@ -240,6 +251,7 @@ begin
   change_endian:=false;
   change_endian:=false;
   Mode:=0;
   Mode:=0;
   NewHeader;
   NewHeader;
+  Error:=false;
   getmem(buf,ppubufsize);
   getmem(buf,ppubufsize);
 end;
 end;
 
 
@@ -308,24 +320,6 @@ begin
 end;
 end;
 
 
 
 
-procedure tppufile.NewEntry;
-begin
-  with entry do
-   begin
-     id:=ibentry;
-     nr:=ibend;
-     size:=0;
-   end;
-  entryidx:=0;
-end;
-
-
-
-function tppufile.endofentry:boolean;
-begin
-  endofentry:=(entryidx>=entry.size);
-end;
-
 {*****************************************************************************
 {*****************************************************************************
                                 TPPUFile Reading
                                 TPPUFile Reading
 *****************************************************************************}
 *****************************************************************************}
@@ -353,7 +347,10 @@ begin
 {reset buffer}
 {reset buffer}
   bufstart:=i;
   bufstart:=i;
   bufsize:=0;
   bufsize:=0;
+  bufidx:=0;
   Mode:=1;
   Mode:=1;
+  FillChar(entry,sizeof(tppuentry),0);
+  Error:=false;
   open:=true;
   open:=true;
 end;
 end;
 
 
@@ -366,10 +363,10 @@ var
 begin
 begin
   inc(bufstart,bufsize);
   inc(bufstart,bufsize);
 {$ifdef TP}
 {$ifdef TP}
-  blockread(f,buf,ppubufsize,i);
+  blockread(f,buf^,ppubufsize,i);
   bufsize:=i;
   bufsize:=i;
 {$else}
 {$else}
-  blockread(f,buf,ppubufsize,bufsize);
+  blockread(f,buf^,ppubufsize,bufsize);
 {$endif}
 {$endif}
   bufidx:=0;
   bufidx:=0;
 end;
 end;
@@ -405,16 +402,48 @@ begin
 end;
 end;
 
 
 
 
+procedure tppufile.skipdata(len:longint);
+var
+  left : longint;
+begin
+  while len>0 do
+   begin
+     left:=bufsize-bufidx;
+     if len>left then
+      begin
+        dec(len,left);
+        reloadbuf;
+        if bufsize=0 then
+         exit;
+      end
+     else
+      begin
+        inc(bufidx,len);
+        exit;
+      end;
+   end;
+end;
+
+
 function tppufile.readentry:byte;
 function tppufile.readentry:byte;
 begin
 begin
+  if entryidx<entry.size then
+   skipdata(entry.size-entryidx);
   readdata(entry,sizeof(tppuentry));
   readdata(entry,sizeof(tppuentry));
+  entryidx:=0;
   if entry.id<>ibentry then
   if entry.id<>ibentry then
    begin
    begin
+     readentry:=iberror;
      error:=true;
      error:=true;
      exit;
      exit;
    end;
    end;
   readentry:=entry.nr;
   readentry:=entry.nr;
-  entryidx:=0;
+end;
+
+
+function tppufile.endofentry:boolean;
+begin
+  endofentry:=(entryidx>=entry.size);
 end;
 end;
 
 
 
 
@@ -485,6 +514,25 @@ begin
 end;
 end;
 
 
 
 
+function tppufile.getdouble:double;
+type
+  pdouble = ^double;
+var
+  d : double;
+begin
+  if entryidx+sizeof(double)>entry.size then
+   begin
+     error:=true;
+     exit;
+   end;
+  readdata(d,sizeof(double));
+  getdouble:=d;
+{
+  getlongint:=plongint(@entrybuf[entrybufidx])^;}
+  inc(entryidx,sizeof(double));
+end;
+
+
 function tppufile.getstring:string;
 function tppufile.getstring:string;
 var
 var
   s : string;
   s : string;
@@ -519,10 +567,15 @@ begin
 {write header for sure}
 {write header for sure}
   blockwrite(f,header,sizeof(tppuheader));
   blockwrite(f,header,sizeof(tppuheader));
   bufsize:=ppubufsize;
   bufsize:=ppubufsize;
+  bufstart:=sizeof(tppuheader);
+  bufidx:=0;
 {reset}
 {reset}
   crc:=$ffffffff;
   crc:=$ffffffff;
+  Error:=false;
   do_crc:=true;
   do_crc:=true;
   size:=0;
   size:=0;
+{start}
+  NewEntry;
   create:=true;
   create:=true;
 end;
 end;
 
 
@@ -531,7 +584,11 @@ procedure tppufile.writeheader;
 var
 var
   opos : longint;
   opos : longint;
 begin
 begin
+{ flush buffer }
   writebuf;
   writebuf;
+{ update size (w/o header!) in the header }
+  header.size:=bufstart-sizeof(tppuheader);
+{ write header and restore filepos after it }
   opos:=filepos(f);
   opos:=filepos(f);
   seek(f,0);
   seek(f,0);
   blockwrite(f,header,sizeof(tppuheader));
   blockwrite(f,header,sizeof(tppuheader));
@@ -543,7 +600,7 @@ procedure tppufile.writebuf;
 begin
 begin
   if do_crc then
   if do_crc then
    UpdateCrc32(crc,buf,bufidx);
    UpdateCrc32(crc,buf,bufidx);
-  blockwrite(f,buf,bufidx);
+  blockwrite(f,buf^,bufidx);
   inc(bufstart,bufidx);
   inc(bufstart,bufidx);
   bufidx:=0;
   bufidx:=0;
 end;
 end;
@@ -565,6 +622,7 @@ begin
         move(p[idx],buf[bufidx],left);
         move(p[idx],buf[bufidx],left);
         dec(len,left);
         dec(len,left);
         inc(idx,left);
         inc(idx,left);
+        inc(bufidx,left);
         writebuf;
         writebuf;
       end
       end
      else
      else
@@ -577,6 +635,23 @@ begin
 end;
 end;
 
 
 
 
+procedure tppufile.NewEntry;
+begin
+  with entry do
+   begin
+     id:=ibentry;
+     nr:=ibend;
+     size:=0;
+   end;
+{Reset Entry State}
+  entryidx:=0;
+  entrybufstart:=bufstart;
+  entrystart:=bufstart+bufidx;
+{Alloc in buffer}
+  writedata(entry,sizeof(tppuentry));
+end;
+
+
 procedure tppufile.writeentry(ibnr:byte);
 procedure tppufile.writeentry(ibnr:byte);
 var
 var
   opos : longint;
   opos : longint;
@@ -585,17 +660,24 @@ begin
   entry.id:=ibentry;
   entry.id:=ibentry;
   entry.nr:=ibnr;
   entry.nr:=ibnr;
   entry.size:=entryidx;
   entry.size:=entryidx;
-{flush}
-  writebuf;
-{write entry}
-  opos:=filepos(f);
-  seek(f,entrystart);
-  blockwrite(f,entry,sizeof(tppuentry));
-  seek(f,opos);
-  entrystart:=opos; {next entry position}
+{it's already been sent to disk ?}
+  if entrybufstart<>bufstart then
+   begin
+   {flush when the entry is partly in the new buffer}
+     if entrybufstart+sizeof(entry)>bufstart then
+      WriteBuf;
+   {write entry}
+     opos:=filepos(f);
+     seek(f,entrystart);
+     blockwrite(f,entry,sizeof(tppuentry));
+     seek(f,opos);
+     entrybufstart:=bufstart;
+   end
+  else
+   move(entry,buf[entrystart-bufstart],sizeof(entry));
 {Add New Entry, which is ibend by default}
 {Add New Entry, which is ibend by default}
+  entrystart:=bufstart+bufidx; {next entry position}
   NewEntry;
   NewEntry;
-  writedata(entry,sizeof(tppuentry));
 end;
 end;
 
 
 
 
@@ -640,6 +722,15 @@ begin
 end;
 end;
 
 
 
 
+procedure tppufile.putdouble(d:double);
+type
+  pdouble = ^double;
+begin
+{  plongint(@entrybuf[entrybufidx])^:=l;}
+  writedata(d,sizeof(double));
+  inc(entryidx,sizeof(double));
+end;
+
 procedure tppufile.putstring(s:string);
 procedure tppufile.putstring(s:string);
 begin
 begin
   writedata(s,length(s)+1);
   writedata(s,length(s)+1);
@@ -651,7 +742,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-05-27 19:45:08  peter
+  Revision 1.3  1998-05-28 14:40:26  peter
+    * fixes for newppu, remake3 works now with it
+
+  Revision 1.2  1998/05/27 19:45:08  peter
     * symtable.pas splitted into includefiles
     * symtable.pas splitted into includefiles
     * symtable adapted for $ifdef NEWPPU
     * symtable adapted for $ifdef NEWPPU
 
 

+ 41 - 39
compiler/symppu.inc

@@ -39,32 +39,32 @@
 
 
     procedure writebyte(b:byte);
     procedure writebyte(b:byte);
       begin
       begin
-        ppufile.putbyte(b);
+        ppufile^.putbyte(b);
       end;
       end;
 
 
     procedure writeword(w:word);
     procedure writeword(w:word);
       begin
       begin
-        ppufile.putword(w);
+        ppufile^.putword(w);
       end;
       end;
 
 
     procedure writelong(l:longint);
     procedure writelong(l:longint);
       begin
       begin
-        ppufile.putlongint(l);
+        ppufile^.putlongint(l);
       end;
       end;
 
 
     procedure writedouble(d:double);
     procedure writedouble(d:double);
       begin
       begin
-        ppufile.putdata(d,sizeof(double));
+        ppufile^.putdata(d,sizeof(double));
       end;
       end;
 
 
     procedure writestring(const s:string);
     procedure writestring(const s:string);
       begin
       begin
-        ppufile.putstring(s);
+        ppufile^.putstring(s);
       end;
       end;
 
 
     procedure writeset(var s); {You cannot pass an array[0..31] of byte!}
     procedure writeset(var s); {You cannot pass an array[0..31] of byte!}
       begin
       begin
-        ppufile.putdata(s,32);
+        ppufile^.putdata(s,32);
       end;
       end;
 
 
     procedure writecontainer(var p:tstringcontainer;id:byte;hold:boolean);
     procedure writecontainer(var p:tstringcontainer;id:byte;hold:boolean);
@@ -77,11 +77,11 @@
         while not p.empty do
         while not p.empty do
          begin
          begin
            s:=p.get;
            s:=p.get;
-           ppufile.putstring(s);
+           ppufile^.putstring(s);
            if hold then
            if hold then
             hcontainer.insert(s);
             hcontainer.insert(s);
          end;
          end;
-        ppufile.writeentry(id);
+        ppufile^.writeentry(id);
         if hold then
         if hold then
          p:=hcontainer;
          p:=hcontainer;
       end;
       end;
@@ -96,14 +96,14 @@
     procedure writedefref(p : pdef);
     procedure writedefref(p : pdef);
       begin
       begin
         if p=nil then
         if p=nil then
-         ppufile.putlongint($ffffffff)
+         ppufile^.putlongint($ffffffff)
         else
         else
          begin
          begin
            if (p^.owner^.symtabletype in [recordsymtable,objectsymtable]) then
            if (p^.owner^.symtabletype in [recordsymtable,objectsymtable]) then
-            ppufile.putword($ffff)
+            ppufile^.putword($ffff)
            else
            else
-            ppufile.putword(p^.owner^.unitid);
-           ppufile.putword(p^.number);
+            ppufile^.putword(p^.owner^.unitid);
+           ppufile^.putword(p^.number);
          end;
          end;
       end;
       end;
 
 
@@ -151,9 +151,9 @@
 {$endif UseBrowser}
 {$endif UseBrowser}
           end;
           end;
 
 
-         ppufile.init(s);
-         ppufile.change_endian:=source_os.endian<>target_os.endian;
-         if not ppufile.create then
+         ppufile:=new(pppufile,init(s));
+         ppufile^.change_endian:=source_os.endian<>target_os.endian;
+         if not ppufile^.create then
           Message(unit_f_ppu_cannot_write);
           Message(unit_f_ppu_cannot_write);
          unit_symtable^.writeasunit;
          unit_symtable^.writeasunit;
 {$ifdef UseBrowser}
 {$ifdef UseBrowser}
@@ -167,19 +167,19 @@
               pus:=punitsymtable(pus^.next);
               pus:=punitsymtable(pus^.next);
            end;
            end;
 {$endif UseBrowser}
 {$endif UseBrowser}
-         ppufile.flush;
+         ppufile^.flush;
        { create and write header }
        { create and write header }
-         ppufile.header.size:=ppufile.size;
-         ppufile.header.checksum:=ppufile.crc;
-         ppufile.header.compiler:=wordversion;
-         ppufile.header.target:=word(target_info.target);
-         ppufile.header.flags:=current_module^.flags;
-         ppufile.writeheader;
+         ppufile^.header.size:=ppufile^.size;
+         ppufile^.header.checksum:=ppufile^.crc;
+         ppufile^.header.compiler:=wordversion;
+         ppufile^.header.target:=word(target_info.target);
+         ppufile^.header.flags:=current_module^.flags;
+         ppufile^.writeheader;
        { save crc in current_module also }
        { save crc in current_module also }
-         current_module^.crc:=ppufile.crc;
+         current_module^.crc:=ppufile^.crc;
        { close }
        { close }
-         ppufile.close;
-         ppufile.done;
+         ppufile^.close;
+         dispose(ppufile,done);
       end;
       end;
 
 
 
 
@@ -343,22 +343,22 @@
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
     function readbyte:byte;
     function readbyte:byte;
       begin
       begin
-        readbyte:=current_module^.ppufile^.getbyte;
-        if current_module^.ppufile^.error then
+        readbyte:=ppufile^.getbyte;
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
       end;
       end;
 
 
     function readword:word;
     function readword:word;
       begin
       begin
-        readword:=current_module^.ppufile^.getword;
-        if current_module^.ppufile^.error then
+        readword:=ppufile^.getword;
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
       end;
       end;
 
 
     function readlong:longint;
     function readlong:longint;
       begin
       begin
-        readlong:=current_module^.ppufile^.getlongint;
-        if current_module^.ppufile^.error then
+        readlong:=ppufile^.getlongint;
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
       end;
       end;
 
 
@@ -366,29 +366,28 @@
       var
       var
          d : double;
          d : double;
       begin
       begin
-        current_module^.ppufile^.getdata(d,sizeof(double));
-        if current_module^.ppufile^.error then
+        ppufile^.getdata(d,sizeof(double));
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
         readdouble:=d;
         readdouble:=d;
       end;
       end;
 
 
     function readstring : string;
     function readstring : string;
       begin
       begin
-        readstring:=current_module^.ppufile^.getstring;
-        if current_module^.ppufile^.error then
+        readstring:=ppufile^.getstring;
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
       end;
       end;
 
 
     procedure readset(var s);   {You cannot pass an array [0..31] of byte.}
     procedure readset(var s);   {You cannot pass an array [0..31] of byte.}
       begin
       begin
-        current_module^.ppufile^.getdata(s,32);
-        if current_module^.ppufile^.error then
+        ppufile^.getdata(s,32);
+        if ppufile^.error then
          Message(unit_f_ppu_read_error);
          Message(unit_f_ppu_read_error);
       end;
       end;
 
 
     procedure readcontainer(var p:tstringcontainer);
     procedure readcontainer(var p:tstringcontainer);
       begin
       begin
-        p.init;
         while not current_module^.ppufile^.endofentry do
         while not current_module^.ppufile^.endofentry do
          p.insert(current_module^.ppufile^.getstring);
          p.insert(current_module^.ppufile^.getstring);
       end;
       end;
@@ -533,7 +532,10 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-05-27 19:45:09  peter
+  Revision 1.2  1998-05-28 14:40:28  peter
+    * fixes for newppu, remake3 works now with it
+
+  Revision 1.1  1998/05/27 19:45:09  peter
     * symtable.pas splitted into includefiles
     * symtable.pas splitted into includefiles
     * symtable adapted for $ifdef NEWPPU
     * symtable adapted for $ifdef NEWPPU
 
 

+ 28 - 22
compiler/symsym.inc

@@ -89,7 +89,7 @@
          b:=readentry;
          b:=readentry;
          if b=ibref then
          if b=ibref then
           begin
           begin
-            while (not ppufile.endofentry) do
+            while (not ppufile^.endofentry) do
              begin
              begin
                fileindex:=readword;
                fileindex:=readword;
                l:=readlong;
                l:=readlong;
@@ -112,7 +112,7 @@
       { references do not change the ppu caracteristics      }
       { references do not change the ppu caracteristics      }
       { this only save the references to variables/functions }
       { this only save the references to variables/functions }
       { defined in the unit what about the others            }
       { defined in the unit what about the others            }
-         ppufile.do_crc:=false;
+         ppufile^.do_crc:=false;
          if assigned(lastwritten) then
          if assigned(lastwritten) then
            ref:=lastwritten
            ref:=lastwritten
          else
          else
@@ -123,8 +123,8 @@
               ref:=ref^.nextref;
               ref:=ref^.nextref;
            end;
            end;
          lastwritten:=lastref;
          lastwritten:=lastref;
-         ppufile.writeentry(ibref);
-         ppufile.do_crc:=true;
+         ppufile^.writeentry(ibref);
+         ppufile^.do_crc:=true;
       end;
       end;
 
 
 
 
@@ -156,7 +156,7 @@
       var ref : pref;
       var ref : pref;
           prdef : pdef;
           prdef : pdef;
       begin
       begin
-         ppufile.do_crc:=false;
+         ppufile^.do_crc:=false;
          if lastwritten=lastref then
          if lastwritten=lastref then
            exit;
            exit;
          writesymref(@self);
          writesymref(@self);
@@ -173,7 +173,7 @@
                    prdef:=pprocdef(prdef)^.nextoverloaded;
                    prdef:=pprocdef(prdef)^.nextoverloaded;
                 end;
                 end;
            end;
            end;
-         ppufile.do_crc:=true;
+         ppufile^.do_crc:=true;
       end;
       end;
 
 
 {$else NEWPPU}
 {$else NEWPPU}
@@ -209,7 +209,7 @@
       { references do not change the ppu caracteristics      }
       { references do not change the ppu caracteristics      }
       { this only save the references to variables/functions }
       { this only save the references to variables/functions }
       { defined in the unit what about the others            }
       { defined in the unit what about the others            }
-         ppufile.do_crc:=false;
+         ppufile^.do_crc:=false;
          if assigned(lastwritten) then
          if assigned(lastwritten) then
            ref:=lastwritten
            ref:=lastwritten
          else
          else
@@ -224,7 +224,7 @@
            end;
            end;
          lastwritten:=lastref;
          lastwritten:=lastref;
          writebyte(ibend);
          writebyte(ibend);
-         ppufile.do_crc:=true;
+         ppufile^.do_crc:=true;
       end;
       end;
 
 
 
 
@@ -263,7 +263,7 @@
       var ref : pref;
       var ref : pref;
           prdef : pdef;
           prdef : pdef;
       begin
       begin
-         ppufile.do_crc:=false;
+         ppufile^.do_crc:=false;
          if lastwritten=lastref then
          if lastwritten=lastref then
            exit;
            exit;
          writebyte(ibextsymref);
          writebyte(ibextsymref);
@@ -291,7 +291,7 @@
                    prdef:=pprocdef(prdef)^.nextoverloaded;
                    prdef:=pprocdef(prdef)^.nextoverloaded;
                 end;
                 end;
            end;
            end;
-         ppufile.do_crc:=true;
+         ppufile^.do_crc:=true;
       end;
       end;
 
 
 {$endif NEWPPU}
 {$endif NEWPPU}
@@ -363,7 +363,7 @@
       var
       var
          s : string;
          s : string;
          b : byte;
          b : byte;
-{$endif tp}
+{$endif}
       begin
       begin
 {$ifdef tp}
 {$ifdef tp}
          if use_big then
          if use_big then
@@ -376,7 +376,10 @@
            end
            end
          else
          else
 {$endif}
 {$endif}
-          name:=strpas(_name);
+        if assigned(_name) then
+         name:=strpas(_name)
+        else
+         name:='';
       end;
       end;
 
 
     function tsym.mangledname : string;
     function tsym.mangledname : string;
@@ -575,7 +578,7 @@
          tsym.write;
          tsym.write;
          writedefref(pdef(definition));
          writedefref(pdef(definition));
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibprocsym);
+         ppufile^.writeentry(ibprocsym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -733,7 +736,7 @@
          writedefref(readaccessdef);
          writedefref(readaccessdef);
          writedefref(writeaccessdef);
          writedefref(writeaccessdef);
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibpropertysym);
+         ppufile^.writeentry(ibpropertysym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -816,7 +819,7 @@
           toaddr : writelong(address);
           toaddr : writelong(address);
          end;
          end;
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-        ppufile.writeentry(ibabsolutesym);
+        ppufile^.writeentry(ibabsolutesym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -929,7 +932,7 @@
 
 
          writedefref(definition);
          writedefref(definition);
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibvarsym);
+         ppufile^.writeentry(ibvarsym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -1248,7 +1251,7 @@
          writedefref(definition);
          writedefref(definition);
          writestring(prefix^);
          writestring(prefix^);
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibtypedconstsym);
+         ppufile^.writeentry(ibtypedconstsym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -1394,7 +1397,7 @@
             else internalerror(13);
             else internalerror(13);
          end;
          end;
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-        ppufile.writeentry(ibconstsym);
+        ppufile^.writeentry(ibconstsym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -1504,7 +1507,7 @@
          writedefref(definition);
          writedefref(definition);
          writelong(value);
          writelong(value);
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibenumsym);
+         ppufile^.writeentry(ibenumsym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -1580,7 +1583,7 @@
          tsym.write;
          tsym.write;
          writedefref(definition);
          writedefref(definition);
 {$ifdef NEWPPU}
 {$ifdef NEWPPU}
-         ppufile.writeentry(ibtypesym);
+         ppufile^.writeentry(ibtypesym);
 {$endif}
 {$endif}
       end;
       end;
 
 
@@ -1687,9 +1690,12 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-05-27 19:45:09  peter
+  Revision 1.2  1998-05-28 14:40:29  peter
+    * fixes for newppu, remake3 works now with it
+
+  Revision 1.1  1998/05/27 19:45:09  peter
     * symtable.pas splitted into includefiles
     * symtable.pas splitted into includefiles
     * symtable adapted for $ifdef NEWPPU
     * symtable adapted for $ifdef NEWPPU
 
 
 }
 }
-  
+