diff --git a/src/enable.c b/src/enable.c index 82ba940c..897f0753 100644 --- a/src/enable.c +++ b/src/enable.c @@ -152,6 +152,7 @@ GLFWAPI void glfwEnable(GLFWwindow window, int token) enableKeyRepeat(window); break; default: + _glfwSetError(GLFW_INVALID_ENUM, NULL); break; } } @@ -184,6 +185,7 @@ GLFWAPI void glfwDisable(GLFWwindow window, int token) disableKeyRepeat(window); break; default: + _glfwSetError(GLFW_INVALID_ENUM, NULL); break; } } diff --git a/src/input.c b/src/input.c index 04c835a4..8845b758 100644 --- a/src/input.c +++ b/src/input.c @@ -53,7 +53,7 @@ GLFWAPI int glfwGetKey(GLFWwindow handle, int key) if (key < 0 || key > GLFW_KEY_LAST) { // TODO: Decide whether key is a value or enum - _glfwSetError(GLFW_INVALID_VALUE, + _glfwSetError(GLFW_INVALID_ENUM, "glfwGetKey: The specified key is invalid"); return GLFW_RELEASE; } diff --git a/src/window.c b/src/window.c index a39125ef..2e49b868 100644 --- a/src/window.c +++ b/src/window.c @@ -468,6 +468,7 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint) _glfwLibrary.hints.glRobustness = hint; break; default: + _glfwSetError(GLFW_INVALID_ENUM, NULL); break; } } @@ -748,12 +749,10 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param) return window->glProfile; case GLFW_OPENGL_ROBUSTNESS: return window->glRobustness; - default: - _glfwSetError(GLFW_INVALID_ENUM, - "glfwGetWindowParam: Invalid enum value for 'param' " - "parameter"); - return 0; } + + _glfwSetError(GLFW_INVALID_ENUM, NULL); + return 0; }