mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-02-19 16:54:18 +01:00
cleaned up static analysis findings
This commit is contained in:
parent
922c6ff139
commit
8a62c66768
@ -11,7 +11,7 @@ uint32_t divRoundUp(uint32_t n, uint32_t d)
|
||||
//move bits to offset, mask rest to 0
|
||||
uint32_t moveBits(uint32_t d, uint32_t bits, uint32_t offset)
|
||||
{
|
||||
return (d << offset) & (~(~0 << bits) << offset);
|
||||
return (d << offset) & (~(~0u << bits) << offset);
|
||||
}
|
||||
|
||||
uint32_t clHasEnoughSpace(ControlList* cl, uint32_t size)
|
||||
|
@ -60,6 +60,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateCommandPool)(
|
||||
void* pamem = ALLOCATE(numCommandBufs * sizeof(_commandBuffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!pamem)
|
||||
{
|
||||
FREE(cp);
|
||||
PROFILEEND(RPIFUNC(vkCreateCommandPool));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
@ -68,6 +69,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateCommandPool)(
|
||||
void* cpamem = ALLOCATE(consecutivePoolSize, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!cpamem)
|
||||
{
|
||||
FREE(cp);
|
||||
PROFILEEND(RPIFUNC(vkCreateCommandPool));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
@ -259,6 +259,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorSetLayout)(
|
||||
|
||||
if(!dsl->bindings)
|
||||
{
|
||||
FREE(dsl);
|
||||
PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
@ -567,6 +567,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineLayout)(
|
||||
pl->setLayouts = ALLOCATE(sizeof(VkDescriptorSetLayout)*pCreateInfo->setLayoutCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!pl->setLayouts)
|
||||
{
|
||||
FREE(pl);
|
||||
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
@ -579,6 +580,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineLayout)(
|
||||
pl->pushConstantRanges = ALLOCATE(sizeof(VkPushConstantRange)*pCreateInfo->pushConstantRangeCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!pl->pushConstantRanges)
|
||||
{
|
||||
FREE(pl);
|
||||
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
@ -524,6 +524,7 @@ VkResult RPIFUNC(vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreate
|
||||
|
||||
if(!fb->attachmentViews)
|
||||
{
|
||||
FREE(fb);
|
||||
PROFILEEND(RPIFUNC(vkCreateFramebuffer));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
@ -279,6 +279,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateImage)(
|
||||
i->queueFamiliesWithAccess = ALLOCATE(sizeof(uint32_t) * i->numQueueFamiliesWithAccess, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!i->queueFamiliesWithAccess)
|
||||
{
|
||||
FREE(i)
|
||||
PROFILEEND(RPIFUNC(vkCreateImage));
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user