mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-06-30 23:05:57 +00:00
Fix Clang warnings
This commit is contained in:
parent
ac6630ef59
commit
3fddfc5557
@ -499,7 +499,7 @@ static int reed_solomon_decode(reed_solomon* rs, unsigned char **data_blocks, in
|
||||
unsigned char* subShards[DATA_SHARDS_MAX];
|
||||
unsigned char* outputs[DATA_SHARDS_MAX];
|
||||
gf* m = rs->m;
|
||||
int i, j, c, swap, subMatrixRow, dataShards, nos, nshards;
|
||||
int i, j, c, swap, subMatrixRow, dataShards;
|
||||
|
||||
/* the erased_blocks should always sorted
|
||||
* if sorted, nr_fec_blocks times to check it
|
||||
@ -523,11 +523,9 @@ static int reed_solomon_decode(reed_solomon* rs, unsigned char **data_blocks, in
|
||||
|
||||
j = 0;
|
||||
subMatrixRow = 0;
|
||||
nos = 0;
|
||||
nshards = 0;
|
||||
dataShards = rs->data_shards;
|
||||
for (i = 0; i < dataShards; i++) {
|
||||
if (j < nr_fec_blocks && i == erased_blocks[j])
|
||||
if (j < nr_fec_blocks && i == (int)erased_blocks[j])
|
||||
j++;
|
||||
else {
|
||||
/* this row is ok */
|
||||
|
@ -169,7 +169,7 @@ static void ReceiveThreadProc(void* context) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (packet->size < sizeof(RTP_PACKET)) {
|
||||
if (packet->size < (int)sizeof(RTP_PACKET)) {
|
||||
// Runt packet
|
||||
continue;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ static void inputSendThreadProc(void* context) {
|
||||
SOCK_RET err;
|
||||
PPACKET_HOLDER holder;
|
||||
char encryptedBuffer[MAX_INPUT_PACKET_SIZE];
|
||||
int encryptedSize;
|
||||
uint32_t encryptedSize;
|
||||
|
||||
while (!PltIsThreadInterrupted(&inputSendThread)) {
|
||||
int encryptedLengthPrefix;
|
||||
@ -323,7 +323,7 @@ static void inputSendThreadProc(void* context) {
|
||||
// Encrypt the message into the output buffer while leaving room for the length
|
||||
encryptedSize = sizeof(encryptedBuffer) - 4;
|
||||
err = encryptData((const unsigned char*)&holder->packet, holder->packetLength,
|
||||
(unsigned char*)&encryptedBuffer[4], &encryptedSize);
|
||||
(unsigned char*)&encryptedBuffer[4], (int*)&encryptedSize);
|
||||
free(holder);
|
||||
if (err != 0) {
|
||||
Limelog("Input: Encryption failed: %d\n", (int)err);
|
||||
@ -332,7 +332,7 @@ static void inputSendThreadProc(void* context) {
|
||||
}
|
||||
|
||||
// Prepend the length to the message
|
||||
encryptedLengthPrefix = htonl((uint32_t)encryptedSize);
|
||||
encryptedLengthPrefix = htonl(encryptedSize);
|
||||
memcpy(&encryptedBuffer[0], &encryptedLengthPrefix, 4);
|
||||
|
||||
if (AppVersionQuad[0] < 5) {
|
||||
|
@ -27,7 +27,7 @@ typedef struct _RTP_FEC_QUEUE {
|
||||
int fecPercentage;
|
||||
int nextContiguousSequenceNumber;
|
||||
|
||||
int currentFrameNumber;
|
||||
unsigned int currentFrameNumber;
|
||||
} RTP_FEC_QUEUE, *PRTP_FEC_QUEUE;
|
||||
|
||||
#define RTPF_RET_QUEUED 0
|
||||
|
@ -16,7 +16,7 @@ typedef struct _RTP_QUEUE_ENTRY {
|
||||
|
||||
typedef struct _RTP_REORDER_QUEUE {
|
||||
int maxSize;
|
||||
int maxQueueTimeMs;
|
||||
uint32_t maxQueueTimeMs;
|
||||
|
||||
PRTP_QUEUE_ENTRY queueHead;
|
||||
PRTP_QUEUE_ENTRY queueTail;
|
||||
|
@ -123,7 +123,7 @@ int LiFindExternalAddressIP4(const char* stunServer, unsigned short stunPort, un
|
||||
Limelog("Failed to read STUN binding response: %d\n", err);
|
||||
goto Exit;
|
||||
}
|
||||
else if (bytesRead < sizeof(resp.hdr)) {
|
||||
else if (bytesRead < (int)sizeof(resp.hdr)) {
|
||||
Limelog("STUN message truncated: %d\n", bytesRead);
|
||||
err = -3;
|
||||
goto Exit;
|
||||
@ -146,8 +146,8 @@ int LiFindExternalAddressIP4(const char* stunServer, unsigned short stunPort, un
|
||||
|
||||
attribute = (PSTUN_ATTRIBUTE_HEADER)(&resp.hdr + 1);
|
||||
bytesRead -= sizeof(resp.hdr);
|
||||
while (bytesRead > sizeof(*attribute)) {
|
||||
if (bytesRead < sizeof(*attribute) + htons(attribute->length)) {
|
||||
while (bytesRead > (int)sizeof(*attribute)) {
|
||||
if (bytesRead < (int)(sizeof(*attribute) + htons(attribute->length))) {
|
||||
Limelog("STUN attribute out of bounds: %d\n", htons(attribute->length));
|
||||
err = -5;
|
||||
goto Exit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user