diff --git a/core/hw/sh4/dyna/blockmanager.cpp b/core/hw/sh4/dyna/blockmanager.cpp index fa639094e..47d91af51 100644 --- a/core/hw/sh4/dyna/blockmanager.cpp +++ b/core/hw/sh4/dyna/blockmanager.cpp @@ -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()) diff --git a/core/hw/sh4/dyna/blockmanager.h b/core/hw/sh4/dyna/blockmanager.h index c6d2823c3..b7d1c537f 100644 --- a/core/hw/sh4/dyna/blockmanager.h +++ b/core/hw/sh4/dyna/blockmanager.h @@ -68,8 +68,8 @@ struct RuntimeBlockInfo: RuntimeBlockInfo_Core //predecessors references std::vector pre_refs; - void AddRef(RuntimeBlockInfoPtr other); - void RemRef(RuntimeBlockInfoPtr other); + void AddRef(const RuntimeBlockInfoPtr& other); + void RemRef(const RuntimeBlockInfoPtr& other); void Discard(); void SetProtectedFlags(); diff --git a/core/input/gamepad_device.cpp b/core/input/gamepad_device.cpp index 972c52bc4..6df514507 100644 --- a/core/input/gamepad_device.cpp +++ b/core/input/gamepad_device.cpp @@ -406,7 +406,7 @@ static FILE *get_record_input(bool write) } #endif -void GamepadDevice::Register(std::shared_ptr gamepad) +void GamepadDevice::Register(const std::shared_ptr& gamepad) { int maple_port = cfgLoadInt("input", MAPLE_PORT_CFG_PREFIX + gamepad->unique_id(), 12345); @@ -425,7 +425,7 @@ void GamepadDevice::Register(std::shared_ptr gamepad) _gamepads_mutex.unlock(); } -void GamepadDevice::Unregister(std::shared_ptr gamepad) +void GamepadDevice::Unregister(const std::shared_ptr& gamepad) { gamepad->save_mapping(); _gamepads_mutex.lock(); diff --git a/core/input/gamepad_device.h b/core/input/gamepad_device.h index 9ff9b885a..5b225137b 100644 --- a/core/input/gamepad_device.h +++ b/core/input/gamepad_device.h @@ -57,9 +57,9 @@ public: virtual void update_rumble() {} bool is_rumble_enabled() { return _rumble_enabled; } - static void Register(std::shared_ptr gamepad); + static void Register(const std::shared_ptr& gamepad); - static void Unregister(std::shared_ptr gamepad); + static void Unregister(const std::shared_ptr& gamepad); static int GetGamepadCount(); static std::shared_ptr GetGamepad(int index); diff --git a/core/input/mapping.cpp b/core/input/mapping.cpp index de37282e2..07bae18e7 100644 --- a/core/input/mapping.cpp +++ b/core/input/mapping.cpp @@ -284,7 +284,7 @@ bool InputMapping::save(const char *name) return true; } -void InputMapping::SaveMapping(const char *name, std::shared_ptr mapping) +void InputMapping::SaveMapping(const char *name, const std::shared_ptr& mapping) { mapping->save(name); InputMapping::loaded_mappings[name] = mapping; diff --git a/core/input/mapping.h b/core/input/mapping.h index c68579ab7..95fd773e5 100644 --- a/core/input/mapping.h +++ b/core/input/mapping.h @@ -80,7 +80,7 @@ public: bool is_dirty() { return dirty; } static std::shared_ptr LoadMapping(const char *name); - static void SaveMapping(const char *name, std::shared_ptr mapping); + static void SaveMapping(const char *name, const std::shared_ptr& mapping); protected: bool dirty = false; diff --git a/core/oslib/directory.h b/core/oslib/directory.h index 693b95636..d21870fd1 100644 --- a/core/oslib/directory.h +++ b/core/oslib/directory.h @@ -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); diff --git a/core/rend/gui.cpp b/core/rend/gui.cpp index a9969855c..809370c9d 100644 --- a/core/rend/gui.cpp +++ b/core/rend/gui.cpp @@ -634,7 +634,7 @@ static void detect_input_popup(int index, bool analog) ImGui::PopStyleVar(2); } -static void controller_mapping_popup(std::shared_ptr gamepad) +static void controller_mapping_popup(const std::shared_ptr& gamepad) { ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImVec2(screen_width, screen_height)); diff --git a/core/rend/vulkan/buffer.cpp b/core/rend/vulkan/buffer.cpp index 70e96421d..19acf3b9f 100644 --- a/core/rend/vulkan/buffer.cpp +++ b/core/rend/vulkan/buffer.cpp @@ -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(); diff --git a/core/rend/vulkan/buffer.h b/core/rend/vulkan/buffer.h index f0fbdd5ad..8c3c64dfd 100644 --- a/core/rend/vulkan/buffer.h +++ b/core/rend/vulkan/buffer.h @@ -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(); diff --git a/core/rend/vulkan/texture.cpp b/core/rend/vulkan/texture.cpp index 671071a3c..83eb4c5d8 100644 --- a/core/rend/vulkan/texture.cpp +++ b/core/rend/vulkan/texture.cpp @@ -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 }; diff --git a/core/rend/vulkan/texture.h b/core/rend/vulkan/texture.h index b3511d78a..8fc875baa 100644 --- a/core/rend/vulkan/texture.h +++ b/core/rend/vulkan/texture.h @@ -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; } diff --git a/core/rend/vulkan/utils.h b/core/rend/vulkan/utils.h index 0caa16178..fe83eb52a 100644 --- a/core/rend/vulkan/utils.h +++ b/core/rend/vulkan/utils.h @@ -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++)