View Issue Details

IDProjectCategoryView StatusLast Update
0023866LazarusCustom Drawnpublic2013-02-13 08:12
ReporterlksAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformdarwin x86_64OSOSXOS Version10.8.2
Product Version1.1 (SVN)Product Build 
Target VersionFixed in Version1.1 (SVN) 
Summary0023866: customdrawn/customdrawnlclintf_cocoa.inc 64 bit portability problem
DescriptionThere is a size test that currently only works if PtrUInt = 32 bits. The enclosed patch should make it work on either 32 bit or 64 bit machines.
TagsNo tags attached.
Fixed in Revision40287
LazTarget-
WidgetsetCustomDrawn
Attached Files
  • cocoa.inc.patch (736 bytes)
    Index: customdrawnlclintf_cocoa.inc
    ===================================================================
    --- customdrawnlclintf_cocoa.inc	(revision 40225)
    +++ customdrawnlclintf_cocoa.inc	(working copy)
    @@ -166,7 +166,7 @@
       screenshotImage: CGImageRef;
       lRect: CGRect;
       lScreenRawImage: TRawImage;
    -  lDataLength: Integer;
    +  lDataLength: SizeInt;
     begin
       Result := True;
     
    @@ -183,7 +183,7 @@
       // Now copy the data
       ScreenImage.GetRawImage(lScreenRawImage, False);
       ARawImage.CreateData(False);
    -  lDataLength := Min(lScreenRawImage.DataSize, ARawImage.DataSize);
    +  lDataLength := Min(Int64(lScreenRawImage.DataSize), Int64(ARawImage.DataSize));
       System.Move(lScreenRawImage.Data^, ARawImage.Data^, lDataLength);
     end;
    
    cocoa.inc.patch (736 bytes)

Activities

lks

2013-02-09 19:23

reporter  

cocoa.inc.patch (736 bytes)
Index: customdrawnlclintf_cocoa.inc
===================================================================
--- customdrawnlclintf_cocoa.inc	(revision 40225)
+++ customdrawnlclintf_cocoa.inc	(working copy)
@@ -166,7 +166,7 @@
   screenshotImage: CGImageRef;
   lRect: CGRect;
   lScreenRawImage: TRawImage;
-  lDataLength: Integer;
+  lDataLength: SizeInt;
 begin
   Result := True;
 
@@ -183,7 +183,7 @@
   // Now copy the data
   ScreenImage.GetRawImage(lScreenRawImage, False);
   ARawImage.CreateData(False);
-  lDataLength := Min(lScreenRawImage.DataSize, ARawImage.DataSize);
+  lDataLength := Min(Int64(lScreenRawImage.DataSize), Int64(ARawImage.DataSize));
   System.Move(lScreenRawImage.Data^, ARawImage.Data^, lDataLength);
 end;
cocoa.inc.patch (736 bytes)

Issue History

Date Modified Username Field Change
2013-02-09 19:23 lks New Issue
2013-02-09 19:23 lks File Added: cocoa.inc.patch
2013-02-13 08:06 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2013-02-13 08:06 Felipe Monteiro de Carvalho Status new => assigned
2013-02-13 08:12 Felipe Monteiro de Carvalho Fixed in Revision => 40287
2013-02-13 08:12 Felipe Monteiro de Carvalho LazTarget => -
2013-02-13 08:12 Felipe Monteiro de Carvalho Status assigned => resolved
2013-02-13 08:12 Felipe Monteiro de Carvalho Fixed in Version => 1.1 (SVN)
2013-02-13 08:12 Felipe Monteiro de Carvalho Resolution open => fixed