From 3b19a11e8adf5608c9facd6a4e93d8833cbc4e3f Mon Sep 17 00:00:00 2001 From: pixl Date: Tue, 2 May 2023 01:14:50 -0400 Subject: [PATCH] Fix release build warnings --- src/common_gdbus.cpp | 2 +- src/server_gdbus.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common_gdbus.cpp b/src/common_gdbus.cpp index b297f37..1893a9e 100644 --- a/src/common_gdbus.cpp +++ b/src/common_gdbus.cpp @@ -82,7 +82,7 @@ variant_type::variant_type(const std::type_info& primitive) { else if(primitive == typeid(bool)) type = G_VARIANT_TYPE_BOOLEAN; else - assert(!"Invalid GVariant type"); + throw std::runtime_error("Invalid GVariant type"); data = g_type_to_any(g_variant_type_copy(type)); } diff --git a/src/server_gdbus.cpp b/src/server_gdbus.cpp index 3eee1fb..9d7bfca 100644 --- a/src/server_gdbus.cpp +++ b/src/server_gdbus.cpp @@ -293,7 +293,7 @@ struct server::internal { return g_variant_new_array(nullptr, raw_array.get(), map.size()); } else { // This should not happen - assert(!"converted unhandled variant type"); + throw std::runtime_error("converted unhandled variant type"); } } @@ -478,6 +478,7 @@ struct server::internal { G_DBUS_ERROR_FAILED, "Internal error"); assert(!"method call on non-existent server"); + return nullptr; } } @@ -564,8 +565,8 @@ struct server::internal { G_DBUS_ERROR_FAILED, "Internal error"); assert(!"method call on non-existent server"); + return false; } - } static void name_acquired_handler(