Pārlūkot izejas kodu

* fixed bug #698
* removed some notes about unused vars

peter 26 gadi atpakaļ
vecāks
revīzija
d3b404c1a4

+ 12 - 13
compiler/cg386cnv.pas

@@ -603,18 +603,13 @@ implementation
                   CGMessage(type_e_mismatch);
                   l:=255;
                 end;
-               { first get the memory for the string }
-               gettempofsizereference(256,pto^.location.reference);
-               { write the length }
-               emit_const_ref(A_MOV,S_B,l,
-                 newreference(pto^.location.reference));
-               { copy to first char of string }
-               inc(pto^.location.reference.offset);
-               { generates the copy code      }
-               { and we need the source never }
-               concatcopy(pfrom^.location.reference,pto^.location.reference,l,true,false);
-               { correct the string location }
-               dec(pto^.location.reference.offset);
+               gettempofsizereference(pto^.resulttype^.size,pto^.location.reference);
+               pushusedregisters(pushed,$ff);
+               emit_push_lea_loc(pfrom^.location,true);
+               emitpushreferenceaddr(pto^.location.reference);
+               emitcall('FPC_PCHAR_TO_SHORTSTR');
+               maybe_loadesi;
+               popusedregisters(pushed);
              end;
            st_ansistring :
              begin
@@ -1491,7 +1486,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.94  1999-11-29 22:15:25  pierre
+  Revision 1.95  1999-12-01 12:42:31  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.94  1999/11/29 22:15:25  pierre
    * fix for internalerror(12) on ord(booleanarray[1])
 
   Revision 1.93  1999/11/06 14:34:17  peter

+ 6 - 7
compiler/cg386inl.pas

@@ -204,7 +204,6 @@ implementation
            typedtyp,
            pararesult : pdef;
            orgfloattype : tfloattype;
-           has_length : boolean;
            dummycoll  : tparaitem;
            iolabel    : pasmlabel;
            npara      : longint;
@@ -224,7 +223,6 @@ implementation
            else
              iolabel:=nil;
            { for write of real with the length specified }
-           has_length:=false;
            hp:=nil;
            { reserve temporary pointer to data variable }
            aktfile.symbol:=nil;
@@ -379,7 +377,6 @@ implementation
                                    hp^.right:=node;
                                    if codegenerror then
                                      exit;
-                                   has_length:=true;
                                 end
                               else
                                 if pararesult^.deftype<>floatdef then
@@ -524,7 +521,7 @@ implementation
         var
            hp,node : ptree;
            dummycoll : tparaitem;
-           is_real,has_length : boolean;
+           is_real : boolean;
            realtype : tfloattype;
            procedureprefix : string;
 
@@ -534,7 +531,6 @@ implementation
            pushusedregisters(pushed,$ff);
            node:=p^.left;
            is_real:=false;
-           has_length:=false;
            while assigned(node^.right) do node:=node^.right;
            { if a real parameter somewhere then call REALSTR }
            if (node^.left^.resulttype^.deftype=floatdef) then
@@ -588,7 +584,6 @@ implementation
                 hp:=node;
                 node:=node^.right;
                 hp^.right:=nil;
-                has_length:=true;
              end
            else
              if is_real then
@@ -1440,7 +1435,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.81  1999-11-30 10:40:42  peter
+  Revision 1.82  1999-12-01 12:42:31  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.81  1999/11/30 10:40:42  peter
     + ttype, tsymlist
 
   Revision 1.80  1999/11/29 00:30:06  pierre

+ 5 - 3
compiler/cg386mem.pas

@@ -400,7 +400,6 @@ implementation
          { to detect if it is an ansistring                          }
          { because in constant nodes which constant index              }
          { the left tree is removed                                  }
-         rl : pdef;
          t   : ptree;
          hp  : preference;
          href : treference;
@@ -410,7 +409,6 @@ implementation
          hl,otl,ofl : pasmlabel;
       begin
          secondpass(p^.left);
