Quoting Kai-Uwe Behrmann <k...@gmx.de>:

> Am 13.02.2014 17:51, schrieb marti.ma...@littlecms.com:
>> Still, the issue continues to be in how to differentiate cmsContext
>> from user data. If we could fix that, then compatibility would
>> be kept.
>
> Just an idea:


Yep, that is how actually works, and this is the source of all pain.
What I really need is a sort function that given a pointer, would guess
if this points to a cmsContext internal structure or to used supplied
data. My first idea was to use a bit in the very upper part of the
pointer, but this is not portable and would need an integral type
wider than a pointer.

if (ptr & 0x100000000) {
       Context = ptr & !0x100000000;  // this is a context
       usr = NULL;
}
else  {
       Context = NULL;
       usr = ptr;  // A user pointer.
}


I'm right now open to other ideas.

Regards
Marti






------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to