mirror of
https://github.com/PixlOne/logiops.git
synced 2025-07-16 06:12:32 +08:00
Fix release warnings
Also possibly fixes some undefined behaviour in release builds?
This commit is contained in:
parent
8a4e2cce81
commit
a468861f7d
@ -1 +1 @@
|
||||
Subproject commit 7bb0e46203d7b8122211cb362ed63aea5f8caeb4
|
||||
Subproject commit 3b19a11e8adf5608c9facd6a4e93d8833cbc4e3f
|
@ -42,7 +42,11 @@ Configuration::Configuration(std::string config_file) :
|
||||
Config::operator=(get<Config>(_config.getRoot()));
|
||||
|
||||
if (!devices.has_value())
|
||||
devices = decltype(config::Config::devices)();
|
||||
devices.emplace();
|
||||
}
|
||||
|
||||
Configuration::Configuration() {
|
||||
devices.emplace();
|
||||
}
|
||||
|
||||
void Configuration::save() {
|
||||
|
@ -37,7 +37,7 @@ namespace logid {
|
||||
public:
|
||||
explicit Configuration(std::string config_file);
|
||||
|
||||
Configuration() = default;
|
||||
Configuration();
|
||||
|
||||
// Reloading is not safe, references will be invalidated
|
||||
//void reload();
|
||||
|
@ -214,11 +214,6 @@ std::shared_ptr<ipcgull::node> Device::ipcNode() const {
|
||||
return _ipc_node;
|
||||
}
|
||||
|
||||
/*config::Device& Device::config()
|
||||
{
|
||||
return _config;
|
||||
}*/
|
||||
|
||||
config::Profile& Device::activeProfile() {
|
||||
return _profile->second;
|
||||
}
|
||||
@ -270,15 +265,13 @@ config::Device& Device::_getConfig(
|
||||
const std::string& name) {
|
||||
static std::mutex config_mutex;
|
||||
std::lock_guard<std::mutex> lock(config_mutex);
|
||||
auto& devices = manager->config()->devices;
|
||||
if (!devices.has_value())
|
||||
devices = decltype(config::Config::devices)();
|
||||
auto& devices = manager->config()->devices.value();
|
||||
|
||||
if (!devices.value().count(name)) {
|
||||
devices.value().emplace(name, config::Device());
|
||||
if (!devices.count(name)) {
|
||||
devices.emplace(name, config::Device());
|
||||
}
|
||||
|
||||
auto& device = devices.value().at(name);
|
||||
auto& device = devices.at(name);
|
||||
if (std::holds_alternative<config::Profile>(device)) {
|
||||
config::Device d;
|
||||
d.profiles["default"] = std::get<config::Profile>(device);
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include <backend/hidpp10/ReceiverMonitor.h>
|
||||
#include <cassert>
|
||||
#include <util/task.h>
|
||||
#include <util/log.h>
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
#include <backend/hidpp20/features/ChangeHost.h>
|
||||
#include <backend/hidpp20/Device.h>
|
||||
#include <backend/hidpp20/Error.h>
|
||||
|
||||
using namespace logid::backend::hidpp20;
|
||||
|
||||
|
@ -165,7 +165,7 @@ void IOMonitor::_interrupt() noexcept {
|
||||
_interrupting = true;
|
||||
|
||||
uint64_t counter = 1;
|
||||
ssize_t ret = ::write(_event_fd, &counter, sizeof(counter));
|
||||
[[maybe_unused]] ssize_t ret = ::write(_event_fd, &counter, sizeof(counter));
|
||||
assert(ret == sizeof(counter));
|
||||
|
||||
// Wait for the IO monitor to _stop
|
||||
@ -177,7 +177,7 @@ void IOMonitor::_continue() noexcept {
|
||||
std::unique_lock<std::mutex> run_lock(_run_lock, std::try_to_lock);
|
||||
|
||||
uint64_t counter;
|
||||
ssize_t ret = ::read(_event_fd, &counter, sizeof(counter));
|
||||
[[maybe_unused]] ssize_t ret = ::read(_event_fd, &counter, sizeof(counter));
|
||||
|
||||
assert(ret != -1);
|
||||
|
||||
|
@ -3,12 +3,10 @@
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
|
||||
<busconfig>
|
||||
<!-- Only root user can own the service -->
|
||||
<policy user="root">
|
||||
<allow own="pizza.pixl.LogiOps"/>
|
||||
</policy>
|
||||
|
||||
<!-- Allow anyone to invoke methods on server, except SetHostName -->
|
||||
<policy context="default">
|
||||
<allow send_destination="pizza.pixl.LogiOps"/>
|
||||
<allow receive_sender="pizza.pixl.LogiOps"/>
|
||||
|
Loading…
Reference in New Issue
Block a user