Report invalid constants in the appropriate base

If the expected constants are defined in hexadecimal in the header then
the error string should also use hexadecimal.

Idea by IntellectualKitty.

Related to #970.
This commit is contained in:
Camilla Löwy
2017-06-27 16:35:18 +02:00
parent 99762ad7f0
commit d5de48ab53
4 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -225,7 +225,7 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
case GLFW_STICKY_MOUSE_BUTTONS:
return window->stickyMouseButtons;
default:
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode %i", mode);
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
return 0;
}
}
@@ -246,7 +246,7 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
value != GLFW_CURSOR_DISABLED)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid cursor mode %i",
"Invalid cursor mode 0x%08X",
value);
return;
}
@@ -309,7 +309,7 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
}
}
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode %i", mode);
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
}
GLFWAPI const char* glfwGetKeyName(int key, int scancode)
@@ -466,7 +466,7 @@ GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape)
shape != GLFW_HRESIZE_CURSOR &&
shape != GLFW_VRESIZE_CURSOR)
{
_glfwInputError(GLFW_INVALID_ENUM, "Invalid standard cursor %i", shape);
_glfwInputError(GLFW_INVALID_ENUM, "Invalid standard cursor 0x%08X", shape);
return NULL;
}