From 5f4c27a7b0ebce954f316febcc4565100221df12 Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Tue, 14 Jul 2015 13:34:05 -0600 Subject: Clean up warnings from release build --- demos/cube.c | 1 - demos/tri.c | 4 +++- loader/loader.c | 17 ++++++++++------- vk_helper.py | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index 29d6c65d..17f46dca 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1220,7 +1220,6 @@ void demo_prepare_cube_data_buffer(struct demo *demo) .memoryTypeIndex = 0, }; VkMemoryRequirements mem_reqs; - size_t mem_reqs_size = sizeof(VkMemoryRequirements); uint8_t *pData; int i; mat4x4 MVP, VP; diff --git a/demos/tri.c b/demos/tri.c index 7ef86ffd..8d40bc4d 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1103,6 +1103,7 @@ char *demo_read_spv(const char *filename, size_t *psize) { long int size; void *shader_code; + size_t retVal; FILE *fp = fopen(filename, "rb"); if (!fp) return NULL; @@ -1113,7 +1114,8 @@ char *demo_read_spv(const char *filename, size_t *psize) fseek(fp, 0L, SEEK_SET); shader_code = malloc(size); - fread(shader_code, size, 1, fp); + retVal = fread(shader_code, size, 1, fp); + if (!retVal) return NULL; *psize = size; diff --git a/loader/loader.c b/loader/loader.c index f89db4a8..f70830e1 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1042,6 +1042,7 @@ static void loader_physical_device_extensions( uint32_t *count, struct loader_extension_list **list) { + *count = 0; if (layer_name == NULL || (strlen(layer_name) == 0)) { *count = icd->device_extension_cache[gpu_idx].count; *list = &icd->device_extension_cache[gpu_idx]; @@ -1827,6 +1828,7 @@ static PFN_vkVoidFunction VKAPI loader_gpa_instance_internal(VkInstance inst, co struct loader_icd * loader_get_icd(const VkPhysicalDevice gpu, uint32_t *gpu_index) { + *gpu_index = 0; for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) { for (struct loader_icd *icd = inst->icds; icd; icd = icd->next) { for (uint32_t i = 0; i < icd->gpu_count; i++) @@ -1896,7 +1898,7 @@ static void loader_remove_layer_lib( struct loader_layer_properties *layer_prop) { uint32_t idx; - struct loader_lib_info *new_layer_lib_list, *my_lib; + struct loader_lib_info *new_layer_lib_list, *my_lib = NULL; for (uint32_t i = 0; i < loader.loaded_layer_lib_count; i++) { if (strcmp(loader.loaded_layer_lib_list[i].lib_name, layer_prop->lib_info.lib_name) == 0) { @@ -1907,13 +1909,14 @@ static void loader_remove_layer_lib( } } - my_lib->ref_count--; - if (my_lib->ref_count > 0) { - loader_log(VK_DBG_REPORT_DEBUG_BIT, 0, - "Decrement reference count for layer library %s", layer_prop->lib_info.lib_name); - return; + if (my_lib) { + my_lib->ref_count--; + if (my_lib->ref_count > 0) { + loader_log(VK_DBG_REPORT_DEBUG_BIT, 0, + "Decrement reference count for layer library %s", layer_prop->lib_info.lib_name); + return; + } } - loader_platform_close_library(my_lib->lib_handle); loader_log(VK_DBG_REPORT_DEBUG_BIT, 0, "Unloading layer library %s", layer_prop->lib_info.lib_name); diff --git a/vk_helper.py b/vk_helper.py index b52129a7..bcff445a 100755 --- a/vk_helper.py +++ b/vk_helper.py @@ -972,8 +972,8 @@ class StructWrapperGen: sh_funcs.append(" return final_str;") sh_funcs.append("}") sh_funcs.append('%s' % lineinfo.get()) - # Add function to return a string value for input uint32_t - sh_funcs.append("string string_convert_helper(const uint32_t toString, const string prefix)\n{") + # Add function to return a string value for input uint64_t + sh_funcs.append("string string_convert_helper(const uint64_t toString, const string prefix)\n{") sh_funcs.append(" using namespace StreamControl;") sh_funcs.append(" stringstream ss;") sh_funcs.append(' ss << toString;') -- cgit v1.2.3