소스 검색

* fix 2GB limit problem

carl 23 년 전
부모
커밋
ab9e07a2d7
2개의 변경된 파일18개의 추가작업 그리고 12개의 파일을 삭제
  1. 5 2
      rtl/inc/compproc.inc
  2. 13 10
      rtl/inc/generic.inc

+ 5 - 2
rtl/inc/compproc.inc

@@ -24,7 +24,7 @@
 
 
 { some dummy types necessary to have generic resulttypes for certain compilerprocs }
 { some dummy types necessary to have generic resulttypes for certain compilerprocs }
 type
 type
-  fpc_big_chararray = array[0..maxlongint] of char;
+  fpc_big_chararray = array[0..maxlongint-1] of char;
   fpc_small_set = longint;
   fpc_small_set = longint;
   fpc_normal_set = array[0..7] of longint;
   fpc_normal_set = array[0..7] of longint;
 
 
@@ -263,7 +263,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.22  2002-09-07 21:12:04  carl
+  Revision 1.23  2002-09-27 21:10:40  carl
+    * fix 2GB limit problem
+
+  Revision 1.22  2002/09/07 21:12:04  carl
     * cardinal -> longword
     * cardinal -> longword
     - remove some unused routines
     - remove some unused routines
 
 

+ 13 - 10
rtl/inc/generic.inc

@@ -25,7 +25,7 @@ type
 {$ifndef FPC_SYSTEM_HAS_MOVE}
 {$ifndef FPC_SYSTEM_HAS_MOVE}
 procedure Move(const source;var dest;count:longint);
 procedure Move(const source;var dest;count:longint);
 type
 type
-  bytearray    = array [0..maxlongint] of byte;
+  bytearray    = array [0..maxlongint-1] of byte;
 var
 var
   i,size : longint;
   i,size : longint;
 begin
 begin
@@ -40,7 +40,7 @@ end;
 Procedure FillChar(var x;count:longint;value:byte);
 Procedure FillChar(var x;count:longint;value:byte);
 type
 type
   longintarray = array [0..maxlongint div 4] of longint;
   longintarray = array [0..maxlongint div 4] of longint;
-  bytearray    = array [0..maxlongint] of byte;
+  bytearray    = array [0..maxlongint-1] of byte;
 var
 var
   i,v : longint;
   i,v : longint;
 begin
 begin
@@ -113,7 +113,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 {$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 function IndexByte(Const buf;len:longint;b:byte):longint;
 function IndexByte(Const buf;len:longint;b:byte):longint;
 type
 type
-  bytearray    = array [0..maxlongint] of byte;
+  bytearray    = array [0..maxlongint-1] of byte;
 var
 var
   I : longint;
   I : longint;
 begin
 begin
@@ -130,7 +130,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXWORD}
 {$ifndef FPC_SYSTEM_HAS_INDEXWORD}
 function Indexword(Const buf;len:longint;b:word):longint;
 function Indexword(Const buf;len:longint;b:word):longint;
 type
 type
-  wordarray    = array [0..maxlongint] of word;
+  wordarray    = array [0..maxlongint div 2] of word;
 var
 var
   I : longint;
   I : longint;
 begin
 begin
@@ -147,7 +147,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXDWORD}
 {$ifndef FPC_SYSTEM_HAS_INDEXDWORD}
 function IndexDWord(Const buf;len:longint;b:DWord):longint;
 function IndexDWord(Const buf;len:longint;b:DWord):longint;
 type
 type
-  longintarray = array [0..maxlongint] of longint;
+  longintarray = array [0..maxlongint div 4] of longint;
 var
 var
   I : longint;
   I : longint;
 begin
 begin
@@ -171,7 +171,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 {$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 function CompareByte(Const buf1,buf2;len:longint):longint;
 function CompareByte(Const buf1,buf2;len:longint):longint;
 type
 type
-  bytearray    = array [0..maxlongint] of byte;
+  bytearray    = array [0..maxlongint-1] of byte;
 var
 var
   I,J : longint;
   I,J : longint;
 begin
 begin
@@ -200,7 +200,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREWORD}
 {$ifndef FPC_SYSTEM_HAS_COMPAREWORD}
 function CompareWord(Const buf1,buf2;len:longint):longint;
 function CompareWord(Const buf1,buf2;len:longint):longint;
 type
 type
-  wordarray    = array [0..maxlongint] of word;
+  wordarray    = array [0..maxlongint div 2] of word;
 var
 var
   I,J : longint;
   I,J : longint;
 begin
 begin
@@ -229,7 +229,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREDWORD}
 {$ifndef FPC_SYSTEM_HAS_COMPAREDWORD}
 function CompareDWord(Const buf1,buf2;len:longint):longint;
 function CompareDWord(Const buf1,buf2;len:longint):longint;
 type
 type
-  longintarray    = array [0..maxlongint] of longint;
+  longintarray    = array [0..maxlongint div 4] of longint;
 var
 var
   I,J : longint;
   I,J : longint;
 begin
 begin
@@ -289,7 +289,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
 function CompareChar0(Const buf1,buf2;len:longint):longint;
 function CompareChar0(Const buf1,buf2;len:longint):longint;
 type
 type
-  bytearray    = array [0..maxlongint] of byte;
+  bytearray    = array [0..maxlongint-1] of byte;
 
 
 Var i : longint;
 Var i : longint;
 
 
@@ -920,7 +920,10 @@ end;
 {$endif ndef FPC_SYSTEM_HAS_INT_STR_LONGWORD}
 {$endif ndef FPC_SYSTEM_HAS_INT_STR_LONGWORD}
 {
 {
   $Log$
   $Log$
-  Revision 1.36  2002-09-13 19:13:06  carl
+  Revision 1.37  2002-09-27 21:10:40  carl
+    * fix 2GB limit problem
+
+  Revision 1.36  2002/09/13 19:13:06  carl
     * FPC_HELP_FAIL : reset _self to nil
     * FPC_HELP_FAIL : reset _self to nil
 
 
   Revision 1.35  2002/09/10 21:29:44  jonas
   Revision 1.35  2002/09/10 21:29:44  jonas