浏览代码

* fixed (harmless) range check errors

git-svn-id: trunk@17643 -
Jonas Maebe 14 年之前
父节点
当前提交
7173b9dfed
共有 1 个文件被更改,包括 6 次插入16 次删除
  1. 6 16
      compiler/cclasses.pas

+ 6 - 16
compiler/cclasses.pas

@@ -1089,10 +1089,8 @@ end;
       Var
       Var
         p,pmax : pchar;
         p,pmax : pchar;
       begin
       begin
-{$ifopt Q+}
-{$define overflowon}
-{$Q-}
-{$endif}
+{$push}
+{$q-,r-}
         result:=0;
         result:=0;
         p:=@s[1];
         p:=@s[1];
         pmax:=@s[length(s)+1];
         pmax:=@s[length(s)+1];
@@ -1101,20 +1099,15 @@ end;
             result:=LongWord(LongInt(result shl 5) - LongInt(result)) xor LongWord(P^);
             result:=LongWord(LongInt(result shl 5) - LongInt(result)) xor LongWord(P^);
             inc(p);
             inc(p);
           end;
           end;
-{$ifdef overflowon}
-{$Q+}
-{$undef overflowon}
-{$endif}
+{$pop}
       end;
       end;
 
 
     function FPHash(P: PChar; Len: Integer): LongWord;
     function FPHash(P: PChar; Len: Integer): LongWord;
       Var
       Var
         pmax : pchar;
         pmax : pchar;
       begin
       begin
-{$ifopt Q+}
-{$define overflowon}
-{$Q-}
-{$endif}
+{$push}
+{$q-,r-}
         result:=0;
         result:=0;
         pmax:=p+len;
         pmax:=p+len;
         while (p<pmax) do
         while (p<pmax) do
@@ -1122,10 +1115,7 @@ end;
             result:=LongWord(LongInt(result shl 5) - LongInt(result)) xor LongWord(P^);
             result:=LongWord(LongInt(result shl 5) - LongInt(result)) xor LongWord(P^);
             inc(p);
             inc(p);
           end;
           end;
-{$ifdef overflowon}
-{$Q+}
-{$undef overflowon}
-{$endif}
+{$pop}
       end;
       end;