-         rl:=p^.left^.resulttype;
          { we load the array reference to p^.location }
 
          { an ansistring needs to be dereferenced }
@@ -883,7 +881,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.62  1999-11-30 10:40:43  peter
+  Revision 1.63  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.62  1999/11/30 10:40:43  peter
     + ttype, tsymlist
 
   Revision 1.61  1999/11/15 21:54:38  peter

+ 5 - 3
compiler/comprsrc.pas

@@ -40,7 +40,6 @@ uses
 
 procedure CompileResourceFiles;
 var
-  resnr : longint;
   s     : string;
 
   procedure CompileResource(const fn:string);
@@ -99,7 +98,6 @@ var
   end;
 
 begin
-  resnr:=0;
   While not Current_module^.ResourceFiles.Empty do
    begin
      S:=Current_module^.ResourceFiles.get;
@@ -111,7 +109,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.7  1999-11-12 11:03:50  peter
+  Revision 1.8  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.7  1999/11/12 11:03:50  peter
     * searchpaths changed to stringqueue object
 
   Revision 1.6  1999/07/18 10:19:49  florian

+ 7 - 2
compiler/hcgdata.pas

@@ -444,7 +444,8 @@ implementation
                                        { only if both are virtual !!  }
                                        if (procdefcoll^.data^.proccalloptions<>hp^.proccalloptions) or
                                           (procdefcoll^.data^.proctypeoption<>hp^.proctypeoption) or
-                                          ((procdefcoll^.data^.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler])<>
+                                          ((procdefcoll^.data^.procoptions-
+                                              [po_abstractmethod,po_overridingmethod,po_assembler])<>
                                            (hp^.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler])) then
                                          Message1(parser_e_header_dont_match_forward,_c^.objname^+'.'+_name);
 
@@ -615,7 +616,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.20  1999-11-30 10:40:43  peter
+  Revision 1.21  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.20  1999/11/30 10:40:43  peter
     + ttype, tsymlist
 
   Revision 1.19  1999/11/29 23:42:49  pierre

+ 13 - 16
compiler/hcodegen.pas

@@ -288,15 +288,19 @@ implementation
         framepointer:=R_NO;
         globalsymbol:=false;
         exported:=false;
-        aktproccode:=nil;
-        aktentrycode:=nil;
-        aktexitcode:=nil;
-        aktlocaldata:=nil;
+        aktentrycode:=new(paasmoutput,init);
+        aktexitcode:=new(paasmoutput,init);
+        aktproccode:=new(paasmoutput,init);
+        aktlocaldata:=new(paasmoutput,init);
       end;
 
 
     destructor tprocinfo.done;
       begin
+         dispose(aktentrycode,done);
+         dispose(aktexitcode,done);
+         dispose(aktproccode,done);
+         dispose(aktlocaldata,done);
       end;
 
 
@@ -312,23 +316,12 @@ implementation
            so it must not be reset to zero before this storage !}
          { new procinfo }
          new(procinfo,init);
