diff --git a/reedsolomon/rs.c b/reedsolomon/rs.c index 5ab23ba..b54b064 100644 --- a/reedsolomon/rs.c +++ b/reedsolomon/rs.c @@ -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 */ diff --git a/src/AudioStream.c b/src/AudioStream.c index 404372e..6f47f5a 100644 --- a/src/AudioStream.c +++ b/src/AudioStream.c @@ -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; } diff --git a/src/InputStream.c b/src/InputStream.c index e1e3801..4280a8e 100644 --- a/src/InputStream.c +++ b/src/InputStream.c @@ -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) { diff --git a/src/RtpFecQueue.h b/src/RtpFecQueue.h index bc55173..c9f34a3 100644 --- a/src/RtpFecQueue.h +++ b/src/RtpFecQueue.h @@ -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 diff --git a/src/RtpReorderQueue.h b/src/RtpReorderQueue.h index a24eee8..4aa370c 100644 --- a/src/RtpReorderQueue.h +++ b/src/RtpReorderQueue.h @@ -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; diff --git a/src/SimpleStun.c b/src/SimpleStun.c index f85708e..13bec29 100644 --- a/src/SimpleStun.c +++ b/src/SimpleStun.c @@ -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;