Skip to content

Commit dd989f4

Browse files
JohannesLorenzJohannes Lorenz
authored andcommitted
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`.
1 parent 895bcff commit dd989f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/rtosc/port-sugar.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ template<class T> constexpr T spice(T*t) {return *t;}
485485
if(!strcmp("", args)) {\
486486
data.reply(loc, obj->name ? "T" : "F"); \
487487
} else { \
488-
if(obj->name != rtosc_argument(msg, 0).T) { \
488+
if(obj->name != (bool)rtosc_argument(msg, 0).T) { \
489489
data.broadcast(loc, args);\
490-
obj->name = rtosc_argument(msg, 0).T; \
490+
obj->name = (bool)rtosc_argument(msg, 0).T; \
491491
rChangeCb; \
492492
} \
493493
} rBOIL_END
@@ -554,11 +554,11 @@ template<class T> constexpr T spice(T*t) {return *t;}
554554
if(!strcmp("", args)) {\
555555
data.reply(loc, obj->name[idx] ? "T" : "F"); \
556556
} else { \
557-
if(obj->name[idx] != rtosc_argument(msg, 0).T) { \
557+
if(obj->name[idx] != (bool)rtosc_argument(msg, 0).T) { \
558558
data.broadcast(loc, args);\
559559
rChangeCb; \
560560
} \
561-
obj->name[idx] = rtosc_argument(msg, 0).T; \
561+
obj->name[idx] = (bool)rtosc_argument(msg, 0).T; \
562562
} rBOILS_END
563563

564564
#define rArrayTCbMember(name, member) rBOILS_BEGIN \

0 commit comments

Comments
 (0)