-         { the type of this lists isn't important }
-         { because the code of this lists is      }
-         { copied to the code segment        }
-         procinfo^.aktentrycode:=new(paasmoutput,init);
-         procinfo^.aktexitcode:=new(paasmoutput,init);
-         procinfo^.aktproccode:=new(paasmoutput,init);
-         procinfo^.aktlocaldata:=new(paasmoutput,init);
       end;
 
 
 
     procedure codegen_doneprocedure;
       begin
-         dispose(procinfo^.aktentrycode,done);
-         dispose(procinfo^.aktexitcode,done);
-         dispose(procinfo^.aktproccode,done);
-         dispose(procinfo^.aktlocaldata,done);
          dispose(procinfo,done);
          procinfo:=nil;
       end;
@@ -407,7 +400,11 @@ end.
 
 {
   $Log$
-  Revision 1.50  1999-11-30 10:40:43  peter
+  Revision 1.51  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.50  1999/11/30 10:40:43  peter
     + ttype, tsymlist
 
   Revision 1.49  1999/11/17 17:04:59  pierre

+ 61 - 26
compiler/new/cgbase.pas

@@ -25,7 +25,7 @@ unit cgbase;
   interface
 
     uses
-       globtype,cobjects,aasm,symtable,verbose,tree,cpuasm,cpubase;
+       globtype,cobjects,aasm,symconst,symtable,verbose,tree,cpuasm,cpubase;
 
     const
        pi_uses_asm  = $1;       { set, if the procedure uses asm }
@@ -50,33 +50,29 @@ unit cgbase;
        TCgSize = (OS_NO,OS_8,OS_16,OS_32,OS_64);
 
        pprocinfo = ^tprocinfo;
-       tprocinfo = record
+       tprocinfo = object
           { pointer to parent in nested procedures }
           parent : pprocinfo;
           { current class, if we are in a method }
           _class : pobjectdef;
           { return type }
-          retdef : pdef;
-          { return type }
-          sym : pprocsym;
+          returntype : ttype;
           { symbol of the function, and the sym for result variable }
           resultfuncretsym,
           funcretsym : pfuncretsym;
+          funcret_state : tvarstate;
           { the definition of the proc itself }
-          { why was this a pdef only ?? PM    }
           def : pprocdef;
+          sym : pprocsym;
+
           { frame pointer offset }
           framepointer_offset : longint;
           { self pointer offset }
           selfpointer_offset : longint;
           { result value offset }
-          retoffset : longint;
-
+          return_offset : longint;
           { firsttemp position }
-          firsttemp : longint;
-
-          funcret_is_valid : boolean;
-
+          firsttemp_offset : longint;
           { parameter offset }
           call_offset : longint;
 
@@ -101,6 +97,9 @@ unit cgbase;
           aktproccode,aktentrycode,
           aktexitcode,aktlocaldata : paasmoutput;
           { local data is used for smartlink }
+
+          constructor init;
+          destructor done;
        end;
 
        { some kind of temp. types needs to be destructed }
@@ -308,6 +307,48 @@ unit cgbase;
            end;
       end;
 
+
+{****************************************************************************
+                                 TProcInfo
+****************************************************************************}
+
+    constructor tprocinfo.init;
+      begin
+        parent:=nil;
+        _class:=nil;
+        returntype.reset;
+        resultfuncretsym:=nil;
+        funcretsym:=nil;
+        funcret_state:=vs_none;
+        def:=nil;
+        sym:=nil;
+        framepointer_offset:=0;
+        selfpointer_offset:=0;
+        return_offset:=0;
+        firsttemp_offset:=0;
+        call_offset:=0;
+        registerstosave:=[];
+        flags:=0;
+        framepointer:=R_NO;
+        globalsymbol:=false;
+        exported:=false;
+        aktentrycode:=new(paasmoutput,init);
+        aktexitcode:=new(paasmoutput,init);
+        aktproccode:=new(paasmoutput,init);
+        aktlocaldata:=new(paasmoutput,init);
+      end;
+
+
+    destructor tprocinfo.done;
+      begin
+         dispose(aktentrycode,done);
+         dispose(aktexitcode,done);
+         dispose(aktproccode,done);
+         dispose(aktlocaldata,done);
+      end;
+
+
+
 {*****************************************************************************
          initialize/terminate the codegen for procedure and modules
 *****************************************************************************}
@@ -316,27 +357,17 @@ unit cgbase;
       begin
          aktbreaklabel:=nil;
          aktcontinuelabel:=nil;
-         new(procinfo);
+         new(procinfo,init);
          { aktexitlabel:=0; is store in oldaktexitlabel
            so it must not be reset to zero before this storage !}
-         { the type of this lists isn't important }
-         { because the code of this lists is      }
-         { copied to the code segment             }
-         procinfo^.aktentrycode:=new(paasmoutput,init);
-         procinfo^.aktexitcode:=new(paasmoutput,init);
-         procinfo^.aktproccode:=new(paasmoutput,init);
-         procinfo^.aktlocaldata:=new(paasmoutput,init);
       end;
 
 
 
     procedure codegen_doneprocedure;
       begin
-         dispose(procinfo^.aktentrycode,done);
-         dispose(procinfo^.aktexitcode,done);
-         dispose(procinfo^.aktproccode,done);
-         dispose(procinfo^.aktlocaldata,done);
-         dispose(procinfo);
+         dispose(procinfo,done);
+         procinfo:=nil;
       end;
 
 
@@ -481,7 +512,11 @@ unit cgbase;
 end.
 {
   $Log$
-  Revision 1.12  1999-11-05 13:15:00  florian
+  Revision 1.13  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.12  1999/11/05 13:15:00  florian
     * some fixes to get the new cg compiling again
 
   Revision 1.11  1999/10/14 14:57:54  florian

+ 41 - 37
compiler/new/cgobj.pas

@@ -445,10 +445,10 @@ unit cgobj;
 
       begin
          if (psym(p)^.typ=varsym) and
-            assigned(pvarsym(p)^.definition) and
-            not((pvarsym(p)^.definition^.deftype=objectdef) and
-              pobjectdef(pvarsym(p)^.definition)^.is_class) and
-            pvarsym(p)^.definition^.needs_inittable then
+            assigned(pvarsym(p)^.vartype.def) and
+            not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
+              pobjectdef(pvarsym(p)^.vartype.def)^.is_class) and
+            pvarsym(p)^.vartype.def^.needs_inittable then
            begin
               procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
               reset_reference(hr);
@@ -461,7 +461,7 @@ unit cgobj;
                 begin
                    hr.symbol:=newasmsymbol(pvarsym(p)^.mangledname);
                 end;
-              g_initialize(list,pvarsym(p)^.definition,hr,false);
+              g_initialize(list,pvarsym(p)^.vartype.def,hr,false);
            end;
       end;
 
@@ -474,14 +474,14 @@ unit cgobj;
 
       begin
          if (psym(p)^.typ=varsym) and
-            not((pvarsym(p)^.definition^.deftype=objectdef) and
-              pobjectdef(pvarsym(p)^.definition)^.is_class) and
-            pvarsym(p)^.definition^.needs_inittable and
+            not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
+              pobjectdef(pvarsym(p)^.vartype.def)^.is_class) and
+            pvarsym(p)^.vartype.def^.needs_inittable and
             ((pvarsym(p)^.varspez=vs_value)) then
            begin
               procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
               reset_reference(hr);
-              hr.symbol:=pvarsym(p)^.definition^.get_inittable_label;
+              hr.symbol:=pvarsym(p)^.vartype.def^.get_inittable_label;
               a_param_ref_addr(list,hr,2);
               reset_reference(hr);
               hr.base:=procinfo^.framepointer;
@@ -501,10 +501,10 @@ unit cgobj;
 
       begin
          if (psym(p)^.typ=varsym) and
-            assigned(pvarsym(p)^.definition) and
-            not((pvarsym(p)^.definition^.deftype=objectdef) and
-            pobjectdef(pvarsym(p)^.definition)^.is_class) and
-            pvarsym(p)^.definition^.needs_inittable then
+            assigned(pvarsym(p)^.vartype.def) and
+            not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
+            pobjectdef(pvarsym(p)^.vartype.def)^.is_class) and
+            pvarsym(p)^.vartype.def^.needs_inittable then
            begin
               { not all kind of parameters need to be finalized  }
               if (psym(p)^.owner^.symtabletype=parasymtable) and
@@ -528,7 +528,7 @@ unit cgobj;
                  else
                    hr.symbol:=newasmsymbol(pvarsym(p)^.mangledname);
               end;
-              g_finalize(list,pvarsym(p)^.definition,hr,false);
+              g_finalize(list,pvarsym(p)^.vartype.def,hr,false);
            end;
       end;
 
@@ -718,12 +718,12 @@ unit cgobj;
   {$endif GDB}
 
          { initialize return value }
-         if assigned(procinfo^.retdef) and
-	   is_ansistring(procinfo^.retdef) or
-           is_widestring(procinfo^.retdef) then
+         if assigned(procinfo^.returntype.def) and
+           is_ansistring(procinfo^.returntype.def) or
+           is_widestring(procinfo^.returntype.def) then
            begin
               reset_reference(hr);
-              hr.offset:=procinfo^.retoffset;
+              hr.offset:=procinfo^.return_offset;
               hr.base:=procinfo^.framepointer;
               a_load_const_ref(list,OS_32,0,hr);
            end;
@@ -855,15 +855,15 @@ unit cgobj;
               a_reg_dealloc(list,accumulator);
 
               { must be the return value finalized before reraising the exception? }
-              if (procinfo^.retdef<>pdef(voiddef)) and
-                (procinfo^.retdef^.needs_inittable) and
-                ((procinfo^.retdef^.deftype<>objectdef) or
-                not(pobjectdef(procinfo^.retdef)^.is_class)) then
+              if (procinfo^.returntype.def<>pdef(voiddef)) and
+                (procinfo^.returntype.def^.needs_inittable) and
+                ((procinfo^.returntype.def^.deftype<>objectdef) or
+                not(pobjectdef(procinfo^.returntype.def)^.is_class)) then
                 begin
                    reset_reference(hr);
-                   hr.offset:=procinfo^.retoffset;
+                   hr.offset:=procinfo^.return_offset;
                    hr.base:=procinfo^.framepointer;
-                   g_finalize(list,procinfo^.retdef,hr,ret_in_param(procinfo^.retdef));
+                   g_finalize(list,procinfo^.returntype.def,hr,ret_in_param(procinfo^.returntype.def));
                 end;
 
               a_call_name(list,'FPC_RERAISE',0);
@@ -942,25 +942,25 @@ unit cgobj;
                      '"$t:r'+procinfo^._class^.numberstring+'",'+
                      tostr(N_RSYM)+',0,0,'+tostr(GDB_i386index[R_ESI])))));
                   }
