Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Sunday, October 26 2014 @ 12:28 AM BST

CGFunctionCreate's callbacks and 64 bits compilation

   
Cocoa Development FAQBefore you get bitten by this one, better to know how to correct most code examples found on the net...

Most example found on Internet will show filter function with this prototype:

void filterFunction(void *info, const float *inData, float *outData)
{	
	float *colors = info;
...
That's wrong once you compile in 64 bits (arch x86_64), the correct prototype is:

void filterFunction(void *info, const CGFloat *inData, CGFloat *outData)
{	
	CGFloat *colors = info;
...
Using CGFloat guarantees the pointer arithmetic you may use in the body of the function yields to the correct result.
 

What's Related

Story Options

CGFunctionCreate's callbacks and 64 bits compilation | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2014 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.05 seconds