Fix compiler errors and warnings on Ubuntu 20.04

Also fixes some warnings and errors seen on clang.
This commit is contained in:
pixl 2023-05-03 15:14:51 -04:00
parent 7147825539
commit 4c406c7363
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E
10 changed files with 10 additions and 11 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.12)
set(CMAKE_INSTALL_PREFIX /usr) set(CMAKE_INSTALL_PREFIX /usr)

@ -1 +1 @@
Subproject commit 3b19a11e8adf5608c9facd6a4e93d8833cbc4e3f Subproject commit 0ad3795fcc383f51664e16c4ea1e86143207bf07

View File

@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.12)
project(logid) project(logid)
# C++20 is only needed for string literal template parameters # C++20 is only needed for string literal template parameters
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../CMake") set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../CMake")

View File

@ -100,7 +100,6 @@ Device::Device(std::string path, backend::hidpp::DeviceIndex index,
_path(std::move(path)), _index(index), _path(std::move(path)), _index(index),
_config(_getConfig(manager, _hidpp20->name())), _config(_getConfig(manager, _hidpp20->name())),
_profile_name(ipcgull::property_readable, ""), _profile_name(ipcgull::property_readable, ""),
_receiver(nullptr),
_manager(manager), _manager(manager),
_nickname(manager), _nickname(manager),
_ipc_node(manager->devicesNode()->make_child(_nickname)), _ipc_node(manager->devicesNode()->make_child(_nickname)),
@ -116,7 +115,6 @@ Device::Device(std::shared_ptr<backend::raw::RawDevice> raw_device,
_path(raw_device->rawPath()), _index(index), _path(raw_device->rawPath()), _index(index),
_config(_getConfig(manager, _hidpp20->name())), _config(_getConfig(manager, _hidpp20->name())),
_profile_name(ipcgull::property_readable, ""), _profile_name(ipcgull::property_readable, ""),
_receiver(nullptr),
_manager(manager), _manager(manager),
_nickname(manager), _nickname(manager),
_ipc_node(manager->devicesNode()->make_child(_nickname)), _ipc_node(manager->devicesNode()->make_child(_nickname)),
@ -132,7 +130,6 @@ Device::Device(Receiver* receiver, hidpp::DeviceIndex index,
_path(receiver->path()), _index(index), _path(receiver->path()), _index(index),
_config(_getConfig(manager, _hidpp20->name())), _config(_getConfig(manager, _hidpp20->name())),
_profile_name(ipcgull::property_readable, ""), _profile_name(ipcgull::property_readable, ""),
_receiver(receiver),
_manager(manager), _manager(manager),
_nickname(manager), _nickname(manager),
_ipc_node(manager->devicesNode()->make_child(_nickname)), _ipc_node(manager->devicesNode()->make_child(_nickname)),

View File

@ -157,7 +157,6 @@ namespace logid {
ipcgull::property<std::string> _profile_name; ipcgull::property<std::string> _profile_name;
std::map<std::string, config::Profile>::iterator _profile; std::map<std::string, config::Profile>::iterator _profile;
Receiver* _receiver;
const std::weak_ptr<DeviceManager> _manager; const std::weak_ptr<DeviceManager> _manager;
void _makeResetMechanism(); void _makeResetMechanism();

View File

@ -21,6 +21,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <mutex>
extern "C" extern "C"
{ {

View File

@ -31,7 +31,7 @@ class EventHandlerLock;
template <class T> template <class T>
struct EventHandlerList { struct EventHandlerList {
typedef std::list<typename T::EventHandler> list_t; typedef std::list<typename T::EventHandler> list_t;
typedef list_t::const_iterator iterator_t; typedef typename list_t::const_iterator iterator_t;
std::list<typename T::EventHandler> list; std::list<typename T::EventHandler> list;
mutable std::shared_mutex mutex; mutable std::shared_mutex mutex;

View File

@ -310,7 +310,7 @@ bool Device::isStable10() {
} }
bool Device::isStable20() { bool Device::isStable20() {
static constexpr std::string ping_seq = "hello"; static const std::string ping_seq = "hello";
hidpp20::Root root(this); hidpp20::Root root(this);

View File

@ -40,7 +40,7 @@ namespace logid::backend::hidpp20 {
struct HostInfo { struct HostInfo {
uint8_t hostCount; uint8_t hostCount;
uint8_t currentHost; uint8_t currentHost;
[[maybe_unused]] bool enhancedHostSwitch; bool enhancedHostSwitch;
}; };
HostInfo getHostInfo(); HostInfo getHostInfo();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2022 PixlOne * Copyright 2019-2023 PixlOne
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -22,6 +22,7 @@
#include <functional> #include <functional>
#include <map> #include <map>
#include <mutex> #include <mutex>
#include <thread>
#include <condition_variable> #include <condition_variable>
namespace logid::backend::raw { namespace logid::backend::raw {