[Pharo-dev] NativeBoost: Documentation Suggestion and Question

Igor Stasenko siguctua at gmail.com
Thu Nov 21 10:26:23 EST 2013


On 21 November 2013 16:23, Igor Stasenko <siguctua at gmail.com> wrote:

>
>
>
> On 13 November 2013 18:08, Sean P. DeNigris <sean at clipperadams.com> wrote:
>
>> Igor Stasenko wrote
>> > PaError Pa_OpenDefaultStream(NBExternalAddress * stream ... )
>> > then your call site will look like following:
>> > streamHandle := NBExternalAddress new.
>>
>> Okay, one step closer. I somewhat randomly guessed to use
>> NBExternalAddress,
>> but didn't have the correct thing in the signature...
>>
>>
>> Igor Stasenko wrote
>> > But hold on, next thing you will stuck with is callback ... hehe :)
>> > ...
>> > for that, again you can just change the function signature and...
>> > put nil. (yes, nil literal)
>>
>> So you're saying the signature would become:
>>         nbCall: #(PaError Pa_OpenDefaultStream(NBExternalAddress * stream,
>>                 ...
>>                 ulong   framesPerBuffer,
>>                 nil,
>>                 void *  userData))
>>
>> I made the changes as I understood them, but I'm getting a "generic
>> failure"
>> when I call Pa_OpenDefaultStream.
>>
>> I uploaded the latest changes to the repo...
>>
>>
>>
> sorry for late reply.
>
> hmm.. everything should work.
> except i think nil -> void * is not accepted by default.
> you should use #optCoerceNilToNull option:
>
> self nbCall: ... options: #(+ optCoerceNilToNull)
>
> or, if you don't wanna mess with options, you can always pass a null
> pointer by constructing it,
> a simplest way is to pass dumb and stupid
>
> NBExternalAddress null.
>
> ... or since i doubt you will ever use userData argument, best option
would be to just change the signature
and put nil in it, eliminating need to care about passing and converting
useless null parameter(s).


>
>> -----
>> Cheers,
>> Sean
>> --
>> View this message in context:
>> http://forum.world.st/NativeBoost-Documentation-Suggestion-and-Question-tp4720805p4721810.html
>> Sent from the Pharo Smalltalk Developers mailing list archive at
>> Nabble.com.
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>



-- 
Best regards,
Igor Stasenko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131121/2ab7c325/attachment-0002.html>


More information about the Pharo-dev mailing list