clang-tidy: run performance-unnecessary-value-param
This commit is contained in:
parent
af0c267d96
commit
fe17d79e8d
|
@ -507,12 +507,12 @@ RuntimeBlockInfo::~RuntimeBlockInfo()
|
|||
}
|
||||
}
|
||||
|
||||
void RuntimeBlockInfo::AddRef(RuntimeBlockInfoPtr other)
|
||||
void RuntimeBlockInfo::AddRef(const RuntimeBlockInfoPtr& other)
|
||||
{
|
||||
pre_refs.push_back(other);
|
||||
}
|
||||
|
||||
void RuntimeBlockInfo::RemRef(RuntimeBlockInfoPtr other)
|
||||
void RuntimeBlockInfo::RemRef(const RuntimeBlockInfoPtr& other)
|
||||
{
|
||||
bm_List::iterator it = std::find(pre_refs.begin(), pre_refs.end(), other);
|
||||
if (it != pre_refs.end())
|
||||
|
|
|
@ -68,8 +68,8 @@ struct RuntimeBlockInfo: RuntimeBlockInfo_Core
|
|||
//predecessors references
|
||||
std::vector<RuntimeBlockInfoPtr> pre_refs;
|
||||
|
||||
void AddRef(RuntimeBlockInfoPtr other);
|
||||
void RemRef(RuntimeBlockInfoPtr other);
|
||||
void AddRef(const RuntimeBlockInfoPtr& other);
|
||||
void RemRef(const RuntimeBlockInfoPtr& other);
|
||||
|
||||
void Discard();
|
||||
void SetProtectedFlags();
|
||||
|
|
|
@ -406,7 +406,7 @@ static FILE *get_record_input(bool write)
|
|||
}
|
||||
#endif
|
||||
|
||||
void GamepadDevice::Register(std::shared_ptr<GamepadDevice> gamepad)
|
||||
void GamepadDevice::Register(const std::shared_ptr<GamepadDevice>& gamepad)
|
||||
{
|
||||
int maple_port = cfgLoadInt("input",
|
||||
MAPLE_PORT_CFG_PREFIX + gamepad->unique_id(), 12345);
|
||||
|
@ -425,7 +425,7 @@ void GamepadDevice::Register(std::shared_ptr<GamepadDevice> gamepad)
|
|||
_gamepads_mutex.unlock();
|
||||
}
|
||||
|
||||
void GamepadDevice::Unregister(std::shared_ptr<GamepadDevice> gamepad)
|
||||
void GamepadDevice::Unregister(const std::shared_ptr<GamepadDevice>& gamepad)
|
||||
{
|
||||
gamepad->save_mapping();
|
||||
_gamepads_mutex.lock();
|
||||
|
|
|
@ -57,9 +57,9 @@ public:
|
|||
virtual void update_rumble() {}
|
||||
bool is_rumble_enabled() { return _rumble_enabled; }
|
||||
|
||||
static void Register(std::shared_ptr<GamepadDevice> gamepad);
|
||||
static void Register(const std::shared_ptr<GamepadDevice>& gamepad);
|
||||
|
||||
static void Unregister(std::shared_ptr<GamepadDevice> gamepad);
|
||||
static void Unregister(const std::shared_ptr<GamepadDevice>& gamepad);
|
||||
|
||||
static int GetGamepadCount();
|
||||
static std::shared_ptr<GamepadDevice> GetGamepad(int index);
|
||||
|
|
|
@ -284,7 +284,7 @@ bool InputMapping::save(const char *name)
|
|||
return true;
|
||||
}
|
||||
|
||||
void InputMapping::SaveMapping(const char *name, std::shared_ptr<InputMapping> mapping)
|
||||
void InputMapping::SaveMapping(const char *name, const std::shared_ptr<InputMapping>& mapping)
|
||||
{
|
||||
mapping->save(name);
|
||||
InputMapping::loaded_mappings[name] = mapping;
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
bool is_dirty() { return dirty; }
|
||||
|
||||
static std::shared_ptr<InputMapping> LoadMapping(const char *name);
|
||||
static void SaveMapping(const char *name, std::shared_ptr<InputMapping> mapping);
|
||||
static void SaveMapping(const char *name, const std::shared_ptr<InputMapping>& mapping);
|
||||
|
||||
protected:
|
||||
bool dirty = false;
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
class iterator
|
||||
{
|
||||
private:
|
||||
iterator(DIR *dir, std::string pathname) {
|
||||
iterator(DIR *dir, const std::string& pathname) {
|
||||
if (dir != nullptr)
|
||||
{
|
||||
dirs.push_back(dir);
|
||||
|
|
|
@ -634,7 +634,7 @@ static void detect_input_popup(int index, bool analog)
|
|||
ImGui::PopStyleVar(2);
|
||||
}
|
||||
|
||||
static void controller_mapping_popup(std::shared_ptr<GamepadDevice> gamepad)
|
||||
static void controller_mapping_popup(const std::shared_ptr<GamepadDevice>& gamepad)
|
||||
{
|
||||
ImGui::SetNextWindowPos(ImVec2(0, 0));
|
||||
ImGui::SetNextWindowSize(ImVec2(screen_width, screen_height));
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "utils.h"
|
||||
#include "vulkan_context.h"
|
||||
|
||||
BufferData::BufferData(vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags propertyFlags)
|
||||
BufferData::BufferData(vk::DeviceSize size, const vk::BufferUsageFlags& usage, const vk::MemoryPropertyFlags& propertyFlags)
|
||||
: bufferSize(size), m_usage(usage), m_propertyFlags(propertyFlags)
|
||||
{
|
||||
VulkanContext *context = VulkanContext::Instance();
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
struct BufferData
|
||||
{
|
||||
BufferData(vk::DeviceSize size, vk::BufferUsageFlags usage,
|
||||
vk::MemoryPropertyFlags propertyFlags = vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent);
|
||||
BufferData(vk::DeviceSize size, const vk::BufferUsageFlags& usage,
|
||||
const vk::MemoryPropertyFlags& propertyFlags = vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent);
|
||||
~BufferData()
|
||||
{
|
||||
buffer.reset();
|
||||
|
|
|
@ -226,8 +226,8 @@ void Texture::Init(u32 width, u32 height, vk::Format format, u32 dataSize, bool
|
|||
CreateImage(imageTiling, usageFlags, initialLayout, vk::ImageAspectFlagBits::eColor);
|
||||
}
|
||||
|
||||
void Texture::CreateImage(vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::ImageLayout initialLayout,
|
||||
vk::ImageAspectFlags aspectMask)
|
||||
void Texture::CreateImage(vk::ImageTiling tiling, const vk::ImageUsageFlags& usage, vk::ImageLayout initialLayout,
|
||||
const vk::ImageAspectFlags& aspectMask)
|
||||
{
|
||||
vk::ImageCreateInfo imageCreateInfo(vk::ImageCreateFlags(), vk::ImageType::e2D, format, vk::Extent3D(extent, 1), mipmapLevels, 1,
|
||||
vk::SampleCountFlagBits::e1, tiling, usage,
|
||||
|
@ -393,7 +393,7 @@ void Texture::GenerateMipmaps()
|
|||
commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTransfer, vk::PipelineStageFlagBits::eFragmentShader, {}, nullptr, nullptr, barrier);
|
||||
}
|
||||
|
||||
void FramebufferAttachment::Init(u32 width, u32 height, vk::Format format, vk::ImageUsageFlags usage)
|
||||
void FramebufferAttachment::Init(u32 width, u32 height, vk::Format format, const vk::ImageUsageFlags& usage)
|
||||
{
|
||||
this->format = format;
|
||||
this->extent = vk::Extent2D { width, height };
|
||||
|
|
|
@ -51,8 +51,8 @@ public:
|
|||
private:
|
||||
void Init(u32 width, u32 height, vk::Format format ,u32 dataSize, bool mipmapped, bool mipmapsIncluded);
|
||||
void SetImage(u32 size, void *data, bool isNew, bool genMipmaps);
|
||||
void CreateImage(vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::ImageLayout initialLayout,
|
||||
vk::ImageAspectFlags aspectMask);
|
||||
void CreateImage(vk::ImageTiling tiling, const vk::ImageUsageFlags& usage, vk::ImageLayout initialLayout,
|
||||
const vk::ImageAspectFlags& aspectMask);
|
||||
void GenerateMipmaps();
|
||||
|
||||
vk::Format format = vk::Format::eUndefined;
|
||||
|
@ -111,7 +111,7 @@ public:
|
|||
FramebufferAttachment(vk::PhysicalDevice physicalDevice, vk::Device device)
|
||||
: format(vk::Format::eUndefined), physicalDevice(physicalDevice), device(device)
|
||||
{}
|
||||
void Init(u32 width, u32 height, vk::Format format, vk::ImageUsageFlags usage);
|
||||
void Init(u32 width, u32 height, vk::Format format, const vk::ImageUsageFlags& usage);
|
||||
void Reset() { image.reset(); imageView.reset(); }
|
||||
|
||||
vk::ImageView GetImageView() const { return *imageView; }
|
||||
|
|
|
@ -60,7 +60,7 @@ static inline vk::BlendFactor getBlendFactor(u32 instr, bool src)
|
|||
}
|
||||
}
|
||||
|
||||
static inline u32 findMemoryType(vk::PhysicalDeviceMemoryProperties const& memoryProperties, u32 typeBits, vk::MemoryPropertyFlags requirementsMask)
|
||||
static inline u32 findMemoryType(vk::PhysicalDeviceMemoryProperties const& memoryProperties, u32 typeBits, const vk::MemoryPropertyFlags& requirementsMask)
|
||||
{
|
||||
u32 typeIndex = u32(~0);
|
||||
for (u32 i = 0; i < memoryProperties.memoryTypeCount; i++)
|
||||
|
|
Loading…
Reference in New Issue