diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1424127..a8b65b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,55 +94,77 @@ jobs: - name: Install dependencies run: | + # Install LLVM 19 with libc++ + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | \ + sudo tee /etc/apt/trusted.gpg.d/llvm.asc + sudo add-apt-repository -y \ + 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' sudo apt-get update sudo apt-get install -y \ - clang-tidy \ - gcc-14 \ - g++-14 \ + clang-19 \ + clang-tidy-19 \ + llvm-19 \ + llvm-19-dev \ + lld-19 \ + libc++-19-dev \ + libc++abi-19-dev \ cmake \ ninja-build \ libudev-dev \ libsystemd-dev \ pkg-config - - name: Cache clang-tidy results - uses: actions/cache@v4 - with: - path: .clang-tidy-cache - key: >- - clang-tidy-${{ runner.os }}-${{ - hashFiles('**/*.cpp', '**/*.cc', '**/*.h', '**/*.hpp', - '.clang-tidy') }} - restore-keys: | - clang-tidy-${{ runner.os }}- - - name: Configure CMake for clang-tidy run: | mkdir -p build cd build cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \ + -DLLVM_CONFIG=/usr/bin/llvm-config-19 + + sed -i \ + -e 's/-fdeps-format=p1689r5//g' \ + -e 's/-fmodules-ts//g' \ + -e 's/-fmodule-mapper=[^ ]*//g' \ + -e 's/@[^ ]*\.modmap//g' \ + compile_commands.json + env: - CC: gcc-14 - CXX: g++-14 + CC: clang-19 + CXX: clang++-19 - name: Run clang-tidy run: | - # Create cache directory if it doesn't exist - mkdir -p .clang-tidy-cache - # Find all C++ source files and run clang-tidy # Exclude third_party directory from analysis - find src -type f \( -name "*.cpp" -o -name "*.cc" \) | \ - while read file; do - echo "Analyzing $file..." - clang-tidy "$file" \ - -p build \ - --warnings-as-errors='*' \ - --header-filter='^(?!.*third_party).*$' \ - --system-headers=false || exit 1 - done + export FILE_LIST=$(find src -type d -name third_party -prune -false -o -name '*.cc' -o -name '*.hpp' -o -name '*.h') + + clang-tidy-19 --version + clang-tidy-19 --help + + clang-tidy-19 \ + -p build \ + -export-fixes=tidy-results-suggested-fixes.txt \ + -extra-arg='-Ithird_party/glaze/include' \ + -extra-arg='-Ithird_party/sdbus-cpp/include' \ + -extra-arg='-Ithird_party/spdlog/include' \ + -warnings-as-errors='*' \ + -header-filter='^(?!.*third_party).*$' \ + --dump-config + + run-clang-tidy-19 \ + -p build \ + -export-fixes=tidy-results-suggested-fixes.txt \ + -extra-arg='-Ithird_party/glaze/include' \ + -extra-arg='-Ithird_party/sdbus-cpp/include' \ + -extra-arg='-Ithird_party/spdlog/include' \ + -warnings-as-errors='*' \ + -header-filter='^(?!.*third_party).*$' \ + $FILE_LIST + shell: bash build: diff --git a/interfaces/org/freedesktop/ModemManager1/ModemManager1.xml b/interfaces/org/freedesktop/ModemManager1/ModemManager1.xml index b51458e..8839af8 100644 --- a/interfaces/org/freedesktop/ModemManager1/ModemManager1.xml +++ b/interfaces/org/freedesktop/ModemManager1/ModemManager1.xml @@ -1,8 +1,16 @@ - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/bluez/horipad_steam/input_reader.cc b/src/bluez/horipad_steam/input_reader.cc index ed1afb6..29647e1 100644 --- a/src/bluez/horipad_steam/input_reader.cc +++ b/src/bluez/horipad_steam/input_reader.cc @@ -40,6 +40,7 @@ InputReader::~InputReader() { stop(); } +// NOLINTNEXTLINE(readability-static-accessed-through-instance) InputReader::Task InputReader::read_input() { spdlog::debug("hidraw device: {}", device_); @@ -137,7 +138,7 @@ InputReader::Task InputReader::read_input() { close(fd); stop(); - co_return; + co_return; // NOLINT(readability-static-accessed-through-instance) } std::string InputReader::dpad_to_string(const Direction dpad) { diff --git a/src/bluez/ps5_dual_sense/input_reader.cc b/src/bluez/ps5_dual_sense/input_reader.cc index bd41c32..ab0b1c7 100644 --- a/src/bluez/ps5_dual_sense/input_reader.cc +++ b/src/bluez/ps5_dual_sense/input_reader.cc @@ -41,6 +41,7 @@ InputReader::~InputReader() { stop(); } +// NOLINTNEXTLINE(readability-static-accessed-through-instance) InputReader::Task InputReader::read_input() { spdlog::debug("hidraw device: {}", device_); @@ -142,7 +143,7 @@ InputReader::Task InputReader::read_input() { close(fd); stop(); - co_return; + co_return; // NOLINT(readability-static-accessed-through-instance) } int InputReader::GetControllerMacAll(const int fd, diff --git a/src/bluez/xbox_controller/input_reader.cc b/src/bluez/xbox_controller/input_reader.cc index f27c858..6e87575 100644 --- a/src/bluez/xbox_controller/input_reader.cc +++ b/src/bluez/xbox_controller/input_reader.cc @@ -40,6 +40,7 @@ InputReader::~InputReader() { stop(); } +// NOLINTNEXTLINE(readability-static-accessed-through-instance) InputReader::Task InputReader::read_input() { spdlog::debug("hidraw device: {}", device_); @@ -133,7 +134,7 @@ InputReader::Task InputReader::read_input() { close(fd); stop(); - co_return; + co_return; // NOLINT(readability-static-accessed-through-instance) } std::string InputReader::dpad_to_string(const Direction dpad) { diff --git a/src/geoclue2/geoclue2_manager.cc b/src/geoclue2/geoclue2_manager.cc index e300d3a..26c18b5 100644 --- a/src/geoclue2/geoclue2_manager.cc +++ b/src/geoclue2/geoclue2_manager.cc @@ -16,8 +16,9 @@ #include "../utils/utils.h" -GeoClue2Manager::GeoClue2Manager(sdbus::IConnection& connection, - LocationPropertiesChangedCallback callback) +GeoClue2Manager::GeoClue2Manager( + sdbus::IConnection& connection, + const LocationPropertiesChangedCallback& callback) : ProxyInterfaces{connection, sdbus::ServiceName(kBusName), sdbus::ObjectPath(kObjectPath)}, object_path_(sdbus::ObjectPath(kObjectPath)) { diff --git a/src/geoclue2/geoclue2_manager.h b/src/geoclue2/geoclue2_manager.h index 949cfbd..276d3f4 100644 --- a/src/geoclue2/geoclue2_manager.h +++ b/src/geoclue2/geoclue2_manager.h @@ -33,7 +33,7 @@ class GeoClue2Manager final explicit GeoClue2Manager( sdbus::IConnection& connection, - LocationPropertiesChangedCallback callback = nullptr); + const LocationPropertiesChangedCallback& callback = nullptr); virtual ~GeoClue2Manager(); diff --git a/src/login1/login1_manager_client.cc b/src/login1/login1_manager_client.cc index c8ba4b3..dc09b87 100644 --- a/src/login1/login1_manager_client.cc +++ b/src/login1/login1_manager_client.cc @@ -14,8 +14,6 @@ #include "login1_manager_client.h" -#include - #include "../utils/utils.h" Login1ManagerClient::Login1ManagerClient(sdbus::IConnection& connection) @@ -25,7 +23,7 @@ Login1ManagerClient::Login1ManagerClient(sdbus::IConnection& connection) const auto props = this->GetAllAsync( Manager_proxy::INTERFACE_NAME, [&](std::optional error, - std::map values) { + const std::map& values) { if (!error) { onPropertiesChanged( sdbus::InterfaceName(Manager_proxy::INTERFACE_NAME), values, {}); @@ -60,19 +58,19 @@ Login1ManagerClient::Login1ManagerClient(sdbus::IConnection& connection) Login1ManagerClient::~Login1ManagerClient() { unregisterProxy(); - for (const auto& [objectPath, seat] : seats_) { + for (const auto& objectPath : seats_ | std::views::keys) { if (seats_.contains(objectPath)) { seats_[objectPath].reset(); seats_.erase(objectPath); } } - for (const auto& [objectPath, session] : sessions_) { + for (const auto& objectPath : sessions_ | std::views::keys) { if (sessions_.contains(objectPath)) { sessions_[objectPath].reset(); sessions_.erase(objectPath); } } - for (const auto& [objectPath, seat] : users_) { + for (const auto& objectPath : users_ | std::views::keys) { if (users_.contains(objectPath)) { users_[objectPath].reset(); users_.erase(objectPath); diff --git a/src/network1/network1_client.cc b/src/network1/network1_client.cc index 7a2860d..b466121 100644 --- a/src/network1/network1_client.cc +++ b/src/network1/network1_client.cc @@ -12,7 +12,7 @@ Network1ManagerClient::Network1ManagerClient(sdbus::IConnection& connection) this->GetAllAsync( Manager_proxy::INTERFACE_NAME, [this](std::optional error, - std::map values) { + const std::map& values) { if (error) { spdlog::warn("network1.Manager GetAllAsync failed: {} - {}", error->getName(), error->getMessage()); diff --git a/src/proxy/fi/w1/wpa_supplicant1/wpa_supplicant1_proxy.h b/src/proxy/fi/w1/wpa_supplicant1/wpa_supplicant1_proxy.h index 577da82..dd91138 100644 --- a/src/proxy/fi/w1/wpa_supplicant1/wpa_supplicant1_proxy.h +++ b/src/proxy/fi/w1/wpa_supplicant1/wpa_supplicant1_proxy.h @@ -3,28 +3,27 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_fi_w1_wpa_supplicant1_wpa_supplicant1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_fi_w1_wpa_supplicant1_wpa_supplicant1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_fi_w1_wpa_supplicant1_wpa_supplicant1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_fi_w1_wpa_supplicant1_wpa_supplicant1_proxy_h_proxy_H_ #include #include #include -namespace fi { -namespace w1 { +namespace fi::w1 { class wpa_supplicant1_proxy { public: - static constexpr const char* INTERFACE_NAME = "fi.w1.wpa_supplicant1"; - - protected: - wpa_supplicant1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "fi.w1.wpa_supplicant1"; wpa_supplicant1_proxy(const wpa_supplicant1_proxy&) = delete; wpa_supplicant1_proxy& operator=(const wpa_supplicant1_proxy&) = delete; wpa_supplicant1_proxy(wpa_supplicant1_proxy&&) = delete; wpa_supplicant1_proxy& operator=(wpa_supplicant1_proxy&&) = delete; + protected: + explicit wpa_supplicant1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~wpa_supplicant1_proxy() = default; void registerProxy() { @@ -152,7 +151,6 @@ class wpa_supplicant1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace w1 -} // namespace fi +} // namespace fi::w1 #endif diff --git a/src/proxy/org/bluez/Adapter1/adapter1_proxy.h b/src/proxy/org/bluez/Adapter1/adapter1_proxy.h index c6c56ec..c895f9e 100644 --- a/src/proxy/org/bluez/Adapter1/adapter1_proxy.h +++ b/src/proxy/org/bluez/Adapter1/adapter1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Adapter1_adapter1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Adapter1_adapter1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Adapter1_adapter1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Adapter1_adapter1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class Adapter1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Adapter1"; - - protected: - Adapter1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Adapter1"; Adapter1_proxy(const Adapter1_proxy&) = delete; Adapter1_proxy& operator=(const Adapter1_proxy&) = delete; Adapter1_proxy(Adapter1_proxy&&) = delete; Adapter1_proxy& operator=(Adapter1_proxy&&) = delete; + protected: + explicit Adapter1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Adapter1_proxy() = default; void registerProxy() {} @@ -178,7 +176,6 @@ class Adapter1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/AgentManager/agent_manager1_proxy.h b/src/proxy/org/bluez/AgentManager/agent_manager1_proxy.h index c0251dd..117af3e 100644 --- a/src/proxy/org/bluez/AgentManager/agent_manager1_proxy.h +++ b/src/proxy/org/bluez/AgentManager/agent_manager1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_AgentManager_agent_manager1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_AgentManager_agent_manager1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_AgentManager_agent_manager1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_AgentManager_agent_manager1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class AgentManager1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.AgentManager1"; - - protected: - AgentManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.AgentManager1"; AgentManager1_proxy(const AgentManager1_proxy&) = delete; AgentManager1_proxy& operator=(const AgentManager1_proxy&) = delete; AgentManager1_proxy(AgentManager1_proxy&&) = delete; AgentManager1_proxy& operator=(AgentManager1_proxy&&) = delete; + protected: + explicit AgentManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~AgentManager1_proxy() = default; void registerProxy() {} @@ -53,7 +51,6 @@ class AgentManager1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/Battery1/battery1_proxy.h b/src/proxy/org/bluez/Battery1/battery1_proxy.h index c916645..3d2bb8a 100644 --- a/src/proxy/org/bluez/Battery1/battery1_proxy.h +++ b/src/proxy/org/bluez/Battery1/battery1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Battery1_battery1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Battery1_battery1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Battery1_battery1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Battery1_battery1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class Battery1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Battery1"; - - protected: - Battery1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Battery1"; Battery1_proxy(const Battery1_proxy&) = delete; Battery1_proxy& operator=(const Battery1_proxy&) = delete; Battery1_proxy(Battery1_proxy&&) = delete; Battery1_proxy& operator=(Battery1_proxy&&) = delete; + protected: + explicit Battery1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Battery1_proxy() = default; void registerProxy() {} @@ -40,7 +38,6 @@ class Battery1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/BatteryProviderManager1/battery_provider_manager1_proxy.h b/src/proxy/org/bluez/BatteryProviderManager1/battery_provider_manager1_proxy.h index 29859cf..e279298 100644 --- a/src/proxy/org/bluez/BatteryProviderManager1/battery_provider_manager1_proxy.h +++ b/src/proxy/org/bluez/BatteryProviderManager1/battery_provider_manager1_proxy.h @@ -3,23 +3,16 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_BatteryProviderManager1_battery_provider_manager1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_BatteryProviderManager1_battery_provider_manager1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_BatteryProviderManager1_battery_provider_manager1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_BatteryProviderManager1_battery_provider_manager1_proxy_h_proxy_H_ #include -#include -#include -namespace org { -namespace bluez { +namespace org::bluez { class BatteryProviderManager1_proxy { public: - static constexpr const char* INTERFACE_NAME = - "org.bluez.BatteryProviderManager1"; - - protected: - BatteryProviderManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.BatteryProviderManager1"; BatteryProviderManager1_proxy(const BatteryProviderManager1_proxy&) = delete; BatteryProviderManager1_proxy& operator=( @@ -28,6 +21,10 @@ class BatteryProviderManager1_proxy { BatteryProviderManager1_proxy& operator=(BatteryProviderManager1_proxy&&) = delete; + protected: + explicit BatteryProviderManager1_proxy(sdbus::IProxy& proxy) + : m_proxy(proxy) {} + ~BatteryProviderManager1_proxy() = default; void registerProxy() {} @@ -49,7 +46,6 @@ class BatteryProviderManager1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/Device1/device1_proxy.h b/src/proxy/org/bluez/Device1/device1_proxy.h index 17b3d62..6c23af0 100644 --- a/src/proxy/org/bluez/Device1/device1_proxy.h +++ b/src/proxy/org/bluez/Device1/device1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Device1_device1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Device1_device1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Device1_device1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Device1_device1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class Device1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Device1"; - - protected: - Device1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Device1"; Device1_proxy(const Device1_proxy&) = delete; Device1_proxy& operator=(const Device1_proxy&) = delete; Device1_proxy(Device1_proxy&&) = delete; Device1_proxy& operator=(Device1_proxy&&) = delete; + protected: + explicit Device1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Device1_proxy() = default; void registerProxy() {} @@ -215,7 +213,6 @@ class Device1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/GattCharacteristic1/gatt_characteristic1_proxy.h b/src/proxy/org/bluez/GattCharacteristic1/gatt_characteristic1_proxy.h index 85e735c..3d4fccc 100644 --- a/src/proxy/org/bluez/GattCharacteristic1/gatt_characteristic1_proxy.h +++ b/src/proxy/org/bluez/GattCharacteristic1/gatt_characteristic1_proxy.h @@ -3,22 +3,18 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_GattCharacteristic1_gatt_characteristic1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_GattCharacteristic1_gatt_characteristic1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_GattCharacteristic1_gatt_characteristic1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_GattCharacteristic1_gatt_characteristic1_proxy_h_proxy_H_ #include #include #include -namespace org { -namespace bluez { +namespace org::bluez { class GattCharacteristic1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.GattCharacteristic1"; - - protected: - GattCharacteristic1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.GattCharacteristic1"; GattCharacteristic1_proxy(const GattCharacteristic1_proxy&) = delete; GattCharacteristic1_proxy& operator=(const GattCharacteristic1_proxy&) = @@ -26,6 +22,9 @@ class GattCharacteristic1_proxy { GattCharacteristic1_proxy(GattCharacteristic1_proxy&&) = delete; GattCharacteristic1_proxy& operator=(GattCharacteristic1_proxy&&) = delete; + protected: + explicit GattCharacteristic1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~GattCharacteristic1_proxy() = default; void registerProxy() {} @@ -123,7 +122,6 @@ class GattCharacteristic1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/GattDescriptor1/gatt_descriptor1_proxy.h b/src/proxy/org/bluez/GattDescriptor1/gatt_descriptor1_proxy.h index 86990c8..a199890 100644 --- a/src/proxy/org/bluez/GattDescriptor1/gatt_descriptor1_proxy.h +++ b/src/proxy/org/bluez/GattDescriptor1/gatt_descriptor1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_GattDescriptor1_gatt_descriptor1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_GattDescriptor1_gatt_descriptor1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_GattDescriptor1_gatt_descriptor1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_GattDescriptor1_gatt_descriptor1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class GattDescriptor1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.GattDescriptor1"; - - protected: - GattDescriptor1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.GattDescriptor1"; GattDescriptor1_proxy(const GattDescriptor1_proxy&) = delete; GattDescriptor1_proxy& operator=(const GattDescriptor1_proxy&) = delete; GattDescriptor1_proxy(GattDescriptor1_proxy&&) = delete; GattDescriptor1_proxy& operator=(GattDescriptor1_proxy&&) = delete; + protected: + explicit GattDescriptor1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~GattDescriptor1_proxy() = default; void registerProxy() {} @@ -70,7 +68,6 @@ class GattDescriptor1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/GattManager1/gatt_manager1_proxy.h b/src/proxy/org/bluez/GattManager1/gatt_manager1_proxy.h index e5fa471..5b0ab7d 100644 --- a/src/proxy/org/bluez/GattManager1/gatt_manager1_proxy.h +++ b/src/proxy/org/bluez/GattManager1/gatt_manager1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_GattManager1_gatt_manager1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_GattManager1_gatt_manager1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_GattManager1_gatt_manager1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_GattManager1_gatt_manager1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class GattManager1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.GattManager1"; - - protected: - GattManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.GattManager1"; GattManager1_proxy(const GattManager1_proxy&) = delete; GattManager1_proxy& operator=(const GattManager1_proxy&) = delete; GattManager1_proxy(GattManager1_proxy&&) = delete; GattManager1_proxy& operator=(GattManager1_proxy&&) = delete; + protected: + explicit GattManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~GattManager1_proxy() = default; void registerProxy() {} @@ -48,7 +46,6 @@ class GattManager1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/GattService1/gatt_service1_proxy.h b/src/proxy/org/bluez/GattService1/gatt_service1_proxy.h index 4a5d10b..41d5925 100644 --- a/src/proxy/org/bluez/GattService1/gatt_service1_proxy.h +++ b/src/proxy/org/bluez/GattService1/gatt_service1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_GattService1_gatt_service1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_GattService1_gatt_service1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_GattService1_gatt_service1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_GattService1_gatt_service1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class GattService1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.GattService1"; - - protected: - GattService1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.GattService1"; GattService1_proxy(const GattService1_proxy&) = delete; GattService1_proxy& operator=(const GattService1_proxy&) = delete; GattService1_proxy(GattService1_proxy&&) = delete; GattService1_proxy& operator=(GattService1_proxy&&) = delete; + protected: + explicit GattService1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~GattService1_proxy() = default; void registerProxy() {} @@ -58,7 +56,6 @@ class GattService1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/Input1/input_proxy.h b/src/proxy/org/bluez/Input1/input_proxy.h index 9d5afbd..d9623cd 100644 --- a/src/proxy/org/bluez/Input1/input_proxy.h +++ b/src/proxy/org/bluez/Input1/input_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Input1_input_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Input1_input_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Input1_input_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Input1_input_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class Input1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Input1"; - - protected: - Input1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Input1"; Input1_proxy(const Input1_proxy&) = delete; Input1_proxy& operator=(const Input1_proxy&) = delete; Input1_proxy(Input1_proxy&&) = delete; Input1_proxy& operator=(Input1_proxy&&) = delete; + protected: + explicit Input1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Input1_proxy() = default; void registerProxy() {} @@ -40,7 +38,6 @@ class Input1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/LEAdvertisingManager1/le_advertising_manager1_proxy.h b/src/proxy/org/bluez/LEAdvertisingManager1/le_advertising_manager1_proxy.h index 1079a63..5f6dcc8 100644 --- a/src/proxy/org/bluez/LEAdvertisingManager1/le_advertising_manager1_proxy.h +++ b/src/proxy/org/bluez/LEAdvertisingManager1/le_advertising_manager1_proxy.h @@ -3,23 +3,17 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_LEAdvertisingManager1_le_advertising_manager1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_LEAdvertisingManager1_le_advertising_manager1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_LEAdvertisingManager1_le_advertising_manager1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_LEAdvertisingManager1_le_advertising_manager1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class LEAdvertisingManager1_proxy { public: - static constexpr const char* INTERFACE_NAME = - "org.bluez.LEAdvertisingManager1"; - - protected: - LEAdvertisingManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.LEAdvertisingManager1"; LEAdvertisingManager1_proxy(const LEAdvertisingManager1_proxy&) = delete; LEAdvertisingManager1_proxy& operator=(const LEAdvertisingManager1_proxy&) = @@ -28,6 +22,9 @@ class LEAdvertisingManager1_proxy { LEAdvertisingManager1_proxy& operator=(LEAdvertisingManager1_proxy&&) = delete; + protected: + explicit LEAdvertisingManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~LEAdvertisingManager1_proxy() = default; void registerProxy() {} @@ -76,7 +73,6 @@ class LEAdvertisingManager1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/Media1/media1_proxy.h b/src/proxy/org/bluez/Media1/media1_proxy.h index 4a6625a..1370b16 100644 --- a/src/proxy/org/bluez/Media1/media1_proxy.h +++ b/src/proxy/org/bluez/Media1/media1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Media1_media1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Media1_media1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Media1_media1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Media1_media1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class Media1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Media1"; - - protected: - Media1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Media1"; Media1_proxy(const Media1_proxy&) = delete; Media1_proxy& operator=(const Media1_proxy&) = delete; Media1_proxy(Media1_proxy&&) = delete; Media1_proxy& operator=(Media1_proxy&&) = delete; + protected: + explicit Media1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Media1_proxy() = default; void registerProxy() {} @@ -82,7 +80,6 @@ class Media1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/NetworkServer1/network_server1_proxy.h b/src/proxy/org/bluez/NetworkServer1/network_server1_proxy.h index a900de6..9a21bab 100644 --- a/src/proxy/org/bluez/NetworkServer1/network_server1_proxy.h +++ b/src/proxy/org/bluez/NetworkServer1/network_server1_proxy.h @@ -3,28 +3,26 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_NetworkServer1_network_server1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_NetworkServer1_network_server1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_NetworkServer1_network_server1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_NetworkServer1_network_server1_proxy_h_proxy_H_ #include #include -#include -namespace org { -namespace bluez { +namespace org::bluez { class NetworkServer1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.NetworkServer1"; - - protected: - NetworkServer1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.NetworkServer1"; NetworkServer1_proxy(const NetworkServer1_proxy&) = delete; NetworkServer1_proxy& operator=(const NetworkServer1_proxy&) = delete; NetworkServer1_proxy(NetworkServer1_proxy&&) = delete; NetworkServer1_proxy& operator=(NetworkServer1_proxy&&) = delete; + protected: + explicit NetworkServer1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~NetworkServer1_proxy() = default; void registerProxy() {} @@ -46,7 +44,6 @@ class NetworkServer1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/proxy/org/bluez/Profile1/profile1_proxy.h b/src/proxy/org/bluez/Profile1/profile1_proxy.h index 3890ea8..d0a2e96 100644 --- a/src/proxy/org/bluez/Profile1/profile1_proxy.h +++ b/src/proxy/org/bluez/Profile1/profile1_proxy.h @@ -3,28 +3,27 @@ * This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT! */ -#ifndef __sdbuscpp__src_proxy_org_bluez_Profile1_profile1_proxy_h__proxy__H__ -#define __sdbuscpp__src_proxy_org_bluez_Profile1_profile1_proxy_h__proxy__H__ +#ifndef _sdbuscpp_src_proxy_org_bluez_Profile1_profile1_proxy_h_proxy_H_ +#define _sdbuscpp_src_proxy_org_bluez_Profile1_profile1_proxy_h_proxy_H_ #include #include #include -namespace org { -namespace bluez { +namespace org::bluez { class Profile1_proxy { public: - static constexpr const char* INTERFACE_NAME = "org.bluez.Profile1"; - - protected: - Profile1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + static constexpr auto INTERFACE_NAME = "org.bluez.Profile1"; Profile1_proxy(const Profile1_proxy&) = delete; Profile1_proxy& operator=(const Profile1_proxy&) = delete; Profile1_proxy(Profile1_proxy&&) = delete; Profile1_proxy& operator=(Profile1_proxy&&) = delete; + protected: + explicit Profile1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + ~Profile1_proxy() = default; void registerProxy() {} @@ -53,7 +52,6 @@ class Profile1_proxy { sdbus::IProxy& m_proxy; }; -} // namespace bluez -} // namespace org +} // namespace org::bluez #endif diff --git a/src/systemd1/systemd1_manager_client.cc b/src/systemd1/systemd1_manager_client.cc index 4334627..730d9fd 100644 --- a/src/systemd1/systemd1_manager_client.cc +++ b/src/systemd1/systemd1_manager_client.cc @@ -13,7 +13,7 @@ Systemd1ManagerClient::Systemd1ManagerClient(sdbus::IConnection& connection) this->GetAllAsync( org::freedesktop::systemd1::Manager_proxy::INTERFACE_NAME, [](std::optional error, - std::map values) { + const std::map& values) { if (error) { spdlog::warn("systemd1.Manager GetAllAsync failed: {} - {}", error->getName(), error->getMessage()); diff --git a/src/utils/utils.cc b/src/utils/utils.cc index c523e8e..ce26f4d 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -488,14 +488,14 @@ std::string Utils::scalarToString(const glz::generic& val) { return "[complex]"; } -// NOLINTNEXTLINE(clang-tidy) +// NOLINTNEXTLINE(misc-no-recursion) // recursive JSON traversal by design std::string Utils::elementToLines(const glz::generic& el, const int indent) { std::string out; const std::string pad(indent * 2, ' '); if (el.is_object()) { - const auto& obj = el.get(); - for (const auto& [key, val] : obj) { + for (const auto& obj = el.get(); + const auto& [key, val] : obj) { if (val.is_object() || val.is_array()) { out += pad + key + ":\n"; out += elementToLines(val, indent + 1); @@ -532,8 +532,7 @@ std::string Utils::parseDescriptionJson(const std::string& json) { } glz::generic doc; - auto ec = glz::read_json(doc, json); - if (ec) { + if (const auto ec = glz::read_json(doc, json)) { return std::string("json_error: ") + glz::format_error(ec, json); } diff --git a/src/wpa_supplicant/wpa_supplicant1_client.cc b/src/wpa_supplicant/wpa_supplicant1_client.cc index 0806654..508703d 100644 --- a/src/wpa_supplicant/wpa_supplicant1_client.cc +++ b/src/wpa_supplicant/wpa_supplicant1_client.cc @@ -12,7 +12,7 @@ WpaSupplicant1Client::WpaSupplicant1Client(sdbus::IConnection& connection) this->GetAllAsync( wpa_supplicant1_proxy::INTERFACE_NAME, [](std::optional error, - std::map values) { + const std::map& values) { if (error) { spdlog::warn("wpa_supplicant1 GetAllAsync failed: {} - {}", error->getName(), error->getMessage());