瀏覽代碼

* use min and max in defutil.get_common_intdef

git-svn-id: branches/i8086@24120 -
nickysn 12 年之前
父節點
當前提交
848eeceded
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3 7
      compiler/defutil.pas

+ 3 - 7
compiler/defutil.pas

@@ -309,7 +309,7 @@ interface
 implementation
 
     uses
-       verbose;
+       verbose,cutils;
 
     { returns true, if def uses FPU }
     function is_fpu(def : tdef) : boolean;
@@ -1220,12 +1220,8 @@ implementation
       var
         llow, lhigh: tconstexprint;
       begin
-        llow:=rd.low;
-        if llow>ld.low then
-          llow:=ld.low;
-        lhigh:=rd.high;
-        if lhigh<ld.high then
-          lhigh:=ld.high;
+        llow:=min(ld.low,rd.low);
+        lhigh:=max(ld.high,rd.high);
         case range_to_basetype(llow,lhigh) of
           s8bit:
             result:=torddef(s8inttype);