2
0
Эх сурвалжийг харах

* prefer string-shortstring over other string-string conversions

peter 22 жил өмнө
parent
commit
419a0592ab

+ 11 - 3
compiler/defcmp.pas

@@ -277,7 +277,12 @@ implementation
                      else
                      else
                        begin
                        begin
                          doconv:=tc_string_2_string;
                          doconv:=tc_string_2_string;
-                         b:=te_convert_l1;
+                         { Prefer conversions to shortstring over other
+                           conversions. This is compatible with Delphi (PFV) }
+                         if tstringdef(def_to).string_typ=st_shortstring then
+                           b:=te_convert_l1
+                         else
+                           b:=te_convert_l2;
                        end;
                        end;
                    end;
                    end;
                  orddef :
                  orddef :
@@ -1159,7 +1164,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  2002-12-05 14:27:26  florian
+  Revision 1.6  2002-12-06 17:49:44  peter
+    * prefer string-shortstring over other string-string conversions
+
+  Revision 1.5  2002/12/05 14:27:26  florian
     * some variant <-> dyn. array stuff
     * some variant <-> dyn. array stuff
 
 
   Revision 1.4  2002/12/01 22:07:41  carl
   Revision 1.4  2002/12/01 22:07:41  carl
@@ -1177,4 +1185,4 @@ end.
     * merged isconvertable and is_equal into compare_defs(_ext)
     * merged isconvertable and is_equal into compare_defs(_ext)
     * made operator search faster by walking the list only once
     * made operator search faster by walking the list only once
 
 
-}
+}