initial round of code cleanup

This commit is contained in:
PancakeTAS 2025-07-10 16:33:42 +02:00
parent 071980abec
commit 92ca8827db
No known key found for this signature in database
4 changed files with 6 additions and 4 deletions

View file

@ -53,7 +53,7 @@ namespace {
return hash;
}
int on_resource(void* data, const peparse::resource& res) { // NOLINT
int on_resource(void*, const peparse::resource& res) { // NOLINT
if (res.type != peparse::RT_RCDATA || res.buf == nullptr || res.buf->bufLen <= 0)
return 0;
std::vector<uint8_t> resource_data(res.buf->bufLen);
@ -66,7 +66,7 @@ namespace {
}
void Extract::extractShaders() {
if (shaderData.size() > 0)
if (!shaderData.empty())
return;
// find path to dll (absolutely beautiful code)

View file

@ -154,7 +154,7 @@ namespace {
return VK_ERROR_INITIALIZATION_FAILED;
}
next_vkGetDeviceProcAddr = layerDesc->u.pLayerInfo->pfnNextGetDeviceProcAddr;;
next_vkGetDeviceProcAddr = layerDesc->u.pLayerInfo->pfnNextGetDeviceProcAddr;
Log::debug("layer", "Next device proc addr: {:x}",
reinterpret_cast<uintptr_t>(next_vkGetDeviceProcAddr));

View file

@ -18,6 +18,8 @@ CommandBuffer::CommandBuffer(VkDevice device, const CommandPool& pool) {
if (res != VK_SUCCESS || commandBufferHandle == VK_NULL_HANDLE)
throw LSFG::vulkan_error(res, "Unable to allocate command buffer");
res = Layer::ovkSetDeviceLoaderData(device, commandBufferHandle);
if (res != VK_SUCCESS)
throw LSFG::vulkan_error(res, "Unable to set device loader data for command buffer");
// store command buffer in shared ptr
this->state = std::make_shared<CommandBufferState>(CommandBufferState::Empty);

View file

@ -58,7 +58,7 @@ std::vector<const char*> Utils::addExtensions(const char* const* extensions, siz
for (const auto& e : requiredExtensions) {
auto it = std::ranges::find_if(ext,
[e](const char* extName) {
return std::strcmp(extName, e) == 0;
return std::string(extName) == std::string(e);
});
if (it == ext.end()) {
Log::debug("hooks-init", "Adding extension: {}", e);