-                if (pdef(aktprocsym^.definition^.retdef) <> pdef(voiddef)) then
+                if (pdef(aktprocsym^.definition^.rettype.def) <> pdef(voiddef)) then
                   begin
-                    if ret_in_param(aktprocsym^.definition^.retdef) then
+                    if ret_in_param(aktprocsym^.definition^.rettype.def) then
                       list^.concat(new(pai_stabs,init(strpnew(
-                       '"'+aktprocsym^.name+':X*'+aktprocsym^.definition^.retdef^.numberstring+'",'+
-                       tostr(N_PSYM)+',0,0,'+tostr(procinfo^.retoffset)))))
+                       '"'+aktprocsym^.name+':X*'+aktprocsym^.definition^.rettype.def^.numberstring+'",'+
+                       tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))))
                     else
                       list^.concat(new(pai_stabs,init(strpnew(
-                       '"'+aktprocsym^.name+':X'+aktprocsym^.definition^.retdef^.numberstring+'",'+
-                       tostr(N_PSYM)+',0,0,'+tostr(procinfo^.retoffset)))));
+                       '"'+aktprocsym^.name+':X'+aktprocsym^.definition^.rettype.def^.numberstring+'",'+
+                       tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))));
                     if (m_result in aktmodeswitches) then
-                      if ret_in_param(aktprocsym^.definition^.retdef) then
+                      if ret_in_param(aktprocsym^.definition^.rettype.def) then
                         list^.concat(new(pai_stabs,init(strpnew(
-                         '"RESULT:X*'+aktprocsym^.definition^.retdef^.numberstring+'",'+
-                         tostr(N_PSYM)+',0,0,'+tostr(procinfo^.retoffset)))))
+                         '"RESULT:X*'+aktprocsym^.definition^.rettype.def^.numberstring+'",'+
+                         tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))))
                       else
                         list^.concat(new(pai_stabs,init(strpnew(
-                         '"RESULT:X'+aktprocsym^.definition^.retdef^.numberstring+'",'+
-                         tostr(N_PSYM)+',0,0,'+tostr(procinfo^.retoffset)))));
+                         '"RESULT:X'+aktprocsym^.definition^.rettype.def^.numberstring+'",'+
+                         tostr(N_PSYM)+',0,0,'+tostr(procinfo^.return_offset)))));
                   end;
                 mangled_length:=length(aktprocsym^.definition^.mangledname);
                 getmem(p,mangled_length+50);
