Przeglądaj źródła

Merge commit '85924687fd5d53a58f5e3cf7bf3479b0c0587674' into main

Sam Lantinga 2 lat temu
rodzic
commit
21b121b6df
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      include/SDL3/SDL_sensor.h
  2. 1 1
      src/sensor/SDL_sensor.c

+ 1 - 1
include/SDL3/SDL_sensor.h

@@ -223,7 +223,7 @@ extern DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
  * Get the instance ID of a sensor.
  *
  * \param sensor The SDL_Sensor object to inspect
- * \returns the sensor instance ID, or -1 if `sensor` is NULL.
+ * \returns the sensor instance ID, or 0 if `sensor` is NULL.
  *
  * \since This function is available since SDL 3.0.0.
  */

+ 1 - 1
src/sensor/SDL_sensor.c

@@ -374,7 +374,7 @@ int SDL_GetSensorNonPortableType(SDL_Sensor *sensor)
 SDL_SensorID SDL_GetSensorInstanceID(SDL_Sensor *sensor)
 {
     if (!SDL_IsSensorValid(sensor)) {
-        return -1;
+        return 0;
     }
 
     return sensor->instance_id;