Skip to content

Commit 5223508

Browse files
refactor: sonar fixes
1 parent 2809b51 commit 5223508

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/platform/linux/uhid_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ namespace lvh::detail {
10791079
return status;
10801080
}
10811081

1082-
std::vector<int> buttons {BTN_TOUCH, BTN_STYLUS, BTN_STYLUS2, BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_BRUSH, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH};
1082+
std::vector buttons {BTN_TOUCH, BTN_STYLUS, BTN_STYLUS2, BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_BRUSH, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH};
10831083
#if defined(BTN_STYLUS3)
10841084
buttons.push_back(BTN_STYLUS3);
10851085
#endif

src/shared/playstation_feature_reports.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
// standard includes
8+
#include <array>
89
#include <cstdint>
910

1011
namespace lvh::detail::playstation_feature_reports {
@@ -18,7 +19,7 @@ namespace lvh::detail::playstation_feature_reports {
1819
inline constexpr std::uint8_t dualsense_pairing_report = 0x09;
1920
inline constexpr std::uint8_t dualsense_firmware_report = 0x20;
2021

21-
inline constexpr std::uint8_t dualshock4_usb_calibration_info[] {
22+
inline constexpr std::array<std::uint8_t, 37> dualshock4_usb_calibration_info {
2223
0x02,
2324
0x00,
2425
0x00,
@@ -58,7 +59,7 @@ namespace lvh::detail::playstation_feature_reports {
5859
0x00,
5960
};
6061

61-
inline constexpr std::uint8_t dualshock4_bluetooth_calibration_info[] {
62+
inline constexpr std::array<std::uint8_t, 41> dualshock4_bluetooth_calibration_info {
6263
0x05,
6364
0x00,
6465
0x00,
@@ -102,7 +103,7 @@ namespace lvh::detail::playstation_feature_reports {
102103
0x00,
103104
};
104105

105-
inline constexpr std::uint8_t dualshock4_firmware_info[] {
106+
inline constexpr std::array<std::uint8_t, 49> dualshock4_firmware_info {
106107
0xA3,
107108
0x41,
108109
0x75,
@@ -154,7 +155,7 @@ namespace lvh::detail::playstation_feature_reports {
154155
0x00,
155156
};
156157

157-
inline constexpr std::uint8_t dualshock4_pairing_info[] {
158+
inline constexpr std::array<std::uint8_t, 16> dualshock4_pairing_info {
158159
0x12,
159160
0x00,
160161
0x00,
@@ -173,7 +174,7 @@ namespace lvh::detail::playstation_feature_reports {
173174
0x00,
174175
};
175176

176-
inline constexpr std::uint8_t dualsense_calibration_info[] {
177+
inline constexpr std::array<std::uint8_t, 41> dualsense_calibration_info {
177178
0x05,
178179
0x00,
179180
0x00,
@@ -217,7 +218,7 @@ namespace lvh::detail::playstation_feature_reports {
217218
0x00,
218219
};
219220

220-
inline constexpr std::uint8_t dualsense_firmware_info[] {
221+
inline constexpr std::array<std::uint8_t, 64> dualsense_firmware_info {
221222
0x20,
222223
0x4A,
223224
0x75,
@@ -284,7 +285,7 @@ namespace lvh::detail::playstation_feature_reports {
284285
0x00,
285286
};
286287

287-
inline constexpr std::uint8_t dualsense_pairing_info[] {
288+
inline constexpr std::array<std::uint8_t, 20> dualsense_pairing_info {
288289
0x09,
289290
0x74,
290291
0xE7,

0 commit comments

Comments
 (0)