From 58f2aab7593f03c9c9ea00897b42783aca7e9fa3 Mon Sep 17 00:00:00 2001 From: Marco Lizza Date: Thu, 29 Feb 2024 01:49:48 +0100 Subject: [PATCH] Fixing constant pointers. --- src/cocoa_platform.h | 2 +- src/cocoa_window.m | 2 +- src/internal.h | 4 ++-- src/null_platform.h | 2 +- src/null_window.c | 2 +- src/vulkan.c | 2 +- src/win32_platform.h | 2 +- src/win32_window.c | 2 +- src/wl_platform.h | 2 +- src/wl_window.c | 2 +- src/x11_init.c | 2 +- src/x11_platform.h | 2 +- src/x11_window.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index 39914554..84eda397 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -272,7 +272,7 @@ EGLenum _glfwGetEGLPlatformCocoa(EGLint** attribs); EGLNativeDisplayType _glfwGetEGLNativeDisplayCocoa(void); EGLNativeWindowType _glfwGetEGLNativeWindowCocoa(_GLFWwindow* window); -void _glfwGetRequiredInstanceExtensionsCocoa(char** extensions); +void _glfwGetRequiredInstanceExtensionsCocoa(const char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportCocoa(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 0dcf0a38..523ddaad 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1921,7 +1921,7 @@ EGLNativeWindowType _glfwGetEGLNativeWindowCocoa(_GLFWwindow* window) return window->ns.layer; } -void _glfwGetRequiredInstanceExtensionsCocoa(char** extensions) +void _glfwGetRequiredInstanceExtensionsCocoa(const char** extensions) { if (_glfw.vk.KHR_surface && _glfw.vk.EXT_metal_surface) { diff --git a/src/internal.h b/src/internal.h index 88733593..6f00c1c0 100644 --- a/src/internal.h +++ b/src/internal.h @@ -746,7 +746,7 @@ struct _GLFWplatform EGLNativeDisplayType (*getEGLNativeDisplay)(void); EGLNativeWindowType (*getEGLNativeWindow)(_GLFWwindow*); // vulkan - void (*getRequiredInstanceExtensions)(char**); + void (*getRequiredInstanceExtensions)(const char**); GLFWbool (*getPhysicalDevicePresentationSupport)(VkInstance,VkPhysicalDevice,uint32_t); VkResult (*createWindowSurface)(VkInstance,_GLFWwindow*,const VkAllocationCallbacks*,VkSurfaceKHR*); }; @@ -851,7 +851,7 @@ struct _GLFWlibrary struct { GLFWbool available; void* handle; - char* extensions[2]; + const char* extensions[2]; PFN_vkGetInstanceProcAddr GetInstanceProcAddr; GLFWbool KHR_surface; GLFWbool KHR_win32_surface; diff --git a/src/null_platform.h b/src/null_platform.h index 4843a76a..af5b9827 100644 --- a/src/null_platform.h +++ b/src/null_platform.h @@ -263,7 +263,7 @@ EGLenum _glfwGetEGLPlatformNull(EGLint** attribs); EGLNativeDisplayType _glfwGetEGLNativeDisplayNull(void); EGLNativeWindowType _glfwGetEGLNativeWindowNull(_GLFWwindow* window); -void _glfwGetRequiredInstanceExtensionsNull(char** extensions); +void _glfwGetRequiredInstanceExtensionsNull(const char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportNull(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceNull(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); diff --git a/src/null_window.c b/src/null_window.c index 1db08114..e3556994 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -697,7 +697,7 @@ int _glfwGetKeyScancodeNull(int key) return _glfw.null.scancodes[key]; } -void _glfwGetRequiredInstanceExtensionsNull(char** extensions) +void _glfwGetRequiredInstanceExtensionsNull(const char** extensions) { } diff --git a/src/vulkan.c b/src/vulkan.c index d9fabdea..9c526261 100644 --- a/src/vulkan.c +++ b/src/vulkan.c @@ -148,7 +148,7 @@ GLFWbool _glfwInitVulkan(int mode) _glfw.vk.available = GLFW_TRUE; - _glfw.platform.getRequiredInstanceExtensions(_glfw.vk.extensions); + _glfw.platform.getRequiredInstanceExtensions((const char **)_glfw.vk.extensions); return GLFW_TRUE; } diff --git a/src/win32_platform.h b/src/win32_platform.h index 7e3d8845..aa8308d3 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -600,7 +600,7 @@ EGLenum _glfwGetEGLPlatformWin32(EGLint** attribs); EGLNativeDisplayType _glfwGetEGLNativeDisplayWin32(void); EGLNativeWindowType _glfwGetEGLNativeWindowWin32(_GLFWwindow* window); -void _glfwGetRequiredInstanceExtensionsWin32(char** extensions); +void _glfwGetRequiredInstanceExtensionsWin32(const char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportWin32(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceWin32(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); diff --git a/src/win32_window.c b/src/win32_window.c index e6a9496c..a1b65920 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2513,7 +2513,7 @@ EGLNativeWindowType _glfwGetEGLNativeWindowWin32(_GLFWwindow* window) return window->win32.handle; } -void _glfwGetRequiredInstanceExtensionsWin32(char** extensions) +void _glfwGetRequiredInstanceExtensionsWin32(const char** extensions) { if (!_glfw.vk.KHR_surface || !_glfw.vk.KHR_win32_surface) return; diff --git a/src/wl_platform.h b/src/wl_platform.h index 149cd241..72bbd00b 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -670,7 +670,7 @@ EGLenum _glfwGetEGLPlatformWayland(EGLint** attribs); EGLNativeDisplayType _glfwGetEGLNativeDisplayWayland(void); EGLNativeWindowType _glfwGetEGLNativeWindowWayland(_GLFWwindow* window); -void _glfwGetRequiredInstanceExtensionsWayland(char** extensions); +void _glfwGetRequiredInstanceExtensionsWayland(const char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportWayland(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceWayland(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); diff --git a/src/wl_window.c b/src/wl_window.c index 5b491ffb..cec492ac 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -3207,7 +3207,7 @@ EGLNativeWindowType _glfwGetEGLNativeWindowWayland(_GLFWwindow* window) return window->wl.egl.window; } -void _glfwGetRequiredInstanceExtensionsWayland(char** extensions) +void _glfwGetRequiredInstanceExtensionsWayland(const char** extensions) { if (!_glfw.vk.KHR_surface || !_glfw.vk.KHR_wayland_surface) return; diff --git a/src/x11_init.c b/src/x11_init.c index e992f444..57207025 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -231,7 +231,7 @@ static void createKeyTables(void) const struct { int key; - char* name; + const char* name; } keymap[] = { { GLFW_KEY_GRAVE_ACCENT, "TLDE" }, diff --git a/src/x11_platform.h b/src/x11_platform.h index 14e363d1..599b5468 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -959,7 +959,7 @@ EGLenum _glfwGetEGLPlatformX11(EGLint** attribs); EGLNativeDisplayType _glfwGetEGLNativeDisplayX11(void); EGLNativeWindowType _glfwGetEGLNativeWindowX11(_GLFWwindow* window); -void _glfwGetRequiredInstanceExtensionsX11(char** extensions); +void _glfwGetRequiredInstanceExtensionsX11(const char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportX11(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceX11(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); diff --git a/src/x11_window.c b/src/x11_window.c index e0295465..a6ed7be7 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -3133,7 +3133,7 @@ EGLNativeWindowType _glfwGetEGLNativeWindowX11(_GLFWwindow* window) return (EGLNativeWindowType) window->x11.handle; } -void _glfwGetRequiredInstanceExtensionsX11(char** extensions) +void _glfwGetRequiredInstanceExtensionsX11(const char** extensions) { if (!_glfw.vk.KHR_surface) return;