From 0d82a0ccc3c9bb49f28f18e7460a5366e06516bc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Feb 2018 04:08:21 +0100 Subject: tracker/wii: fix MSVC narrowing conversion warnings --- tracker-wii/wiiyourself/wiimote.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tracker-wii') diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp index 46130cca..79893027 100644 --- a/tracker-wii/wiiyourself/wiimote.cpp +++ b/tracker-wii/wiiyourself/wiimote.cpp @@ -1685,6 +1685,7 @@ int wiimote::ParseReadAddress (BYTE* buff) // decode the address that was queried: int address = buff[4]<<8 | buff[5]; int size = buff[3] >> 4; + (void)size; int changed = 0; if((buff[3] & 0x08) != 0) { @@ -2689,7 +2690,7 @@ bool wiimote::PlaySample (const wiimote_sample &sample, BYTE volume, // Write 0x08 to register 0x04a20001 WriteData(0x04a20001, 0x08); // Write 7-byte configuration to registers 0x04a20001-0x04a20008 - BYTE bytes[7] = { 0x00, 0x00, 0x00, 10+(BYTE)freq, volume, 0x00, 0x00 }; + BYTE bytes[7] = { '\0', '\0', '\0', BYTE(10 + freq), volume, '\0', '\0' }; WriteData(0x04a20001, sizeof(bytes), bytes); // + Write 0x01 to register 0x04a20008 WriteData(0x04a20008, 0x01); @@ -2754,7 +2755,7 @@ bool wiimote::PlaySquareWave (speaker_freq freq, BYTE volume) WriteData(0x04a20001, 0x08); // write default sound mode (4bit ADPCM, we assume) 7-byte configuration // to registers 0xa20001-0xa20008 - BYTE bytes[7] = { 0x00, 0x00, 0x00, 10+(BYTE)freq, volume, 0x00, 0x00 }; + BYTE bytes[7] = { '\0', '\0', '\0', BYTE(10+freq), volume, '\0', '\0' }; WriteData(0x04a20001, sizeof(bytes), bytes); // write 0x01 to register 0xa20008 WriteData(0x04a20008, 0x01); -- cgit v1.2.3