Add asserts for public API pointer parameters

This commit is contained in:
Camilla Berglund
2016-01-31 17:56:36 +01:00
parent d0649e6868
commit 0ebdad53e8
4 changed files with 99 additions and 0 deletions
+6
View File
@@ -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())