www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13584] New: "not callable using argument types" despite


          Issue ID: 13584
           Summary: "not callable using argument types" despite perfect
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: vlevenfeld gmail.com

Using the portaudio bindings, I get this message:


source/pa_test.d(166): 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**,
const(PaStreamParameters*), const(PaStreamParameters*), double, uint, uint,
extern (C) int function(const(void)* inputBuffer, void* outputBuffer, uint
framesPerBuffer, const(PaStreamCallbackTimeInfo)* timeInfo, uint statusFlags,
void* userData), void*)


The argument types passed are identical to the argument types required.

Here is the main method:

void main ()
        PaStreamParameters inputP, outputP;
        PaStream* stream;
        PaError err = paNoError;

        err = Pa_Initialize;
        assert (err == paNoError);

        inputP.device = Pa_GetDefaultInputDevice;

        assert (inputP.device != paNoDevice);

        with (inputP)
                channelCount = 1;
                sampleFormat = paFloat32;
                suggestedLatency = Pa_GetDeviceInfo

        enum sampleRate = 44100.0;
        enum recTime = 10;

        float[sampleRate.to!size_t * recTime] data;

        err = Pa_OpenStream (&stream,
        assert (err == paNoError);

        Pa_StartStream (stream);
        foreach (i; 0..100)
                Pa_Sleep (100);
                writeln (maxed*50);
        Pa_StopStream (stream);


Oct 07 2014