Browse Source

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.
Sam Lantinga 1 week ago
parent
commit
f66e4d0a43
2 changed files with 2 additions and 8 deletions
  1. 1 2
      include/SDL3/SDL_hints.h
  2. 1 6
      src/SDL_utils.c

+ 1 - 2
include/SDL3/SDL_hints.h

@@ -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.
  *
  *

+ 1 - 6
src/SDL_utils.c

@@ -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;
-
-#ifdef SDL_ASSERT_INVALID_PARAMS
-    // Full validation is enabled by default
-    validation_enabled = true;
-#endif
+    bool validation_enabled = true;
 
 
     if (hint) {
     if (hint) {
         switch (*hint) {
         switch (*hint) {