Fix build warnings

This commit is contained in:
Cameron Gutman 2019-02-26 23:44:10 -08:00
parent 8755529b1a
commit 6eb17a8e73
2 changed files with 9 additions and 6 deletions

View File

@ -490,27 +490,27 @@ static void controlReceiveThreadFunc(void* context) {
if (ctlHdr->type == packetTypes[IDX_RUMBLE_DATA]) {
BYTE_BUFFER bb;
BbInitializeWrappedBuffer(&bb, event.packet->data, sizeof(*ctlHdr), event.packet->dataLength - sizeof(*ctlHdr), BYTE_ORDER_LITTLE);
BbInitializeWrappedBuffer(&bb, (char*)event.packet->data, sizeof(*ctlHdr), event.packet->dataLength - sizeof(*ctlHdr), BYTE_ORDER_LITTLE);
BbAdvanceBuffer(&bb, 4);
unsigned short controllerNumber;
unsigned short lowFreqRumble;
unsigned short highFreqRumble;
BbGetShort(&bb, &controllerNumber);
BbGetShort(&bb, &lowFreqRumble);
BbGetShort(&bb, &highFreqRumble);
BbGetShort(&bb, (short*)&controllerNumber);
BbGetShort(&bb, (short*)&lowFreqRumble);
BbGetShort(&bb, (short*)&highFreqRumble);
ListenerCallbacks.rumble(controllerNumber, lowFreqRumble, highFreqRumble);
}
else if (ctlHdr->type == packetTypes[IDX_TERMINATION]) {
BYTE_BUFFER bb;
BbInitializeWrappedBuffer(&bb, event.packet->data, sizeof(*ctlHdr), event.packet->dataLength - sizeof(*ctlHdr), BYTE_ORDER_LITTLE);
BbInitializeWrappedBuffer(&bb, (char*)event.packet->data, sizeof(*ctlHdr), event.packet->dataLength - sizeof(*ctlHdr), BYTE_ORDER_LITTLE);
unsigned short terminationReason;
BbGetShort(&bb, &terminationReason);
BbGetShort(&bb, (short*)&terminationReason);
Limelog("Server notified termination reason: 0x%04x\n", terminationReason);

View File

@ -76,3 +76,6 @@ int setNonFatalRecvTimeoutMs(SOCKET s, int timeoutMs);
void setRecvTimeout(SOCKET s, int timeoutSec);
void closeSocket(SOCKET s);
int isPrivateNetworkAddress(struct sockaddr_storage* address);
int initializePlatformSockets(void);
void cleanupPlatformSockets(void);