static analysis: more const ref

This commit is contained in:
Megamouse 2025-03-04 19:39:25 +01:00
parent 279711a3ab
commit 297849c12b
7 changed files with 7 additions and 7 deletions

View file

@ -104,7 +104,7 @@ std::vector<audio_device_enumerator::audio_device> cubeb_enumerator::get_output_
cubeb_dev_enum.error("cubeb_device_collection_destroy() failed: %i", err);
}
std::sort(device_list.begin(), device_list.end(), [](audio_device_enumerator::audio_device a, audio_device_enumerator::audio_device b)
std::sort(device_list.begin(), device_list.end(), [](const audio_device_enumerator::audio_device& a, const audio_device_enumerator::audio_device& b)
{
return a.name < b.name;
});

View file

@ -144,7 +144,7 @@ std::vector<audio_device_enumerator::audio_device> xaudio2_enumerator::get_outpu
device_list.emplace_back(dev);
}
std::sort(device_list.begin(), device_list.end(), [](audio_device_enumerator::audio_device a, audio_device_enumerator::audio_device b)
std::sort(device_list.begin(), device_list.end(), [](const audio_device_enumerator::audio_device& a, const audio_device_enumerator::audio_device& b)
{
return a.name < b.name;
});

View file

@ -217,7 +217,7 @@ u32 dimensions_toypad::scramble(const std::array<u8, 7>& uid, u8 count)
return read_from_ptr<be_t<u32>>(dimensions_randomize(to_scramble, count).data());
}
std::array<u8, 4> dimensions_toypad::dimensions_randomize(const std::vector<u8> key, u8 count)
std::array<u8, 4> dimensions_toypad::dimensions_randomize(const std::vector<u8>& key, u8 count)
{
u32 scrambled = 0;
for (u8 i = 0; i < count; i++)

View file

@ -49,7 +49,7 @@ private:
static std::array<u8, 16> generate_figure_key(const std::array<u8, 0x2D * 0x04>& buf);
static u32 scramble(const std::array<u8, 7>& uid, u8 count);
static std::array<u8, 4> pwd_generate(const std::array<u8, 7>& uid);
static std::array<u8, 4> dimensions_randomize(const std::vector<u8> key, u8 count);
static std::array<u8, 4> dimensions_randomize(const std::vector<u8>& key, u8 count);
static u32 get_figure_id(const std::array<u8, 0x2D * 0x04>& buf);
u32 get_next();
dimensions_figure& get_figure_by_index(u8 index);

View file

@ -307,7 +307,7 @@ public:
};
std::vector<pad_ensemble>& bindings() { return m_bindings; }
std::string name_string() const { return m_name_string; }
const std::string& name_string() const { return m_name_string; }
usz max_devices() const { return m_max_devices; }
bool has_config() const { return b_has_config; }
bool has_rumble() const { return b_has_rumble; }

View file

@ -75,7 +75,7 @@ namespace vk
return attachments.back()->image()->format();
}
bool matches(std::vector<vk::image*> fbo_images, u32 width, u32 height)
bool matches(const std::vector<vk::image*>& fbo_images, u32 width, u32 height)
{
if (m_width != width || m_height != height)
return false;

View file

@ -204,7 +204,7 @@ namespace rsx
return result;
}
static inline u32 encode_color_to_storage_key(color4f color)
static inline u32 encode_color_to_storage_key(const color4f& color)
{
const u32 r = static_cast<u8>(color.r * 255);
const u32 g = static_cast<u8>(color.g * 255);