From b01e0f461c95f21cfce6c3c5bf939aedde1a4e2e Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Thu, 30 May 2024 17:25:07 +0000 Subject: [PATCH] Fix compilation error on portaudio codepath --- src/monocoque/devices/simdevice.c | 21 ------------------- .../devices/sound/usb_generic_shaker.c | 2 +- src/monocoque/monocoque.c | 8 ++++++- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/monocoque/devices/simdevice.c b/src/monocoque/devices/simdevice.c index a462d96..21006b4 100644 --- a/src/monocoque/devices/simdevice.c +++ b/src/monocoque/devices/simdevice.c @@ -24,27 +24,6 @@ int devupdate(SimDevice* this, SimData* simdata) return 0; } -int devfree(SimDevice* simdevices, int numdevices) -{ - - slogi("freeing %i simdevices...", numdevices); - int devices = 0; - - int freed = 0; - for (int j = 0; j < 1; j++) - { - SimDevice simdev = simdevices[j]; - if (simdev.initialized == true) - { - simdev.free(&simdev); - } - } - - //free(simdevices); - - return 0; -} - int devinit(SimDevice* simdevices, int numdevices, DeviceSettings* ds) { slogi("initializing simdevices..."); diff --git a/src/monocoque/devices/sound/usb_generic_shaker.c b/src/monocoque/devices/sound/usb_generic_shaker.c index 9924d7e..7f04d3a 100644 --- a/src/monocoque/devices/sound/usb_generic_shaker.c +++ b/src/monocoque/devices/sound/usb_generic_shaker.c @@ -116,7 +116,7 @@ int usb_generic_shaker_init(SoundDevice* sounddevice) sounddevice->outputParameters.suggestedLatency = Pa_GetDeviceInfo( sounddevice->outputParameters.device )->defaultLowOutputLatency; sounddevice->outputParameters.hostApiSpecificStreamInfo = NULL; - if (sounddevice->effecttype == SOUNDEFFECT_GEARSHIFT) + if (sounddevice->effecttype == EFFECT_GEARSHIFT) { err = Pa_OpenStream( &sounddevice->stream, NULL, /* No input. */ diff --git a/src/monocoque/monocoque.c b/src/monocoque/monocoque.c index 991af2f..8d9ead3 100644 --- a/src/monocoque/monocoque.c +++ b/src/monocoque/monocoque.c @@ -231,7 +231,13 @@ int main(int argc, char** argv) } - devfree(devices, initdevices); + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].free(&devices[x]); + } + } i = 0; // improve the api around the config helper