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