"function not callable using argument types" - i disagree
Vlad Levenfeld via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Oct 7 12:04:02 PDT 2014
I'm trying to use the portaudio bindings and can't seem to call
Pa_OpenStream, I get this error:
------------
source/pa_test.d(156): Error: function
deimos.portaudio.Pa_OpenStream (void** stream,
const(PaStreamParameters*) inputParameters,
const(PaStreamParameters*) outputParameters, double sampleRate,
uint framesPerBuffer, uint streamFlags, extern (C) int
function(const(void)* input, void* output, uint frameCount,
const(PaStreamCallbackTimeInfo)* timeInfo, uint statusFlags,
void* userData) streamCallback, void* userData) is not callable
using argument types (void**, PaStreamParameters*,
PaStreamParameters*, double, uint, uint, extern (C) int
function(const(void)* inputBuffer, void* outputBuffer, uint
framesPerBuffer, const(PaStreamCallbackTimeInfo)* timeInfo, uint
statusFlags, void* userData), void*)
------------
for clarity, here are the argument lists separated: what I need
is up top, what I have is on the bottom:
(void**, const(PaStreamParameters*), const(PaStreamParameters*),
double, uint, uint, extern (C) int function(const(void)*, void*,
uint, const(PaStreamCallbackTimeInfo)*, uint, void*), void*)
(void**, PaStreamParameters*, PaStreamParameters*, double, uint,
uint, extern (C) int function(const(void)*, void*, uint,
const(PaStreamCallbackTimeInfo)*, uint, void*), void*)
--------------
The only difference I see is in const(PaStreamParameters*) but I
feel like every time I pass a non-const argument where a const is
required, the conversion should be implicit. At least, that's the
way I seem to recall it working.
What am I doing wrong?
More information about the Digitalmars-d-learn
mailing list