Browse Source

* insert explicit type cast for the count parameter of move/fillchar wrapping C functions,
avoids a warning in combination with -O3 and negative count values

git-svn-id: trunk@49205 -

florian 4 năm trước cách đây
mục cha
commit
5442e9f9d8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      rtl/inc/cgeneric.inc

+ 2 - 2
rtl/inc/cgeneric.inc

@@ -28,7 +28,7 @@ procedure Move(const source;var dest;count:sizeint); [public, alias: 'FPC_MOVE']
 begin
   if count <= 0 then
     exit;
-  bcopy(source,dest,count);
+  bcopy(source,dest,size_t(count));
 end;
 {$endif not FPC_SYSTEM_HAS_MOVE}
 
@@ -41,7 +41,7 @@ Procedure FillChar(var x;count: sizeint;value:byte);{$ifdef SYSTEMINLINE}inline;
 begin
   if count <= 0 then
     exit;
-  memset(x,value,count);
+  memset(x,value,size_t(count));
 end;
 {$endif FPC_SYSTEM_HAS_FILLCHAR}