Fix compiler warnings

This commit is contained in:
scorpion-26 2023-07-28 19:11:13 +02:00
parent 4a52bb744a
commit 3bac707bf5
8 changed files with 20 additions and 14 deletions

View file

@ -130,7 +130,7 @@ namespace AudioFlyin
parent.AddChild(std::move(icon)); 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::win = &window;
DynCtx::type = type; DynCtx::type = type;

View file

@ -286,7 +286,7 @@ namespace BluetoothDevices
parentWidget.AddChild(std::move(bodyBox)); parentWidget.AddChild(std::move(bodyBox));
} }
void Create(Window& window, int32_t monitor) void Create(Window& window, UNUSED int32_t monitor)
{ {
DynCtx::win = &window; DynCtx::win = &window;
auto mainWidget = Widget::Create<Box>(); auto mainWidget = Widget::Create<Box>();

View file

@ -85,7 +85,7 @@ namespace Utils
return buf; return buf;
} }
static std::vector<std::string> Split(const std::string& str, char delim) inline std::vector<std::string> Split(const std::string& str, char delim)
{ {
std::stringstream strstr(str); std::stringstream strstr(str);
std::string curElem; std::string curElem;

View file

@ -30,17 +30,17 @@ namespace SNI
{ {
std::string name; std::string name;
std::string object; std::string object;
size_t w; size_t w = 0;
size_t h; size_t h = 0;
uint8_t* iconData = nullptr; 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<Item> items; std::vector<Item> items;
@ -556,7 +556,7 @@ namespace SNI
sni_watcher_set_is_status_notifier_host_registered(watcherSkeleton, true); sni_watcher_set_is_status_notifier_host_registered(watcherSkeleton, true);
}; };
auto emptyCallback = [](GDBusConnection*, const char*, void*) {}; 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!"); LOG("SNI: Lost Name! Disabling SNI!");
RuntimeConfig::Get().hasSNI = false; RuntimeConfig::Get().hasSNI = false;

View file

@ -587,7 +587,7 @@ namespace System
{ {
returnVal(std::stoul(buf)); returnVal(std::stoul(buf));
} }
catch (std::invalid_argument) catch (std::invalid_argument&)
{ {
configMutex.lock(); configMutex.lock();
LOG("GetOutdatedPackages: Invalid output of the package script. Disabling package widget!"); LOG("GetOutdatedPackages: Invalid output of the package script. Disabling package widget!");

View file

@ -1,4 +1,3 @@
#pragma once
#include "Wayland.h" #include "Wayland.h"
#include "Common.h" #include "Common.h"
@ -98,7 +97,7 @@ namespace Wayland
{ {
LOG("Wayland: Added workspace!"); LOG("Wayland: Added workspace!");
workspaceGroups[workspace].workspaces.push_back(ws); 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); zext_workspace_handle_v1_add_listener(ws, &workspaceListener, nullptr);
registeredWorkspace = true; registeredWorkspace = true;
} }

View file

@ -17,6 +17,8 @@ namespace Utils
case Alignment::Center: return GTK_ALIGN_CENTER; case Alignment::Center: return GTK_ALIGN_CENTER;
case Alignment::Fill: return GTK_ALIGN_FILL; case Alignment::Fill: return GTK_ALIGN_FILL;
} }
LOG("ToGtkAlign: Invalid alignment " << (int)align);
return GTK_ALIGN_FILL;
} }
GtkOrientation ToGtkOrientation(Orientation orientation) GtkOrientation ToGtkOrientation(Orientation orientation)
{ {
@ -25,6 +27,8 @@ namespace Utils
case Orientation::Vertical: return GTK_ORIENTATION_VERTICAL; case Orientation::Vertical: return GTK_ORIENTATION_VERTICAL;
case Orientation::Horizontal: return GTK_ORIENTATION_HORIZONTAL; case Orientation::Horizontal: return GTK_ORIENTATION_HORIZONTAL;
} }
LOG("ToGtkOrientation: Invalid orientation " << (int)orientation);
return GTK_ORIENTATION_HORIZONTAL;
} }
GtkRevealerTransitionType ToGtkRevealerTransitionType(TransitionType transition) GtkRevealerTransitionType ToGtkRevealerTransitionType(TransitionType transition)
{ {
@ -36,6 +40,8 @@ namespace Utils
case TransitionType::SlideDown: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN; case TransitionType::SlideDown: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN;
case TransitionType::SlideUp: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP; case TransitionType::SlideUp: return GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP;
} }
LOG("ToGtkRevealerTransitionType: Invalid transition " << (int)transition);
return GTK_REVEALER_TRANSITION_TYPE_NONE;
} }
} }

View file

@ -69,8 +69,9 @@ struct Range
double min, max; double min, max;
}; };
struct SliderRange : Range struct SliderRange
{ {
double min, max;
double step; double step;
}; };