diff --git a/src/AudioFlyin.cpp b/src/AudioFlyin.cpp index a3150d2..297945c 100644 --- a/src/AudioFlyin.cpp +++ b/src/AudioFlyin.cpp @@ -130,7 +130,7 @@ namespace AudioFlyin parent.AddChild(std::move(icon)); } - void Create(Window& window, int32_t monitor, Type type) + void Create(Window& window, UNUSED int32_t monitor, Type type) { DynCtx::win = &window; DynCtx::type = type; diff --git a/src/BluetoothDevices.cpp b/src/BluetoothDevices.cpp index 1998913..24d23c7 100644 --- a/src/BluetoothDevices.cpp +++ b/src/BluetoothDevices.cpp @@ -286,7 +286,7 @@ namespace BluetoothDevices parentWidget.AddChild(std::move(bodyBox)); } - void Create(Window& window, int32_t monitor) + void Create(Window& window, UNUSED int32_t monitor) { DynCtx::win = &window; auto mainWidget = Widget::Create(); diff --git a/src/Common.h b/src/Common.h index 8bd4fcd..3ed0ea5 100644 --- a/src/Common.h +++ b/src/Common.h @@ -85,7 +85,7 @@ namespace Utils return buf; } - static std::vector Split(const std::string& str, char delim) + inline std::vector Split(const std::string& str, char delim) { std::stringstream strstr(str); std::string curElem; diff --git a/src/SNI.cpp b/src/SNI.cpp index a6df00f..557ed08 100644 --- a/src/SNI.cpp +++ b/src/SNI.cpp @@ -30,17 +30,17 @@ namespace SNI { std::string name; std::string object; - size_t w; - size_t h; + size_t w = 0; + size_t h = 0; uint8_t* iconData = nullptr; - std::string tooltip; + std::string tooltip = ""; - std::string menuObjectPath; + std::string menuObjectPath = ""; - EventBox* gtkEvent; + EventBox* gtkEvent = nullptr; - int watcherID; + int watcherID = -1; }; std::vector items; @@ -556,7 +556,7 @@ namespace SNI sni_watcher_set_is_status_notifier_host_registered(watcherSkeleton, true); }; auto emptyCallback = [](GDBusConnection*, const char*, void*) {}; - auto lostName = [](GDBusConnection*, const char* msg, void*) + auto lostName = [](GDBusConnection*, const char*, void*) { LOG("SNI: Lost Name! Disabling SNI!"); RuntimeConfig::Get().hasSNI = false; diff --git a/src/System.cpp b/src/System.cpp index 9017e01..d098bc9 100644 --- a/src/System.cpp +++ b/src/System.cpp @@ -587,7 +587,7 @@ namespace System { returnVal(std::stoul(buf)); } - catch (std::invalid_argument) + catch (std::invalid_argument&) { configMutex.lock(); LOG("GetOutdatedPackages: Invalid output of the package script. Disabling package widget!"); diff --git a/src/Wayland.cpp b/src/Wayland.cpp index 94fb602..914c2ed 100644 --- a/src/Wayland.cpp +++ b/src/Wayland.cpp @@ -1,4 +1,3 @@ -#pragma once #include "Wayland.h" #include "Common.h" @@ -98,7 +97,7 @@ namespace Wayland { LOG("Wayland: Added workspace!"); workspaceGroups[workspace].workspaces.push_back(ws); - workspaces[ws] = {workspace, (uint32_t)-1}; + workspaces[ws] = {workspace, (uint32_t)-1, false}; zext_workspace_handle_v1_add_listener(ws, &workspaceListener, nullptr); registeredWorkspace = true; } diff --git a/src/Widget.cpp b/src/Widget.cpp index 1ed7892..2b7fe37 100644 --- a/src/Widget.cpp +++ b/src/Widget.cpp @@ -17,6 +17,8 @@ namespace Utils case Alignment::Center: return GTK_ALIGN_CENTER; case Alignment::Fill: return GTK_ALIGN_FILL; } + LOG("ToGtkAlign: Invalid alignment " << (int)align); + return GTK_ALIGN_FILL; } GtkOrientation ToGtkOrientation(Orientation orientation) { @@ -25,6 +27,8 @@ namespace Utils case Orientation::Vertical: return GTK_ORIENTATION_VERTICAL; case Orientation::Horizontal: return GTK_ORIENTATION_HORIZONTAL; } + LOG("ToGtkOrientation: Invalid orientation " << (int)orientation); + return GTK_ORIENTATION_HORIZONTAL; } GtkRevealerTransitionType ToGtkRevealerTransitionType(TransitionType transition) { @@ -36,6 +40,8 @@ namespace Utils case TransitionType::SlideDown: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN; case TransitionType::SlideUp: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP; } + LOG("ToGtkRevealerTransitionType: Invalid transition " << (int)transition); + return GTK_REVEALER_TRANSITION_TYPE_NONE; } } diff --git a/src/Widget.h b/src/Widget.h index 4febcfb..66a6a4a 100644 --- a/src/Widget.h +++ b/src/Widget.h @@ -69,8 +69,9 @@ struct Range double min, max; }; -struct SliderRange : Range +struct SliderRange { + double min, max; double step; };