turnip: Fix 'unused' warnings

Now turnip builds without warnings on my machine.
This commit is contained in:
Chad Versace 2018-11-12 14:42:36 -08:00 committed by Chia-I Wu
parent 471f2d8409
commit bf709dfe3f
4 changed files with 26 additions and 9 deletions

View file

@ -67,7 +67,7 @@ const struct tu_dynamic_state default_dynamic_state = {
},
};
static void
static void UNUSED /* FINISHME */
tu_bind_dynamic_state(struct tu_cmd_buffer *cmd_buffer,
const struct tu_dynamic_state *src)
{
@ -75,6 +75,8 @@ tu_bind_dynamic_state(struct tu_cmd_buffer *cmd_buffer,
uint32_t copy_mask = src->mask;
uint32_t dest_mask = 0;
tu_use_args(cmd_buffer); /* FINISHME */
/* Make sure to copy the number of viewports/scissors because they can
* only be specified at pipeline creation time.
*/

View file

@ -101,6 +101,7 @@ tu_CreateDescriptorSetLayout(
/* We just allocate all the samplers at the end of the struct */
uint32_t *samplers = (uint32_t *)&set_layout->binding[max_binding + 1];
(void) samplers; /* TODO: Use me */
VkDescriptorSetLayoutBinding *bindings =
create_sorted_bindings(pCreateInfo->pBindings, pCreateInfo->bindingCount);
@ -402,8 +403,8 @@ tu_CreateDescriptorPool(VkDevice _device,
VkDescriptorPool *pDescriptorPool)
{
TU_FROM_HANDLE(tu_device, device, _device);
struct tu_descriptor_pool *pool;
tu_use_args(device);
tu_stub();
return VK_SUCCESS;
}
@ -422,6 +423,8 @@ tu_ResetDescriptorPool(VkDevice _device,
TU_FROM_HANDLE(tu_device, device, _device);
TU_FROM_HANDLE(tu_descriptor_pool, pool, descriptorPool);
tu_use_args(device, pool);
tu_stub();
return VK_SUCCESS;
}
@ -433,6 +436,8 @@ tu_AllocateDescriptorSets(VkDevice _device,
TU_FROM_HANDLE(tu_device, device, _device);
TU_FROM_HANDLE(tu_descriptor_pool, pool, pAllocateInfo->descriptorPool);
tu_use_args(device, pool);
tu_stub();
return VK_SUCCESS;
}
@ -445,6 +450,8 @@ tu_FreeDescriptorSets(VkDevice _device,
TU_FROM_HANDLE(tu_device, device, _device);
TU_FROM_HANDLE(tu_descriptor_pool, pool, descriptorPool);
tu_use_args(device, pool);
tu_stub();
return VK_SUCCESS;
}
@ -492,7 +499,6 @@ tu_CreateDescriptorUpdateTemplate(
sizeof(struct tu_descriptor_update_template) +
sizeof(struct tu_descriptor_update_template_entry) * entry_count;
struct tu_descriptor_update_template *templ;
uint32_t i;
templ = vk_alloc2(
&device->alloc, pAllocator, size, 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
@ -500,6 +506,9 @@ tu_CreateDescriptorUpdateTemplate(
return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
*pDescriptorUpdateTemplate = tu_descriptor_update_template_to_handle(templ);
tu_use_args(set_layout);
tu_stub();
return VK_SUCCESS;
}
@ -529,6 +538,7 @@ tu_update_descriptor_set_with_template(
{
TU_FROM_HANDLE(
tu_descriptor_update_template, templ, descriptorUpdateTemplate);
tu_use_args(templ);
}
void

View file

@ -65,7 +65,8 @@ tu_get_driver_uuid(void *uuid)
static void
tu_get_device_uuid(void *uuid)
{
stub();
tu_use_args(uuid);
tu_stub();
}
VkResult
@ -1459,7 +1460,7 @@ tu_GetImageSparseMemoryRequirements(
uint32_t *pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements *pSparseMemoryRequirements)
{
stub();
tu_stub();
}
void
@ -1469,7 +1470,7 @@ tu_GetImageSparseMemoryRequirements2(
uint32_t *pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements2KHR *pSparseMemoryRequirements)
{
stub();
tu_stub();
}
void

View file

@ -258,13 +258,17 @@ tu_logi_v(const char *format, va_list va);
#define tu_assert(x)
#endif
#define stub_return(v) \
/* Suppress -Wunused in stub functions */
#define tu_use_args(...) __tu_use_args(0, ##__VA_ARGS__)
static inline void __tu_use_args(int ignore, ...) {}
#define tu_stub_return(v) \
do { \
tu_finishme("stub %s", __func__); \
return (v); \
} while (0)
#define stub() \
#define tu_stub() \
do { \
tu_finishme("stub %s", __func__); \
return; \