Enable full object validation by default

Full object validation was always done before this hint and there are a number of shipping products that relied on this, so don't change it by default.
This commit is contained in:
Sam Lantinga
2025-10-01 12:46:33 -07:00
parent 86da08b0be
commit f66e4d0a43
2 changed files with 2 additions and 8 deletions

View File

@@ -691,9 +691,8 @@ extern "C" {
* The variable can be set to the following values: * The variable can be set to the following values:
* *
* - "1": Enable fast parameter error checking, e.g. quick NULL checks, etc. * - "1": Enable fast parameter error checking, e.g. quick NULL checks, etc.
* (default)
* - "2": Enable full parameter error checking, e.g. validating objects are * - "2": Enable full parameter error checking, e.g. validating objects are
* the correct type, etc. * the correct type, etc. (default)
* *
* This hint can be set anytime. * This hint can be set anytime.
* *

View File

@@ -141,12 +141,7 @@ bool SDL_object_validation = false;
static void SDLCALL SDL_InvalidParamChecksChanged(void *userdata, const char *name, const char *oldValue, const char *hint) static void SDLCALL SDL_InvalidParamChecksChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{ {
bool validation_enabled = false; bool validation_enabled = true;
#ifdef SDL_ASSERT_INVALID_PARAMS
// Full validation is enabled by default
validation_enabled = true;
#endif
if (hint) { if (hint) {
switch (*hint) { switch (*hint) {