[Issue 13584] New: "not callable using argument types" despite perfect match

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 7 13:47:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13584

          Issue ID: 13584
           Summary: "not callable using argument types" despite perfect
                    match
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: vlevenfeld at 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
(device).defaultLowInputLatency;
            }

        enum sampleRate = 44100.0;
        enum recTime = 10;

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

        err = Pa_OpenStream (&stream,
            cast(const(PaStreamParameters*))&inputP,
            cast(const(PaStreamParameters*))null,
            44100.0,
            paFramesPerBufferUnspecified.to!uint,
            paClipOff,
            &record,
            cast(void*)data.ptr
        );
        assert (err == paNoError);

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

        Pa_Terminate;
    }

--


More information about the Digitalmars-d-bugs mailing list