Przeglądaj źródła

Fixed error: incompatible function pointer types passing

SDL/src/sensor/emscripten/SDL_emscriptensensor.c:80:5: error: incompatible function pointer types passing
      'int (*)(int, const EmscriptenDeviceMotionEvent *, void *)' (aka 'int (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') to parameter of type 'em_devicemotion_callback_func' (aka
      'bool (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') [-Wincompatible-function-pointer-types]
   80 |     emscripten_set_devicemotion_callback((void *)0, false, &SDL_EMSCRIPTEN_SensorCallback);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sam Lantinga 4 miesięcy temu
rodzic
commit
be1d44279c
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/sensor/emscripten/SDL_emscriptensensor.c

+ 1 - 1
src/sensor/emscripten/SDL_emscriptensensor.c

@@ -67,7 +67,7 @@ static void SDL_EMSCRIPTEN_GyroscopeCallback(const EmscriptenDeviceMotionEvent *
     SDL_sensors[1].new_data = true;
 }
 
-static int SDL_EMSCRIPTEN_SensorCallback(int event_type, const EmscriptenDeviceMotionEvent *event, void *user_data)
+static EM_BOOL SDL_EMSCRIPTEN_SensorCallback(int event_type, const EmscriptenDeviceMotionEvent *event, void *user_data)
 {
     SDL_EMSCRIPTEN_AccelerometerCallback(event);
     SDL_EMSCRIPTEN_GyroscopeCallback(event);