mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 23:35:24 +00:00
Add asserts for public API pointer parameters
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
@@ -566,6 +567,7 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
|
||||
GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window);
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
@@ -595,6 +597,8 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
||||
{
|
||||
_GLFWwindow* window;
|
||||
|
||||
assert(extension);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
|
||||
|
||||
window = _glfwPlatformGetCurrentContext();
|
||||
@@ -657,6 +661,8 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
||||
|
||||
GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)
|
||||
{
|
||||
assert(procname);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
if (!_glfwPlatformGetCurrentContext())
|
||||
|
||||
Reference in New Issue
Block a user