From: fennecdjay Date: Sat, 17 Feb 2024 04:34:56 +0000 (+0100) Subject: :art: boolify DRVINI X-Git-Tag: nightly~70 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=3711a68c5d5dee5241d105b16f8251d977e08de4;p=gwion.git :art: boolify DRVINI --- diff --git a/include/driver.h b/include/driver.h index 3118941e..c9dea653 100644 --- a/include/driver.h +++ b/include/driver.h @@ -1,7 +1,7 @@ #ifndef __DRIVER #define __DRIVER #include "soundinfo.h" -typedef m_bool (*f_drvini)(struct VM_ *, struct BBQ_ *); +typedef bool (*f_drvini)(struct VM_ *, struct BBQ_ *); typedef void (*f_drvrun)(struct VM_ *, struct BBQ_ *); typedef void (*f_drvdel)(struct VM_ *, struct BBQ_ *); @@ -25,12 +25,12 @@ typedef struct BBQ_ { bool is_running; } Driver; -#define DRVINI(a) ANN m_bool a(struct VM_ *vm NUSED, Driver *di NUSED) +#define DRVINI(a) ANN bool a(struct VM_ *vm NUSED, Driver *di NUSED) #define DRVRUN(a) ANN void a(struct VM_ *vm NUSED, Driver *di NUSED) #define DRVDEL(a) ANN void a(struct VM_ *vm NUSED, Driver *di NUSED) -ANN void dummy_driver(DriverData *); -ANN void driver_alloc(Driver *); +ANN void dummy_driver(DriverData *); +ANN void driver_alloc(Driver *); ANN Driver *new_driver(MemPool); ANN void free_driver(Driver *, struct VM_ *); #endif diff --git a/plug b/plug index 3df21f0b..82b13e3b 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit 3df21f0b68d5bf2aa606119f7405f841feea3780 +Subproject commit 82b13e3b9c04c292342461b481289f68d428e04e diff --git a/src/gwion.c b/src/gwion.c index 0876be2e..d1934b89 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -20,8 +20,7 @@ ANN static bool gwion_audio(const Gwion gwion) { Driver *const di = gwion->vm->bbq; if (di->si->arg) CHECK_B((di->func = driver_ini(gwion, di->si))); di->func(di->driver); - if(di->driver->ini(gwion->vm, di) < 0) - return false; + CHECK_B(di->driver->ini(gwion->vm, di)); driver_alloc(di); return true; } diff --git a/src/vm/driver.c b/src/vm/driver.c index 3550ff6f..62e7400e 100644 --- a/src/vm/driver.c +++ b/src/vm/driver.c @@ -37,7 +37,7 @@ static DRVRUN(dummy_run) { static DRVINI(dummy_ini) { gw_err("{-/}using dummy driver{0}\n"); - return GW_OK; + return true; } void dummy_driver(DriverData *dd) { diff --git a/tests/driver/simple_driver.c b/tests/driver/simple_driver.c index 7bcede9c..d3c85e2d 100644 --- a/tests/driver/simple_driver.c +++ b/tests/driver/simple_driver.c @@ -11,7 +11,7 @@ static DRVRUN(simple_driver_run) { } } -static DRVINI(simple_driver_ini) { return GW_OK; } +static DRVINI(simple_driver_ini) { return true; } static DRVDEL(simple_driver_del) {}