From c4ad37bb1c955b601148bd279e0b21fdeff68ac9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 28 Jan 2014 09:19:17 +0000 Subject: [PATCH] Cleanup --- source/Makefile.mk | 2 +- source/backend/engine/CarlaEngineJack.cpp | 75 ++++++++++++++------ source/backend/engine/CarlaEngineOsc.cpp | 14 ++-- source/backend/engine/CarlaEngineRtAudio.cpp | 4 +- source/backend/engine/CarlaEngineThread.cpp | 7 +- source/includes/CarlaDefines.h | 8 ++- source/modules/daz-plugins/Makefile | 8 +-- source/modules/dgl/Makefile | 4 +- source/modules/rtaudio/Makefile | 2 +- source/modules/rtmidi/Makefile | 2 +- source/modules/stk/Makefile | 2 +- source/modules/theme/Makefile | 2 +- source/utils/CarlaUtils.hpp | 10 +++ 13 files changed, 91 insertions(+), 49 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index 8b205a34c..51197f947 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -51,7 +51,7 @@ CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual ifeq ($(LINUX),true) CFLAGS += -isystem /opt/kxstudio/include -CXXFLAGS += -isystem /opt/kxstudio/include +CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt4 endif ifeq ($(MACOS),true) CFLAGS += -isystem /opt/local/include/ diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index f980687ed..8e3b9c043 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -58,6 +58,9 @@ public: if (fEngine.getProccessMode() == ENGINE_PROCESS_MODE_SINGLE_CLIENT || fEngine.getProccessMode() == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS) { CARLA_ASSERT(client != nullptr && port != nullptr); + + if (jack_uuid_t uuid = jackbridge_port_uuid(port)) + jackbridge_set_property(client, uuid, "urn:jack:IsControlVoltage", "NO", "text/plain"); } else { @@ -115,6 +118,9 @@ public: if (fEngine.getProccessMode() == ENGINE_PROCESS_MODE_SINGLE_CLIENT || fEngine.getProccessMode() == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS) { CARLA_ASSERT(client != nullptr && port != nullptr); + + if (jack_uuid_t uuid = jackbridge_port_uuid(port)) + jackbridge_set_property(client, uuid, "urn:jack:IsControlVoltage", "YES", "text/plain"); } else { @@ -402,7 +408,7 @@ public: port = jackbridge_port_register(fClient, name, JACK_DEFAULT_AUDIO_TYPE, isInput ? JackPortIsInput : JackPortIsOutput, 0); break; case kEnginePortTypeCV: - port = jackbridge_port_register(fClient, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsControlVoltage | (isInput ? JackPortIsInput : JackPortIsOutput), 0); + port = jackbridge_port_register(fClient, name, JACK_DEFAULT_AUDIO_TYPE, isInput ? JackPortIsInput : JackPortIsOutput, 0); break; case kEnginePortTypeEvent: port = jackbridge_port_register(fClient, name, JACK_DEFAULT_MIDI_TYPE, isInput ? JackPortIsInput : JackPortIsOutput, 0); @@ -410,6 +416,12 @@ public: } } + if (port == nullptr) + { + carla_stderr("CarlaEngineJackClient::addPort(%s, \"%s\", %s) - failed to create JACK port", EnginePortType2Str(portType), name, bool2str(isInput)); + return nullptr; + } + // Create Engine port switch (portType) { @@ -1232,14 +1244,14 @@ protected: const int id(getGroupId(name)); // also checks name nullness - if (id == -1) + if (id < 0) return; GroupNameToId groupNameToId; groupNameToId.setData(id, name); fUsedGroupNames.removeAll(groupNameToId); - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, id, 0, 0, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, static_cast(id), 0, 0, 0.0f, nullptr); } void handleJackPortRegistrationCallback(const jack_port_id_t port, const bool reg) @@ -1261,9 +1273,10 @@ protected: { const int jackPortFlags(jackbridge_port_flags(jackPort)); - if (groupId == -1) + if (groupId < 0) { groupId = fLastGroupId++; + CARLA_SAFE_ASSERT_RETURN(groupId >= 0,); GroupNameToId groupNameToId; groupNameToId.setData(groupId, groupName); @@ -1271,12 +1284,12 @@ protected: if (jackPortFlags & JackPortIsPhysical) { - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, groupId, PATCHBAY_ICON_HARDWARE, 0, 0.0f, groupName); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, static_cast(groupId), PATCHBAY_ICON_HARDWARE, 0, 0.0f, groupName); // hardware } else { - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, groupId, 0, 0, 0.0f, groupName); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, static_cast(groupId), 0, 0, 0.0f, groupName); //fGroupIconsChanged.append(groupId); // "application" } @@ -1284,7 +1297,16 @@ protected: bool portIsInput = (jackPortFlags & JackPortIsInput); bool portIsAudio = (std::strcmp(jackbridge_port_type(jackPort), JACK_DEFAULT_AUDIO_TYPE) == 0); - bool portIsCV = (jackPortFlags & JackPortIsControlVoltage); + bool portIsCV = false; + + if (jack_uuid_t uuid = jackbridge_port_uuid(jackPort)) + { + char* value = nullptr; + char* type = nullptr; + + if (jackbridge_get_property(uuid, "urn:jack:IsControlVoltage", &value, &type) && value != nullptr && type != nullptr && std::strcmp(type, "text/plain") == 0) + portIsCV = (std::strcmp(value, "YES") == 0); + } unsigned int canvasPortFlags = 0x0; canvasPortFlags |= portIsInput ? PATCHBAY_PORT_IS_INPUT : 0x0; @@ -1297,20 +1319,20 @@ protected: portNameToId.setData(groupId, fLastPortId++, portName, fullPortName); fUsedPortNames.append(portNameToId); - callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, groupId, portNameToId.portId, canvasPortFlags, 0.0f, portName); + callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, static_cast(groupId), portNameToId.portId, static_cast(canvasPortFlags), 0.0f, portName); } else { const int portId(getPortId(fullPortName)); - CARLA_SAFE_ASSERT_RETURN(groupId != -1,); - CARLA_SAFE_ASSERT_RETURN(portId != -1,); + CARLA_SAFE_ASSERT_RETURN(groupId >= 0,); + CARLA_SAFE_ASSERT_RETURN(portId >= 0,); PortNameToId portNameToId; portNameToId.setData(groupId, portId, portName, fullPortName); fUsedPortNames.removeOne(portNameToId); - callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, groupId, portId, 0, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, static_cast(groupId), portId, 0, 0.0f, nullptr); } } @@ -1338,7 +1360,7 @@ protected: connectionToId.setData(fLastConnectionId++, portIdA, portIdB); fUsedConnections.append(connectionToId); - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, static_cast(connectionToId.id), connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); } else { @@ -1348,7 +1370,7 @@ protected: if (connectionToId.portOut == portIdA && connectionToId.portIn == portIdB) { - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, static_cast(connectionToId.id), connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); fUsedConnections.remove(it); break; } @@ -1365,7 +1387,7 @@ protected: if (std::strcmp(groupNameToId.name, oldName) == 0) { groupNameToId.rename(newName); - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED, groupNameToId.id, 0, 0, 0.0f, newName); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED, static_cast(groupNameToId.id), 0, 0, 0.0f, newName); break; } } @@ -1384,7 +1406,7 @@ protected: const int groupId(getGroupId(groupName)); - CARLA_SAFE_ASSERT_RETURN(groupId != -1,); + CARLA_SAFE_ASSERT_RETURN(groupId >= 0,); for (LinkedList::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) { @@ -1394,7 +1416,7 @@ protected: { CARLA_SAFE_ASSERT(portNameId.groupId == groupId); portNameId.rename(portName, newName); - callback(ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, groupId, portNameId.portId, 0, 0.0f, newName); + callback(ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, static_cast(groupId), portNameId.portId, 0, 0.0f, newName); break; } } @@ -1653,7 +1675,7 @@ private: groupNameToId.setData(fLastGroupId++, ourName); fUsedGroupNames.append(groupNameToId); - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, groupNameToId.id, PATCHBAY_ICON_CARLA, 0, 0.0f, ourName); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, 0 /* our client */, PATCHBAY_ICON_CARLA, 0, 0.0f, ourName); } if (const char** ports = jackbridge_get_ports(fClient, nullptr, nullptr, 0)) @@ -1682,7 +1704,7 @@ private: if (parsedGroups.contains(qGroupName)) { groupId = getGroupId(groupName); - CARLA_SAFE_ASSERT(groupId != -1); + CARLA_SAFE_ASSERT(groupId >= 0); } else { @@ -1725,12 +1747,21 @@ private: } #endif - callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, groupId, groupIcon, 0, 0.0f, groupName); + callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, static_cast(groupId), groupIcon, 0, 0.0f, groupName); } bool portIsInput = (jackPortFlags & JackPortIsInput); bool portIsAudio = (std::strcmp(jackbridge_port_type(jackPort), JACK_DEFAULT_AUDIO_TYPE) == 0); - bool portIsCV = (portIsAudio && (jackPortFlags & JackPortIsControlVoltage) != 0); + bool portIsCV = false; + + if (jack_uuid_t uuid = jackbridge_port_uuid(jackPort)) + { + char* value = nullptr; + char* type = nullptr; + + if (jackbridge_get_property(uuid, "urn:jack:IsControlVoltage", &value, &type) && value != nullptr && type != nullptr && std::strcmp(type, "text/plain") == 0) + portIsCV = (std::strcmp(value, "YES") == 0); + } unsigned int canvasPortFlags = 0x0; canvasPortFlags |= portIsInput ? PATCHBAY_PORT_IS_INPUT : 0x0; @@ -1743,7 +1774,7 @@ private: portNameToId.setData(groupId, fLastPortId++, portName, fullPortName); fUsedPortNames.append(portNameToId); - callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, groupId, portNameToId.portId, canvasPortFlags, 0.0f, portName); + callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, static_cast(groupId), portNameToId.portId, static_cast(canvasPortFlags), 0.0f, portName); } // query connections, after all ports are in place @@ -1767,7 +1798,7 @@ private: connectionToId.setData(fLastConnectionId++, thisPortId, targetPortId); fUsedConnections.append(connectionToId); - callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); + callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, static_cast(connectionToId.id), connectionToId.portOut, connectionToId.portIn, 0.0f, nullptr); } jackbridge_free(connections); diff --git a/source/backend/engine/CarlaEngineOsc.cpp b/source/backend/engine/CarlaEngineOsc.cpp index 5a0a7ad61..ee1f8eb41 100644 --- a/source/backend/engine/CarlaEngineOsc.cpp +++ b/source/backend/engine/CarlaEngineOsc.cpp @@ -200,7 +200,7 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons } // Get plugin id from path, "/carla/23/method" -> 23 - unsigned int pluginId = 0; + uint pluginId = 0; size_t offset; if (isDigit(path[nameSize+2])) @@ -216,23 +216,23 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons { // 3 digits, /xyz/method offset = 6; - pluginId += (path[nameSize+2]-'0')*100; - pluginId += (path[nameSize+3]-'0')*10; - pluginId += (path[nameSize+4]-'0'); + pluginId += uint(path[nameSize+2]-'0')*100; + pluginId += uint(path[nameSize+3]-'0')*10; + pluginId += uint(path[nameSize+4]-'0'); } else { // 2 digits, /xy/method offset = 5; - pluginId += (path[nameSize+2]-'0')*10; - pluginId += (path[nameSize+3]-'0'); + pluginId += uint(path[nameSize+2]-'0')*10; + pluginId += uint(path[nameSize+3]-'0'); } } else { // single digit, /x/method offset = 4; - pluginId += path[nameSize+2]-'0'; + pluginId += uint(path[nameSize+2]-'0'); } } else diff --git a/source/backend/engine/CarlaEngineRtAudio.cpp b/source/backend/engine/CarlaEngineRtAudio.cpp index 80a3e5bd5..a73d52ec1 100644 --- a/source/backend/engine/CarlaEngineRtAudio.cpp +++ b/source/backend/engine/CarlaEngineRtAudio.cpp @@ -62,7 +62,7 @@ static void initRtApis() } } -const char* getRtAudioApiName(const RtAudio::Api api) +static const char* getRtAudioApiName(const RtAudio::Api api) { switch (api) { @@ -98,7 +98,7 @@ const char* getRtAudioApiName(const RtAudio::Api api) return nullptr; } -RtMidi::Api getMatchedAudioMidiAPi(const RtAudio::Api rtApi) +static RtMidi::Api getMatchedAudioMidiAPi(const RtAudio::Api rtApi) { switch (rtApi) { diff --git a/source/backend/engine/CarlaEngineThread.cpp b/source/backend/engine/CarlaEngineThread.cpp index 43e9b7945..cb3c63f9e 100644 --- a/source/backend/engine/CarlaEngineThread.cpp +++ b/source/backend/engine/CarlaEngineThread.cpp @@ -55,13 +55,12 @@ void CarlaEngineThread::run() oscRegisted = fEngine->isOscControlRegistered(); #endif - for (unsigned int i=0, count = fEngine->getCurrentPluginCount(); i < count; ++i) + for (uint i=0, count = fEngine->getCurrentPluginCount(); i < count; ++i) { CarlaPlugin* const plugin(fEngine->getPluginUnchecked(i)); CARLA_SAFE_ASSERT_CONTINUE(plugin != nullptr && plugin->isEnabled()); - - CARLA_SAFE_ASSERT_INT2(i == plugin->getId(), i, plugin->getId()); + CARLA_SAFE_ASSERT_UINT2(i == plugin->getId(), i, plugin->getId()); needsSingleThread = (plugin->getHints() & PLUGIN_NEEDS_SINGLE_THREAD); @@ -93,7 +92,7 @@ void CarlaEngineThread::run() #ifdef BUILD_BRIDGE fEngine->oscSend_bridge_parameter_value(j, value); #else - fEngine->oscSend_control_set_parameter_value(i, j, value); + fEngine->oscSend_control_set_parameter_value(i, static_cast(j), value); #endif } } diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index 11ce449c2..5dfb31f96 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -137,9 +137,11 @@ #endif /* Define CARLA_SAFE_ASSERT* */ -#define CARLA_SAFE_ASSERT(cond) if (cond) pass(); else carla_safe_assert (#cond, __FILE__, __LINE__); -#define CARLA_SAFE_ASSERT_INT(cond, value) if (cond) pass(); else carla_safe_assert_int (#cond, __FILE__, __LINE__, value); -#define CARLA_SAFE_ASSERT_INT2(cond, v1, v2) if (cond) pass(); else carla_safe_assert_int2(#cond, __FILE__, __LINE__, v1, v2); +#define CARLA_SAFE_ASSERT(cond) if (cond) pass(); else carla_safe_assert (#cond, __FILE__, __LINE__); +#define CARLA_SAFE_ASSERT_INT(cond, value) if (cond) pass(); else carla_safe_assert_int (#cond, __FILE__, __LINE__, value); +#define CARLA_SAFE_ASSERT_INT2(cond, v1, v2) if (cond) pass(); else carla_safe_assert_int2 (#cond, __FILE__, __LINE__, v1, v2); +#define CARLA_SAFE_ASSERT_UINT(cond, value) if (cond) pass(); else carla_safe_assert_uint (#cond, __FILE__, __LINE__, value); +#define CARLA_SAFE_ASSERT_UINT2(cond, v1, v2) if (cond) pass(); else carla_safe_assert_uint2(#cond, __FILE__, __LINE__, v1, v2); #define CARLA_SAFE_ASSERT_BREAK(cond) if (cond) pass(); else { carla_safe_assert(#cond, __FILE__, __LINE__); break; } #define CARLA_SAFE_ASSERT_CONTINUE(cond) if (cond) pass(); else { carla_safe_assert(#cond, __FILE__, __LINE__); continue; } diff --git a/source/modules/daz-plugins/Makefile b/source/modules/daz-plugins/Makefile index 02a81e28b..2450826eb 100644 --- a/source/modules/daz-plugins/Makefile +++ b/source/modules/daz-plugins/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/make -f # Makefile for daz-plugins # -# ---------------- # +# ------------------------ # # Created by falkTX # @@ -14,7 +14,7 @@ BUILD_CXX_FLAGS += -I. -I../../includes -I../../utils -I../distrho -isystem .. # -------------------------------------------------------------- LINK_FLAGS += -L.. -ifeq ($(HAVE_OPENGL),true) +ifeq ($(HAVE_DGL),true) LINK_FLAGS += -ldgl $(DGL_LIBS) endif ifeq ($(HAVE_JUCE),true) @@ -67,7 +67,7 @@ endif # ZynAddSubFX ifeq ($(HAVE_ZYN_DEPS),true) -ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -w +ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib) LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib) ifeq ($(HAVE_ZYN_UI_DEPS),true) @@ -264,7 +264,7 @@ midi-sequencer.cpp.o: midi-sequencer.cpp midi-base.hpp $(CXXDEPS) $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ vex-%.cpp.o: vex-%.cpp - $(CXX) $< $(BUILD_CXX_FLAGS) -w -c -o $@ + $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ zynaddsubfx-%.cpp.o: zynaddsubfx-%.cpp $(CXXDEPS) $(ZYN_UI_FILES_H) $(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ diff --git a/source/modules/dgl/Makefile b/source/modules/dgl/Makefile index 7a5bac033..5e0109efa 100644 --- a/source/modules/dgl/Makefile +++ b/source/modules/dgl/Makefile @@ -8,8 +8,8 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_C_FLAGS += $(DGL_FLAGS) -I. -w -BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. -w +BUILD_C_FLAGS += $(DGL_FLAGS) -I. +BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. LINK_FLAGS += $(DGL_LIBS) OBJS = \ diff --git a/source/modules/rtaudio/Makefile b/source/modules/rtaudio/Makefile index 5328d14f6..e679252cc 100644 --- a/source/modules/rtaudio/Makefile +++ b/source/modules/rtaudio/Makefile @@ -8,7 +8,7 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_CXX_FLAGS += $(RTAUDIO_FLAGS) -I. -Iinclude -I.. -I../../includes -w +BUILD_CXX_FLAGS += $(RTAUDIO_FLAGS) -I. -Iinclude -I.. -I../../includes LINK_FLAGS += $(RTAUDIO_LIBS) -L.. -ljackbridge OBJS = RtAudio.cpp.o diff --git a/source/modules/rtmidi/Makefile b/source/modules/rtmidi/Makefile index 9bdf115dd..a733d1636 100644 --- a/source/modules/rtmidi/Makefile +++ b/source/modules/rtmidi/Makefile @@ -8,7 +8,7 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_CXX_FLAGS += $(RTMIDI_FLAGS) -I. -Iinclude -I.. -I../../includes -w +BUILD_CXX_FLAGS += $(RTMIDI_FLAGS) -I. -Iinclude -I.. -I../../includes LINK_FLAGS += $(RTMIDI_LIBS) OBJS = RtMidi.cpp.o diff --git a/source/modules/stk/Makefile b/source/modules/stk/Makefile index f8ec99b60..27a5230b7 100644 --- a/source/modules/stk/Makefile +++ b/source/modules/stk/Makefile @@ -12,7 +12,7 @@ BUILD_CXX_FLAGS += $(STK_FLAGS) -I. LINK_FLAGS += $(STK_LIBS) ifeq ($(MACOS),true) -BUILD_CXX_FLAGS += -objc++ +BUILD_CXX_FLAGS += -ObjC++ OBJS = stk.mm.o OBJS_posix32 = stk.mm.posix32.o OBJS_posix64 = stk.mm.posix64.o diff --git a/source/modules/theme/Makefile b/source/modules/theme/Makefile index 024904d35..4bba65d3d 100644 --- a/source/modules/theme/Makefile +++ b/source/modules/theme/Makefile @@ -8,7 +8,7 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_CXX_FLAGS += -I. -I../../includes -I../../utils -w +BUILD_CXX_FLAGS += -I. -I../../includes -I../../utils ifeq ($(HAVE_QT4),true) QT4_CXX_FLAGS = $(BUILD_CXX_FLAGS) diff --git a/source/utils/CarlaUtils.hpp b/source/utils/CarlaUtils.hpp index e125798c0..4a75980ee 100644 --- a/source/utils/CarlaUtils.hpp +++ b/source/utils/CarlaUtils.hpp @@ -147,6 +147,11 @@ void carla_safe_assert_int(const char* const assertion, const char* const file, { carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, value %i", assertion, file, line, value); } +static inline +void carla_safe_assert_uint(const char* const assertion, const char* const file, const int line, const uint value) noexcept +{ + carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, value %u", assertion, file, line, value); +} /* * Print a safe assertion error message, with 2 extra integer values. @@ -156,6 +161,11 @@ void carla_safe_assert_int2(const char* const assertion, const char* const file, { carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, v1 %i, v2 %i", assertion, file, line, v1, v2); } +static inline +void carla_safe_assert_uint2(const char* const assertion, const char* const file, const int line, const uint v1, const uint v2) noexcept +{ + carla_stderr2("Carla assertion failure: \"%s\" in file %s, line %i, v1 %u, v2 %u", assertion, file, line, v1, v2); +} // ----------------------------------------------------------------------- // carla_*sleep