فهرست منبع

* Fixed unreachable code warnings.

git-svn-id: trunk@11440 -
yury 17 سال پیش
والد
کامیت
6daceb38f6
5فایلهای تغییر یافته به همراه35 افزوده شده و 31 حذف شده
  1. 4 3
      compiler/defutil.pas
  2. 6 5
      compiler/ncgld.pas
  3. 6 8
      compiler/ncnv.pas
  4. 8 7
      compiler/ptconst.pas
  5. 11 8
      compiler/symtype.pas

+ 4 - 3
compiler/defutil.pas

@@ -916,12 +916,13 @@ implementation
             begin
               if tprocvardef(def).is_methodpointer and
                  (not tprocvardef(def).is_addressonly) then
-                if (sizeof(pint) = 4) then
+                {$if sizeof(pint) = 4}
                   result:=OS_64
-                else if (sizeof(pint) = 8) then
+                {$else} {$if sizeof(pint) = 8}
                   result:=OS_128
-                else
+                {$else}
                   internalerror(200707141)
+                {$endif} {$endif}
               else
                 result:=OS_ADDR;
             end;

+ 6 - 5
compiler/ncgld.pas

@@ -409,12 +409,13 @@ implementation
                     internalerror(200312011);
                   if assigned(left) then
                     begin
-                      if (sizeof(pint) = 4) then
-                         location_reset(location,LOC_CREFERENCE,OS_64)
-                      else if (sizeof(pint) = 8) then
-                         location_reset(location,LOC_CREFERENCE,OS_128)
-                      else
+                      {$if sizeof(pint) = 4}
+                         location_reset(location,LOC_CREFERENCE,OS_64);
+                      {$else} {$if sizeof(pint) = 8}
+                         location_reset(location,LOC_CREFERENCE,OS_128);
+                      {$else}
                          internalerror(20020520);
+                      {$endif} {$endif}
                       tg.GetTemp(current_asmdata.CurrAsmList,2*sizeof(pint),tt_normal,location.reference);
                       secondpass(left);
 

+ 6 - 8
compiler/ncnv.pas

@@ -780,21 +780,19 @@ implementation
         if left.nodetype=ordconstn then
           begin
             { check if we have a valid pointer constant (JM) }
-            if (sizeof(pointer) > sizeof(TConstPtrUInt)) then
-              if (sizeof(TConstPtrUInt) = 4) then
-                begin
+            {$if sizeof(pointer) > sizeof(TConstPtrUInt)}
+              {$if sizeof(TConstPtrUInt) = 4}
                   if (tordconstnode(left).value < int64(low(longint))) or
                      (tordconstnode(left).value > int64(high(cardinal))) then
                   CGMessage(parser_e_range_check_error);
-                end
-              else if (sizeof(TConstPtrUInt) = 8) then
-                begin
+              {$else} {$if sizeof(TConstPtrUInt) = 8}
                   if (tordconstnode(left).value < int64(low(int64))) or
                      (tordconstnode(left).value > int64(high(qword))) then
                   CGMessage(parser_e_range_check_error);
-                end
-              else
+              {$else}
                 internalerror(2001020801);
+              {$endif} {$endif}
+            {$endif}
             t:=cpointerconstnode.create(TConstPtrUInt(tordconstnode(left).value.uvalue),resultdef);
             result:=t;
           end

+ 8 - 7
compiler/ptconst.pas

@@ -374,13 +374,14 @@ implementation
           { const pointer ? }
           if (p.nodetype = pointerconstn) then
             begin
-              if sizeof(TConstPtrUInt)=8 then
-                list.concat(Tai_const.Create_64bit(int64(tpointerconstnode(p).value)))
-              else
-                if sizeof(TConstPtrUInt)=4 then
-                  list.concat(Tai_const.Create_32bit(longint(tpointerconstnode(p).value)))
-              else
-                internalerror(200404122);
+              {$if sizeof(TConstPtrUInt)=8}
+                list.concat(Tai_const.Create_64bit(int64(tpointerconstnode(p).value)));
+              {$else}
+                {$if sizeof(TConstPtrUInt)=4}
+                  list.concat(Tai_const.Create_32bit(longint(tpointerconstnode(p).value)));
+                {$else}
+                  internalerror(200404122);
+              {$endif} {$endif}
             end
           { nil pointer ? }
           else if p.nodetype=niln then

+ 11 - 8
compiler/symtype.pas

@@ -777,10 +777,11 @@ implementation
 
     function tcompilerppufile.getPtrUInt:TConstPtrUInt;
       begin
-        if sizeof(TConstPtrUInt)=8 then
-          result:=tconstptruint(getint64)
-        else
+        {$if sizeof(TConstPtrUInt)=8}
+          result:=tconstptruint(getint64);
+        {$else}
           result:=TConstPtrUInt(getlongint);
+        {$endif}
       end;
 
 
@@ -971,12 +972,14 @@ implementation
 
     procedure tcompilerppufile.PutPtrUInt(v:TConstPtrUInt);
       begin
-        if sizeof(TConstPtrUInt)=8 then
-          putint64(int64(v))
-        else if sizeof(TConstPtrUInt)=4 then
-          putlongint(longint(v))
-        else
+        {$if sizeof(TConstPtrUInt)=8}
+          putint64(int64(v));
+        {$else}
+        {$if sizeof(TConstPtrUInt)=4}
+          putlongint(longint(v));
+        {$else}
           internalerror(2002082601);
+        {$endif} {$endif}
       end;