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 --- loader/loader.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'loader') 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); -- cgit v1.2.3