Browse Source

* merged from fixes

peter 26 years ago
parent
commit
99395db696
5 changed files with 61 additions and 53 deletions
  1. 10 8
      base/makefile.fpc
  2. 13 5
      compiler/pexpr.pas
  3. 14 30
      compiler/tccnv.pas
  4. 12 7
      compiler/tcflw.pas
  5. 12 3
      compiler/types.pas

+ 10 - 8
base/makefile.fpc

@@ -393,11 +393,7 @@ endif
 
 # Where the .msg files will be stored
 ifndef MSGINSTALLDIR
-ifdef inlinux
 MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
-else
-MSGINSTALLDIR=$(BININSTALLDIR)
-endif
 endif
 
 # Where the .msg files will be stored
@@ -675,7 +671,7 @@ UNITAFILES=$(addsuffix $(STATICLIBEXT),$(UNITOBJECTS))
 	 fpc_info fpc_cfginfo fpc_objectinfo fpc_installinfo fpc_filesinfo\
 	 fpc_dirinfo
 
-.SUFFIXES : $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp 
+.SUFFIXES : $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
 
 
 #####################################################################
@@ -732,11 +728,11 @@ fpc_sharedlib:
 ifdef inlinux
 ifndef LIBNAME
 	$(ECHO) LIBNAME not set
-else	
+else
 	$(MAKE) libsclean
 	$(MAKE) all
 	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
-endif	
+endif
 else
 	@$(ECHO) Shared Libraries not supported
 endif
@@ -1029,9 +1025,15 @@ endif
 
 #
 # $Log$
-# Revision 1.32  1999-06-11 13:31:14  hajny
+# Revision 1.33  1999-06-13 22:43:23  peter
+#   * merged from fixes
+#
+# Revision 1.32  1999/06/11 13:31:14  hajny
 #   * fixes for OS/2
 #
+# Revision 1.31.2.1  1999/06/13 22:36:38  peter
+#   * install msg files in msg/ instead of bin for not linux
+#
 # Revision 1.31  1999/06/10 15:02:08  peter
 #   * last fixes for 0.99.12 release
 #

+ 13 - 5
compiler/pexpr.pas

@@ -732,7 +732,8 @@ unit pexpr;
                       p1:=genmethodcallnode(pprocsym(sym),srsymtable,p1);
                       do_proc_call(getaddr or
                         (getprocvar and
-                        proc_to_procvar_equal(pprocsym(sym)^.definition,getprocvardef))
+                         (m_tp_procvar in aktmodeswitches) and
+                         proc_to_procvar_equal(pprocsym(sym)^.definition,getprocvardef))
                         ,again,p1,pd);
                       { now we know the real method e.g. we can check for }
                       { a class method                              }
@@ -1083,7 +1084,8 @@ unit pexpr;
                               p1^.unit_specific:=unit_specific;
                               do_proc_call(getaddr or
                                 (getprocvar and
-                                proc_to_procvar_equal(pprocsym(srsym)^.definition,getprocvardef)),
+                                 (m_tp_procvar in aktmodeswitches) and
+                                 proc_to_procvar_equal(pprocsym(srsym)^.definition,getprocvardef)),
                                 again,p1,pd);
                               if possible_error and
                                  ((p1^.procdefinition^.options and poclassmethod)=0) then
@@ -1876,7 +1878,7 @@ unit pexpr;
                  end;
             end;
       end;
-      
+
 
     function comp_expr(accept_equal : boolean):Ptree;
       var
@@ -2016,13 +2018,19 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.112  1999-06-02 22:44:11  pierre
+  Revision 1.113  1999-06-13 22:41:05  peter
+    * merged from fixes
+
+  Revision 1.112.2.1  1999/06/13 22:38:09  peter
+    * tp_procvar check for loading of procvars when getaddr=false
+
+  Revision 1.112  1999/06/02 22:44:11  pierre
    * previous wrong log corrected
 
   Revision 1.111  1999/06/02 22:25:43  pierre
   * changed $ifdef FPC @ into $ifndef TP
   * changes for correct procvar handling under tp mode
-  
+
   Revision 1.110  1999/06/01 19:27:55  peter
     * better checks for procvar and methodpointer
 

+ 14 - 30
compiler/tccnv.pas

@@ -538,7 +538,6 @@ implementation
     var
       hp : ptree;
       aprocdef : pprocdef;
-      proctype : tdeftype;
     const
        firstconvert : array[tconverttype] of tfirstconvproc = (
          first_nothing, {equal}
@@ -651,7 +650,6 @@ implementation
               ) and
              ((is_procsym_load(p^.left) or is_procsym_call(p^.left))) then
              begin
-                { just a test: p^.explizit:=false; }
                 if is_procsym_call(p^.left) then
                   begin
                      if p^.left^.right=nil then
@@ -690,41 +688,21 @@ implementation
                   end
                 else
                   begin
