From dd989f4c20d50b4d3788e255c6e1b7cf55aded37 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sun, 10 Aug 2025 17:34:36 +0200 Subject: [PATCH] Use cast in unsafe comparison This was used to fix some MSVC compiler warnings in zyn. The zyn submodule should not yet be updated past this commit until zyn has changed its respective `unsigned char` class members to `bool`. --- include/rtosc/port-sugar.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/rtosc/port-sugar.h b/include/rtosc/port-sugar.h index 7a47371..9a1b0cd 100644 --- a/include/rtosc/port-sugar.h +++ b/include/rtosc/port-sugar.h @@ -485,9 +485,9 @@ template constexpr T spice(T*t) {return *t;} if(!strcmp("", args)) {\ data.reply(loc, obj->name ? "T" : "F"); \ } else { \ - if(obj->name != rtosc_argument(msg, 0).T) { \ + if(obj->name != (bool)rtosc_argument(msg, 0).T) { \ data.broadcast(loc, args);\ - obj->name = rtosc_argument(msg, 0).T; \ + obj->name = (bool)rtosc_argument(msg, 0).T; \ rChangeCb; \ } \ } rBOIL_END @@ -554,11 +554,11 @@ template constexpr T spice(T*t) {return *t;} if(!strcmp("", args)) {\ data.reply(loc, obj->name[idx] ? "T" : "F"); \ } else { \ - if(obj->name[idx] != rtosc_argument(msg, 0).T) { \ + if(obj->name[idx] != (bool)rtosc_argument(msg, 0).T) { \ data.broadcast(loc, args);\ rChangeCb; \ } \ - obj->name[idx] = rtosc_argument(msg, 0).T; \ + obj->name[idx] = (bool)rtosc_argument(msg, 0).T; \ } rBOILS_END #define rArrayTCbMember(name, member) rBOILS_BEGIN \