Browse Source

* fixed copy(<dynarray>, ...)

florian 22 years ago
parent
commit
78a00b657b
2 changed files with 14 additions and 6 deletions
  1. 5 2
      rtl/inc/compproc.inc
  2. 9 4
      rtl/inc/dynarr.inc

+ 5 - 2
rtl/inc/compproc.inc

@@ -57,7 +57,7 @@ Function  fpc_shortstr_Copy(const s:shortstring;index:StrLenInt;count:StrLenInt)
 Function  fpc_ansistr_Copy (Const S : AnsiString; Index,Size : Longint) : AnsiString;compilerproc;
 Function  fpc_widestr_Copy (Const S : WideString; Index,Size : Longint) : WideString;compilerproc;
 function  fpc_char_copy(c:char;index : StrLenInt;count : StrLenInt): shortstring;compilerproc;
-procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;lowidx,highidx:longint);compilerproc;
+procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;lowidx,count:tdynarrayindex);compilerproc;
 
 function  fpc_dynarray_length(p : pointer) : tdynarrayindex; compilerproc;
 function  fpc_dynarray_high(p : pointer) : tdynarrayindex; compilerproc;
@@ -309,7 +309,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
 
 {
   $Log$
-  Revision 1.49  2003-10-04 23:40:42  florian
+  Revision 1.50  2003-10-25 22:52:07  florian
+    * fixed copy(<dynarray>, ...)
+
+  Revision 1.49  2003/10/04 23:40:42  florian
     * write helper comproc for variants fixed
 
   Revision 1.48  2003/09/02 13:04:08  florian

+ 9 - 4
rtl/inc/dynarr.inc

@@ -256,16 +256,18 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
 
 { provide local access to dynarr_copy }
 procedure int_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
-    lowidx,highidx:longint);[external name 'FPC_DYNARR_COPY'];
+    lowidx,count:tdynarrayindex);[external name 'FPC_DYNARR_COPY'];
 
 procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
-    lowidx,highidx:longint);[Public,Alias:'FPC_DYNARR_COPY'];{$ifdef hascompilerproc} compilerproc; {$endif}
+    lowidx,count:tdynarrayindex);[Public,Alias:'FPC_DYNARR_COPY'];{$ifdef hascompilerproc} compilerproc; {$endif}
   var
     realpdest,
     realpsrc : pdynarray;
     cnt,
     i,size : longint;
+    highidx : tdynarrayindex;
   begin
+     highidx:=lowidx+count-1;
      pdest:=nil;
      if psrc=nil then
        exit;
@@ -300,7 +302,10 @@ procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
 
 {
   $Log$
-  Revision 1.21  2002-11-26 23:02:07  peter
+  Revision 1.22  2003-10-25 22:52:07  florian
+    * fixed copy(<dynarray>, ...)
+
+  Revision 1.21  2002/11/26 23:02:07  peter
     * fixed dynarray copy
 
   Revision 1.20  2002/10/09 20:24:30  florian
@@ -324,4 +329,4 @@ procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
 
   Revision 1.15  2002/01/21 20:16:08  peter
     * updated for dynarr:=nil
-}
+}