-                     if p^.left^.treetype=addrn then
-                       begin
-                          hp:=p^.left;
-                          p^.left:=p^.left^.left;
-                          putnode(p^.left);
-                       end
-                     else
-                       aprocdef:=pprocsym(p^.left^.symtableentry)^.definition;
+                    if (p^.left^.treetype<>addrn) then
+                      aprocdef:=pprocsym(p^.left^.symtableentry)^.definition;
                   end;
 
                 p^.convtyp:=tc_proc_2_procvar;
                 { Now check if the procedure we are going to assign to
-                  the procvar,  is compatible with the procvar's type.
-                  Did the original procvar support do such a check?
-                  I can't find any.}
-                { answer : is_equal works for procvardefs !! }
-                { but both must be procvardefs, so we cheet  little }
+                  the procvar,  is compatible with the procvar's type }
                 if assigned(aprocdef) then
                   begin
-                    proctype:=aprocdef^.deftype;
-                    aprocdef^.deftype:=procvardef;
-
-                    { only methods can be assigned to method pointers }
-                    if (assigned(p^.left^.left) and
-                      ((pprocvardef(p^.resulttype)^.options and pomethodpointer)=0)) or
-                       not(is_equal(aprocdef,p^.resulttype)) then
-                      begin
-                        aprocdef^.deftype:=proctype;
-                        CGMessage(type_e_mismatch);
-                      end;
-                    aprocdef^.deftype:=proctype;
+                    if proc_to_procvar_equal(aprocdef,pprocvardef(p^.resulttype)) then
+                     CGMessage2(type_e_incompatible_types,aprocdef^.typename,p^.resulttype^.typename);
                     firstconvert[p^.convtyp](p);
                   end
                 else
-                  CGMessage(type_e_mismatch);
+                  CGMessage2(type_e_incompatible_types,p^.left^.resulttype^.typename,p^.resulttype^.typename);
                 exit;
              end
            else
@@ -935,13 +913,19 @@ implementation
 end.
 {
   $Log$
-  Revision 1.35  1999-06-02 22:44:24  pierre
+  Revision 1.36  1999-06-13 22:41:06  peter
+    * merged from fixes
+
+  Revision 1.35.2.1  1999/06/13 22:39:19  peter
+    * use proc_to_procvar_equal
+
+  Revision 1.35  1999/06/02 22:44:24  pierre
    * previous wrong log corrected
 
   Revision 1.34  1999/06/02 22:25:54  pierre
   * changed $ifdef FPC @ into $ifndef TP
   + debug note about longint to pointer conversion
-  
+
   Revision 1.33  1999/05/27 19:45:15  peter
     * removed oldasm
     * plabel -> pasmlabel

+ 12 - 7
compiler/tcflw.pas

@@ -124,12 +124,11 @@ implementation
          firstpass(p^.left);
          if codegenerror then
            exit;
-         if not((p^.left^.resulttype^.deftype=orddef) and
-            (porddef(p^.left^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit])) then
-            begin
-               CGMessage(type_e_mismatch);
-               exit;
-            end;
+         if not is_boolean(p^.left^.resulttype) then
+          begin
+            Comment(V_Error,'Expected boolean type but got "'+p^.left^.resulttype^.typename+'"');
+            exit;
+          end;
 
          p^.registers32:=p^.left^.registers32;
          p^.registersfpu:=p^.left^.registersfpu;
@@ -496,7 +495,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.10  1999-05-27 19:45:18  peter
+  Revision 1.11  1999-06-13 22:41:07  peter
+    * merged from fixes
+
+  Revision 1.10.2.1  1999/06/13 22:38:54  peter
+    * better error message when type is wrong with if statement
+
+  Revision 1.10  1999/05/27 19:45:18  peter
     * removed oldasm
     * plabel -> pasmlabel
     * -a switches to source writing automaticly

+ 12 - 3
compiler/types.pas

@@ -258,9 +258,11 @@ implementation
             Message(type_e_no_method_and_procedure_not_compatible);
             exit;
           end;
-         { check the other things, methodpointer is already checked }
+         { check return value and para's and options, methodpointer is already checked
+           parameters may also be convertable }
          if is_equal(def1^.retdef,def2^.retdef) and
-            convertable_paras(def1^.para1,def2^.para1,false) and
+            (equal_paras(def1^.para1,def2^.para1,false) or
+             convertable_paras(def1^.para1,def2^.para1,false)) and
             ((def1^.options and (po_compatibility_options-pomethodpointer))=
              (def2^.options and (po_compatibility_options-pomethodpointer))) then
            proc_to_procvar_equal:=true
@@ -928,7 +930,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.71  1999-06-03 09:34:13  peter
+  Revision 1.72  1999-06-13 22:41:08  peter
+    * merged from fixes
+
+  Revision 1.71.2.1  1999/06/13 22:37:17  peter
+    * convertable para's doesn't check for equal, added equal para's to
+      proc2procvar check
+
+  Revision 1.71  1999/06/03 09:34:13  peter
     * better methodpointer check for proc->procvar
 
   Revision 1.70  1999/06/02 22:25:55  pierre