Typecast malloc results.
Committing changes from dolphin-emu's wiiuse 0.13 Conflicts: src/classic.c src/events.c src/nunchuk.c
This commit is contained in:
@@ -76,7 +76,7 @@ int classic_ctrl_handshake(struct wiimote_t* wm, struct classic_ctrl_t* cc, byte
|
|||||||
*/
|
*/
|
||||||
if (data[offset + 16] == 0xFF) {
|
if (data[offset + 16] == 0xFF) {
|
||||||
/* get the calibration data */
|
/* get the calibration data */
|
||||||
byte* handshake_buf = malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
byte* handshake_buf = (byte *)malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
||||||
|
|
||||||
WIIUSE_DEBUG("Classic controller handshake appears invalid, trying again.");
|
WIIUSE_DEBUG("Classic controller handshake appears invalid, trying again.");
|
||||||
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
|||||||
wiiuse_write_data(wm, WM_EXP_MEM_ENABLE, &buf, 1);
|
wiiuse_write_data(wm, WM_EXP_MEM_ENABLE, &buf, 1);
|
||||||
|
|
||||||
/* get the calibration data */
|
/* get the calibration data */
|
||||||
handshake_buf = malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
handshake_buf = (byte *)malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
||||||
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
||||||
|
|
||||||
/* tell the wiimote to send expansion data */
|
/* tell the wiimote to send expansion data */
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ int nunchuk_handshake(struct wiimote_t* wm, struct nunchuk_t* nc, byte* data, un
|
|||||||
*/
|
*/
|
||||||
if (data[offset + 16] == 0xFF) {
|
if (data[offset + 16] == 0xFF) {
|
||||||
/* get the calibration data */
|
/* get the calibration data */
|
||||||
byte* handshake_buf = malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
byte* handshake_buf = (byte *)malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
|
||||||
|
|
||||||
WIIUSE_DEBUG("Nunchuk handshake appears invalid, trying again.");
|
WIIUSE_DEBUG("Nunchuk handshake appears invalid, trying again.");
|
||||||
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
|
||||||
|
|||||||
Reference in New Issue
Block a user