From c6e6903e0ecf9876322d7867a2cc578b3f2d1ee8 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 5 Nov 2020 16:04:59 +0100 Subject: [PATCH] :art: Improve plug API --- include/plug.h | 2 +- src/plug.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/plug.h b/include/plug.h index 57fa37dd..a2c08e7a 100644 --- a/include/plug.h +++ b/include/plug.h @@ -17,6 +17,6 @@ ANN m_bool plugin_ini(struct Gwion_ *gwion, const m_str iname); #define GWMODINI(a) ANN2(1) void* GWMODINI_NAME(const struct Gwion_ *gwion NUSED, const Vector args NUSED) #define GWMODEND(a) ANN void GWMODEND_NAME(const struct Gwion_ *gwion NUSED, void* self NUSED) #define GWDRIVER(a) ANN void GWDRIVER_NAME(DriverData* d) -#define GWDEPEND ANN m_str* GWDEPEND_NAME(void) +#define GWDEPEND ANN m_str* const GWDEPEND_NAME(void) #endif diff --git a/src/plug.c b/src/plug.c index 4104cf20..eeaceeca 100644 --- a/src/plug.c +++ b/src/plug.c @@ -157,7 +157,8 @@ ANN void plug_run(const struct Gwion_ *gwion, const Map mod) { ANN static m_bool dependencies(struct Gwion_ *gwion, const Plug plug) { const gwdeps dep = DLSYM(plug->dl, gwdeps, GWDEPEND_NAME); if(dep) { - m_str *deps = dep(); + m_str *const base = dep(); + m_str *deps = base; while(*deps) { CHECK_BB(plugin_ini(gwion, *deps)) ++deps; -- 2.43.0