From 7669ade19c7980206953a6b42be8b3b48539bac1 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 22 Feb 2016 10:44:37 +0100 Subject: [PATCH] Make instance extension count unsigned Fixes #714. --- docs/vulkan.dox | 2 +- include/GLFW/glfw3.h | 2 +- src/cocoa_window.m | 2 +- src/internal.h | 4 ++-- src/mir_window.c | 2 +- src/vulkan.c | 2 +- src/win32_window.c | 2 +- src/wl_window.c | 2 +- src/x11_window.c | 2 +- tests/glfwinfo.c | 2 +- tests/vulkan.c | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/vulkan.dox b/docs/vulkan.dox index 97099f87..a5400032 100644 --- a/docs/vulkan.dox +++ b/docs/vulkan.dox @@ -127,7 +127,7 @@ To query the instance extensions required, call @ref glfwGetRequiredInstanceExtensions. @code -int count; +unsigned int count; const char** extensions = glfwGetRequiredInstanceExtensions(&count); @endcode diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 78346714..55c891ec 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -3785,7 +3785,7 @@ GLFWAPI int glfwVulkanSupported(void); * * @ingroup vulkan */ -GLFWAPI const char** glfwGetRequiredInstanceExtensions(int* count); +GLFWAPI const char** glfwGetRequiredInstanceExtensions(unsigned int* count); #if defined(VK_VERSION_1_0) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index a3243750..093d2b0a 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1339,7 +1339,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) return _glfw.ns.clipboardString; } -char** _glfwPlatformGetRequiredInstanceExtensions(int* count) +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count) { *count = 0; return NULL; diff --git a/src/internal.h b/src/internal.h index 3d8edc88..358da256 100644 --- a/src/internal.h +++ b/src/internal.h @@ -438,7 +438,7 @@ struct _GLFWlibrary GLFWbool available; void* handle; char** extensions; - int extensionCount; + unsigned int extensionCount; PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; PFN_vkGetInstanceProcAddr GetInstanceProcAddr; GLFWbool KHR_surface; @@ -784,7 +784,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor); /*! @ingroup platform */ -char** _glfwPlatformGetRequiredInstanceExtensions(int* count); +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count); /*! @ingroup platform */ diff --git a/src/mir_window.c b/src/mir_window.c index 6e0ee16b..0642d08d 100644 --- a/src/mir_window.c +++ b/src/mir_window.c @@ -719,7 +719,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) return NULL; } -char** _glfwPlatformGetRequiredInstanceExtensions(int* count) +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count) { char** extensions; diff --git a/src/vulkan.c b/src/vulkan.c index 04db23e0..504ed636 100644 --- a/src/vulkan.c +++ b/src/vulkan.c @@ -196,7 +196,7 @@ GLFWAPI int glfwVulkanSupported(void) return _glfw.vk.available; } -GLFWAPI const char** glfwGetRequiredInstanceExtensions(int* count) +GLFWAPI const char** glfwGetRequiredInstanceExtensions(unsigned int* count) { *count = 0; diff --git a/src/win32_window.c b/src/win32_window.c index 55d98b9a..b2c627d2 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1418,7 +1418,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) return _glfw.win32.clipboardString; } -char** _glfwPlatformGetRequiredInstanceExtensions(int* count) +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count) { char** extensions; diff --git a/src/wl_window.c b/src/wl_window.c index c3303d70..706f52a3 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -710,7 +710,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) return NULL; } -char** _glfwPlatformGetRequiredInstanceExtensions(int* count) +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count) { char** extensions; diff --git a/src/x11_window.c b/src/x11_window.c index ddfc9159..2f9130a7 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2127,7 +2127,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) return _glfw.x11.clipboardString; } -char** _glfwPlatformGetRequiredInstanceExtensions(int* count) +char** _glfwPlatformGetRequiredInstanceExtensions(unsigned int* count) { char** extensions; diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c index 002a9bc4..d74b49fd 100644 --- a/tests/glfwinfo.c +++ b/tests/glfwinfo.c @@ -798,7 +798,7 @@ int main(int argc, char** argv) PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; - re = glfwGetRequiredInstanceExtensions((int*) &re_count); + re = glfwGetRequiredInstanceExtensions(&re_count); printf("Vulkan required instance extensions:"); for (i = 0; i < re_count; i++) diff --git a/tests/vulkan.c b/tests/vulkan.c index 21dd0137..dfc51710 100644 --- a/tests/vulkan.c +++ b/tests/vulkan.c @@ -1732,7 +1732,7 @@ static void demo_init_vk(struct demo *demo) { } /* Look for instance extensions */ - required_extensions = glfwGetRequiredInstanceExtensions((int*) &required_extension_count); + required_extensions = glfwGetRequiredInstanceExtensions(&required_extension_count); if (!required_extensions) { ERR_EXIT("glfwGetRequiredInstanceExtensions failed to find the " "platform surface extensions.\n\nDo you have a compatible "