Browse Source

- Because int_to_type handles qwords now, the trial and error to parse a constant
can be simplified.

git-svn-id: trunk@7787 -

daniel 18 years ago
parent
commit
cd2880cbbd
1 changed files with 2 additions and 48 deletions
  1. 2 48
      compiler/pexpr.pas

+ 2 - 48
compiler/pexpr.pas

@@ -2368,10 +2368,7 @@ implementation
 
 
            _INTCONST :
            _INTCONST :
              begin
              begin
-{$ifdef cpu64}
-               { when already running under 64bit must read int64 constant, because reading
-                 cardinal first will also succeed (code=0) for values > maxcardinal, because
-                 range checking is off by default (PFV) }
+               {Try first wether the value fits in an int64.}
                val(pattern,ic,code);
                val(pattern,ic,code);
                if code=0 then
                if code=0 then
                  begin
                  begin
@@ -2386,53 +2383,10 @@ implementation
                    if code=0 then
                    if code=0 then
                      begin
                      begin
                         consume(_INTCONST);
                         consume(_INTCONST);
-                        hdef:=u64inttype;
+                        int_to_type(qc,hdef);
                         p1:=cordconstnode.create(qc,hdef,true);
                         p1:=cordconstnode.create(qc,hdef,true);
                      end;
                      end;
                  end;
                  end;
-{$else}
-               { try cardinal first }
-               val(pattern,card,code);
-               if code=0 then
-                 begin
-                    consume(_INTCONST);
-                    int_to_type(qword(card),hdef);
-                    p1:=cordconstnode.create(qword(card),hdef,true);
-                 end
-               else
-                 begin
-                   { then longint }
-                   val(pattern,l,code);
-                   if code = 0 then
-                     begin
-                       consume(_INTCONST);
-                       int_to_type(int64(l),hdef);
-                       p1:=cordconstnode.create(int64(l),hdef,true);
-                     end
-                   else
-                     begin
-                       { then int64 }
-                       val(pattern,ic,code);
-                       if code=0 then
-                         begin
-                            consume(_INTCONST);
-                            int_to_type(ic,hdef);
-                            p1:=cordconstnode.create(ic,hdef,true);
-                         end
-                       else
-                         begin
-                           { try qword next }
-                           val(pattern,qc,code);
-                           if code=0 then
-                             begin
-                                consume(_INTCONST);
-                                hdef:=u64inttype;
-                                p1:=cordconstnode.create(tconstexprint(qc),hdef,true);
-                             end;
-                         end;
-                     end;
-                 end;
-{$endif}
                if code<>0 then
                if code<>0 then
                  begin
                  begin
                    { finally float }
                    { finally float }