@@ -1090,7 +1090,7 @@ unit cgobj;
       end;
 
     procedure tcg.a_jmp_cond(list : paasmoutput;cond : TOpCmp;l: pasmlabel);
-    
+
       begin
         abstract;
       end;
@@ -1116,7 +1116,11 @@ unit cgobj;
 end.
 {
   $Log$
-  Revision 1.31  1999-11-05 13:15:00  florian
+  Revision 1.32  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.31  1999/11/05 13:15:00  florian
     * some fixes to get the new cg compiling again
 
   Revision 1.30  1999/11/05 07:05:56  jonas

+ 10 - 6
compiler/new/tree.pas

@@ -285,7 +285,7 @@ unit tree;
 
           { this node is the anchestor for all classes with at least }
           { one child, you have to use it if you want to use         }
-          { true- and falselabel				     }
+          { true- and falselabel                                     }
           punarynode = ^tunarynode;
           tunarynode = object(tnode)
              left : pnode;
@@ -606,7 +606,7 @@ unit tree;
           'arrayconstructrangen',
           'nothingn',
           'loadvmtn',
-	  'pointerconstn');
+          'pointerconstn');
 
       begin
          write(indention,'(',treetype2str[treetype]);
@@ -677,7 +677,7 @@ unit tree;
 
       begin
          { we could change that depending on the number of }
