Pārlūkot izejas kodu

Fixed warning C4244: '=': conversion from 'int' to 'Uint8', possible loss of data

Sam Lantinga 11 mēneši atpakaļ
vecāks
revīzija
c24f860c4d
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      src/joystick/hidapi/SDL_hidapi_ps4.c

+ 2 - 2
src/joystick/hidapi/SDL_hidapi_ps4.c

@@ -158,7 +158,7 @@ typedef struct
     SDL_bool enhanced_reports;
     SDL_bool enhanced_mode;
     SDL_bool enhanced_mode_available;
-    int report_interval;
+    Uint8 report_interval;
     SDL_bool report_sensors;
     SDL_bool report_touchpad;
     SDL_bool report_battery;
@@ -815,7 +815,7 @@ static void SDLCALL SDL_PS4ReportIntervalHintChanged(void *userdata, const char
     }
 
     if (new_report_interval != ctx->report_interval) {
-        ctx->report_interval = new_report_interval;
+        ctx->report_interval = (Uint8)new_report_interval;
 
         HIDAPI_DriverPS4_UpdateEffects(ctx, SDL_FALSE);
     }