Claiim/Release Device Vector handle

John Tytgat John.Tytgat at aaug.net
Wed Jan 2 21:57:20 GMT 2013


In message <4796d20753.druck at druck.freeuk.net>
          "David J. Ruck" <druck at druck.org.uk> wrote:

> In version 6.70 both (x)os_claim_device_vector and 
> (x)os_release_device_vector took a byte* handle. In version 7.00 
> (x)os_release_device_vector and the _get_handler variants have been 
> changed to take an int handle, but (x)os_release_device_vector is 
> byte* handle as before. It makes more sense for it to be a byte*.

It's of course not good to have such an inconsistency.

But currently the 'byte*' (user supplied) handles in OS_Claim, OS_Release,
OS_CallAfter, OS_CallEvery, OS_RemoveTickerEvent, OS_ChangeEnvironment,
OS_AddToVector, OS_ReleaseDeviceVector, OS_HeapSort, OS_AddCallBack,
OS_ReadDefaultHandler, OS_RemoveCallBack, OS_ClaimSWI, OS_ReleaseSWI,
OS_ClaimOSSWI, ChangeEnvironmentV, Filter_*, ... have the comment
"//should be int, like other handles" in their .swi files.

I'm wondering what the origin is of that comment (since r17 in our
Subversion repository) as the handle type is something the OSLib user
only knows about so IMHO neither 'byte*' nor 'int' is the right type.
Perhaps C99's intptr_t would be a better choice.

John.
-- 
John Tytgat, in his comfy chair at home
John.Tytgat at aaug.net



More information about the oslib-user mailing list