-         { required registers			           }
+         { required registers                              }
          left^.parent:=@self;
          left^.concattolist(l);
          left^.parent:=@self;
@@ -1013,7 +1013,7 @@ unit tree;
          p^.registersmmx:=0;
 {$endif SUPPORT_MMX}
          p^.treetype:=loadn;
-         p^.resulttype:=v^.definition;
+         p^.resulttype:=v^.vartype.def;
          p^.symtableentry:=v;
          p^.symtable:=st;
          p^.is_first := False;
@@ -1384,7 +1384,7 @@ unit tree;
          p^.registersmmx:=0;
 {$endif SUPPORT_MMX}
          p^.treetype:=loadn;
-         p^.resulttype:=sym^.definition;
+         p^.resulttype:=sym^.typedconsttype.def;
          p^.symtableentry:=pvarsym(sym);
          p^.symtable:=st;
          p^.disposetyp:=dt_nothing;
@@ -2044,7 +2044,11 @@ unit tree;
 end.
 {
   $Log$
-  Revision 1.16  1999-11-05 13:15:01  florian
+  Revision 1.17  1999-12-01 12:42:34  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.16  1999/11/05 13:15:01  florian
     * some fixes to get the new cg compiling again
 
   Revision 1.15  1999/10/12 21:20:47  florian

+ 21 - 7
compiler/pdecl.pas

@@ -322,6 +322,7 @@ unit pdecl;
          newtype : ptypesym;
          is_dll,
          is_gpc_name,is_cdecl,extern_aktvarsym,export_aktvarsym : boolean;
+         old_current_object_option : tsymoptions;
          dll_name,
          C_name : string;
          tt,casetype : ttype;
@@ -606,14 +607,23 @@ unit pdecl;
              { insert it in the symtable, if not done yet }
              if not symdone then
                begin
+                  { save object option, because we can turn of the sp_published }
+                  old_current_object_option:=current_object_option;
                   if (sp_published in current_object_option) and
                     (not((tt.def^.deftype=objectdef) and (pobjectdef(tt.def)^.is_class))) then
-                    Message(parser_e_cant_publish_that)
-                  else if (sp_published in current_object_option) and
-                    not(oo_can_have_published in pobjectdef(tt.def)^.objectoptions) then
-                    Message(parser_e_only_publishable_classes_can__be_published);
-
-                  insert_syms(symtablestack,sc,tt,is_threadvar)
+                   begin
+                     Message(parser_e_cant_publish_that);
+                     exclude(current_object_option,sp_published);
+                   end
+                  else
+                   if (sp_published in current_object_option) and
+                      not(oo_can_have_published in pobjectdef(tt.def)^.objectoptions) then
+                    begin
+                      Message(parser_e_only_publishable_classes_can__be_published);
+                      exclude(current_object_option,sp_published);
+                    end;
+                  insert_syms(symtablestack,sc,tt,is_threadvar);
+                  current_object_option:=old_current_object_option;
                end;
            end;
          { Check for Case }
@@ -1160,7 +1170,11 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.173  1999-11-30 10:40:44  peter
+  Revision 1.174  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.173  1999/11/30 10:40:44  peter
     + ttype, tsymlist
 
   Revision 1.172  1999/11/29 15:18:27  pierre

+ 6 - 2
compiler/pexpr.pas

@@ -718,7 +718,7 @@ unit pexpr;
                           p1:=genmethodcallnode(pprocsym(ppropertysym(sym)^.readaccess^.firstsym^.sym),st,p1);
                           { we know the procedure to call, so
                             force the usage of that procedure }
-//                          p1^.procdefinition:=pprocdef(ppropertysym(sym)^.readaccess^.def);
+                          p1^.procdefinition:=pprocdef(ppropertysym(sym)^.readaccess^.def);
                           { insert paras }
                           p1^.left:=paras;
                           p1^.isproperty:=true;
@@ -2098,7 +2098,11 @@ _LECKKLAMMER : begin
 end.
 {
   $Log$
-  Revision 1.162  1999-11-30 10:40:44  peter
+  Revision 1.163  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.162  1999/11/30 10:40:44  peter
     + ttype, tsymlist
 
   Revision 1.161  1999/11/18 15:34:47  pierre

+ 14 - 4
compiler/pstatmnt.pas

@@ -370,11 +370,13 @@ unit pstatmnt;
     function _with_statement : ptree;
 
       var
-         right,p,hp : ptree;
+         right,p : ptree;
          i,levelcount : longint;
          withsymtable,symtab : psymtable;
          obj : pobjectdef;
-
+{$ifdef tp}
+         hp : ptree;
+{$endif}
       begin
          p:=comp_expr(true);
          do_firstpass(p);
@@ -453,7 +455,11 @@ unit pstatmnt;
             if token=_COMMA then
              begin
                consume(_COMMA);
-               hp:=_with_statement{$ifndef tp}(){$endif};
+{$ifdef tp}
+               hp:=_with_statement;
+{$else}
+               _with_statement();
+{$endif}
              end
             else
              begin
@@ -1316,7 +1322,11 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.113  1999-11-30 10:40:45  peter
+  Revision 1.114  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.113  1999/11/30 10:40:45  peter
     + ttype, tsymlist
 
   Revision 1.112  1999/11/20 01:19:10  pierre

+ 6 - 6
compiler/ra386int.pas

@@ -1183,8 +1183,7 @@ end;
 
 Procedure T386IntelOperand.BuildOperand;
 var
-  expr,
-  tempstr : string;
+  expr    : string;
   tempreg : tregister;
   l       : longint;
   hl      : PAsmLabel;
@@ -1259,7 +1258,6 @@ var
   end;
 
 Begin
-  tempstr:='';
   expr:='';
   case actasmtoken of
 
@@ -1451,11 +1449,9 @@ end;
 Procedure T386IntelInstruction.BuildOpCode;
 var
   PrefixOp,OverrideOp: tasmop;
-  expr : string;
   size : topsize;
   operandnum : longint;
 Begin
-  expr:='';
   PrefixOp:=A_None;
   OverrideOp:=A_None;
   { prefix seg opcode / prefix opcode }
@@ -1772,7 +1768,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.54  1999-11-30 10:40:53  peter
+  Revision 1.55  1999-12-01 12:42:32  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.54  1999/11/30 10:40:53  peter
     + ttype, tsymlist
 
   Revision 1.53  1999/11/17 17:05:03  pierre

+ 7 - 3
compiler/symdef.inc

@@ -3009,9 +3009,9 @@ Const local_symtable_index : longint = $8001;
     function tprocvardef.stabstring : pchar;
       var
          nss : pchar;
-         i   : longint;
+        { i   : longint; }
       begin
-        i := para^.count;
+        { i := para^.count; }
         getmem(nss,1024);
         { it is not a function but a function pointer !! (PM) }
 
@@ -3841,7 +3841,11 @@ Const local_symtable_index : longint = $8001;
 
 {
   $Log$
-  Revision 1.178  1999-12-01 10:26:38  pierre
+  Revision 1.179  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.178  1999/12/01 10:26:38  pierre
    * restore the correct way for stabs of forward defs
 
   Revision 1.177  1999/11/30 10:40:54  peter

+ 6 - 2
compiler/symsym.inc

@@ -660,7 +660,7 @@
       begin
         if (ppo_is_override in propoptions) then
          begin
-           resolvesym(propoverriden);
+           resolvesym(psym(propoverriden));
            dooverride(propoverriden);
          end
         else
@@ -2123,7 +2123,11 @@
 
 {
   $Log$
-  Revision 1.131  1999-11-30 10:40:55  peter
+  Revision 1.132  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.131  1999/11/30 10:40:55  peter
     + ttype, tsymlist
 
   Revision 1.130  1999/11/26 00:19:12  peter

+ 7 - 2
compiler/tcadd.pas

@@ -740,7 +740,8 @@ implementation
            { is one of the operands a string?,
              chararrays are also handled as strings (after conversion) }
            if (rd^.deftype=stringdef) or (ld^.deftype=stringdef) or
-              (is_chararray(rd) and is_chararray(ld)) then
+              ((is_chararray(rd) or is_char(rd)) and
+               (is_chararray(ld) or is_char(ld))) then
             begin
               if is_widestring(rd) or is_widestring(ld) then
                 begin
@@ -1187,7 +1188,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.58  1999-11-30 10:40:56  peter
+  Revision 1.59  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.58  1999/11/30 10:40:56  peter
     + ttype, tsymlist
 
   Revision 1.57  1999/11/26 13:51:29  pierre

+ 10 - 2
compiler/temp_gen.pas

@@ -497,16 +497,20 @@ unit temp_gen;
 
 
     procedure ungetiftemp(const ref : treference);
+{$ifdef EXTDEBUG}
       var
          tt : ttemptype;
+{$endif}
       begin
          if istemp(ref) then
            begin
               { first check if ansistring }
               if ungetiftempansi(ref) then
                 exit;
+{$ifndef EXTDEBUG}
+              ungettemp(ref.offset,tt_normal);
+{$else}
               tt:=ungettemp(ref.offset,tt_normal);
-{$ifdef EXTDEBUG}
               if tt=tt_persistant then
                 Comment(V_Debug,'temp at pos '+tostr(ref.offset)+ ' not released because persistant!');
               if tt=tt_none then
@@ -527,7 +531,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.38  1999-11-06 14:34:31  peter
+  Revision 1.39  1999-12-01 12:42:33  peter
+    * fixed bug 698
+    * removed some notes about unused vars
+
+  Revision 1.38  1999/11/06 14:34:31  peter
     * truncated log to 20 revs
 
   Revision 1.37  1999/09/27 23:45:02  peter