diff --git a/Externals/WiiUse/Inc/wiiuse.h b/Externals/WiiUse/Inc/wiiuse.h index 42e57f08c8..00434420cd 100644 --- a/Externals/WiiUse/Inc/wiiuse.h +++ b/Externals/WiiUse/Inc/wiiuse.h @@ -556,7 +556,7 @@ typedef struct wiimote_t { WCONST struct read_req_t* read_req; /**< list of data read requests */ WCONST struct accel_t accel_calib; /**< wiimote accelerometer calibration */ - WCONST struct expansion_t exp; /**< wiimote expansion device */ + WCONST struct expansion_t expansion; /**< wiimote expansion device */ WCONST struct vec3b_t accel; /**< current raw acceleration data */ WCONST struct orient_t orient; /**< current orientation on each axis */ diff --git a/Source/Core/Common/Src/SDCardUtil.cpp b/Source/Core/Common/Src/SDCardUtil.cpp index 985e02d8ca..856afaeace 100644 --- a/Source/Core/Common/Src/SDCardUtil.cpp +++ b/Source/Core/Common/Src/SDCardUtil.cpp @@ -193,12 +193,15 @@ bool SDCardCreate(u64 disk_size /*in MB*/, char* filename) FILE* f; // Convert MB to bytes - disk_size *= 1024*1024; + disk_size *= 1024 * 1024; - if (disk_size < 0x800000 || disk_size > 0x800000000ULL) + if (disk_size < 0x800000 || disk_size > 0x800000000ULL) { ERROR_LOG(COMMON, "Trying to create SD Card image of size %iMB is out of range (8MB-32GB)", disk_size/(1024*1024)); + return false; + } - sectors_per_disk = disk_size / 512; + // pretty unlikely to overflow. + sectors_per_disk = (int)(disk_size / 512); sectors_per_fat = get_sectors_per_fat(disk_size, get_sectors_per_cluster(disk_size)); boot_sector_init(s_boot_sector, s_fsinfo_sector, disk_size, NULL ); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp index 439bbc960c..6ba908d359 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Synth.cpp @@ -28,7 +28,7 @@ void CUCode_Zelda::RenderSynth_RectWave(ZeldaVoicePB &PB, s32* _Buffer, int _Siz { float _ratioFactor = 32000.0f / (float)soundStream->GetMixer()->GetSampleRate(); u32 _ratio = (PB.RatioInt << 16); - s64 ratio = (_ratio * _ratioFactor) * 16; + s64 ratio = (s64)((_ratio * _ratioFactor) * 16); s64 TrueSamplePosition = PB.CurSampleFrac; // PB.Format == 0x3 -> Rectangular Wave, 0x0 -> Square Wave diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h index 1a1550d3e3..3472ea7c78 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h @@ -111,7 +111,8 @@ struct Resolution struct AALevel { AALevel(const char *n, D3DMULTISAMPLE_TYPE m, int q) { - strcpy(name, n); + strncpy(name, n, 32); + name[31] = '\0'; ms_setting = m; qual_setting = q; } diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp index 4b58effbd8..6b2d0733b4 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/CommandProcessor.cpp @@ -433,7 +433,7 @@ bool RunBuffer() OpcodeDecoder::Run(availableBytes); // if data was read by the opcode decoder then the video data pointer changed - readPos = g_pVideoData - &commandBuffer[0]; + readPos = (u32)(g_pVideoData - &commandBuffer[0]); _dbg_assert_(VIDEO, writePos >= readPos); availableBytes = writePos - readPos; }