فهرست منبع

audio_core/codec: Resolve truncation warnings within DecodeADPCM

The assignments here were performing an implicit truncation from int to
s16. Make it explicit that this is desired behavior.
Lioncash 7 سال پیش
والد
کامیت
a12f4efa2f
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/audio_core/codec.cpp

+ 2 - 2
src/audio_core/codec.cpp

@@ -68,8 +68,8 @@ std::vector<s16> DecodeADPCM(const u8* const data, std::size_t size, const ADPCM
         }
     }
 
-    state.yn1 = yn1;
-    state.yn2 = yn2;
+    state.yn1 = static_cast<s16>(yn1);
+    state.yn2 = static_cast<s16>(yn2);
 
     return ret;
 }