Replaced C style cast with reinterpret_cast

This commit is contained in:
Charles Giessen 2020-03-07 02:14:59 -07:00
parent b183c05f45
commit 0ed5ac8435

View File

@ -76,8 +76,8 @@ VkResult create_debug_utils_messenger (VkInstance instance,
messengerCreateInfo.pfnUserCallback = debug_callback; messengerCreateInfo.pfnUserCallback = debug_callback;
auto vkCreateDebugUtilsMessengerEXT_func = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr ( auto vkCreateDebugUtilsMessengerEXT_func = reinterpret_cast<PFN_vkCreateDebugUtilsMessengerEXT> (
instance, "vkCreateDebugUtilsMessengerEXT"); vkGetInstanceProcAddr (instance, "vkCreateDebugUtilsMessengerEXT"));
if (vkCreateDebugUtilsMessengerEXT_func != nullptr) { if (vkCreateDebugUtilsMessengerEXT_func != nullptr) {
return vkCreateDebugUtilsMessengerEXT_func (instance, &messengerCreateInfo, nullptr, pDebugMessenger); return vkCreateDebugUtilsMessengerEXT_func (instance, &messengerCreateInfo, nullptr, pDebugMessenger);
} else { } else {
@ -86,8 +86,8 @@ VkResult create_debug_utils_messenger (VkInstance instance,
} }
void destroy_debug_utils_messenger (VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger) { void destroy_debug_utils_messenger (VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger) {
auto vkDestroyDebugUtilsMessengerEXT_func = (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr ( auto vkDestroyDebugUtilsMessengerEXT_func = reinterpret_cast<PFN_vkDestroyDebugUtilsMessengerEXT> (
instance, "vkDestroyDebugUtilsMessengerEXT"); vkGetInstanceProcAddr (instance, "vkDestroyDebugUtilsMessengerEXT"));
if (vkDestroyDebugUtilsMessengerEXT_func != nullptr) { if (vkDestroyDebugUtilsMessengerEXT_func != nullptr) {
vkDestroyDebugUtilsMessengerEXT_func (instance, debugMessenger, nullptr); vkDestroyDebugUtilsMessengerEXT_func (instance, debugMessenger, nullptr);
} }