Fix all -Wconversion warnings
This commit is contained in:
@@ -189,23 +189,23 @@ static inline size_t formatMessage(char *dst, const char *src, size_t length, Op
|
||||
size_t headerLength;
|
||||
if (reportedLength < 126) {
|
||||
headerLength = 2;
|
||||
dst[1] = reportedLength;
|
||||
dst[1] = (char) reportedLength;
|
||||
} else if (reportedLength <= UINT16_MAX) {
|
||||
headerLength = 4;
|
||||
dst[1] = 126;
|
||||
uint16_t tmp = cond_byte_swap<uint16_t>(reportedLength);
|
||||
uint16_t tmp = cond_byte_swap<uint16_t>((uint16_t) reportedLength);
|
||||
memcpy(&dst[2], &tmp, sizeof(uint16_t));
|
||||
} else {
|
||||
headerLength = 10;
|
||||
dst[1] = 127;
|
||||
uint64_t tmp = cond_byte_swap<uint64_t>(reportedLength);
|
||||
uint64_t tmp = cond_byte_swap<uint64_t>((uint64_t) reportedLength);
|
||||
memcpy(&dst[2], &tmp, sizeof(uint64_t));
|
||||
}
|
||||
|
||||
int flags = 0;
|
||||
dst[0] = (flags & SND_NO_FIN ? 0 : 128) | (compressed ? SND_COMPRESSED : 0);
|
||||
dst[0] = (char) ((flags & SND_NO_FIN ? 0 : 128) | (compressed ? SND_COMPRESSED : 0));
|
||||
if (!(flags & SND_CONTINUATION)) {
|
||||
dst[0] |= opCode;
|
||||
dst[0] |= (char) opCode;
|
||||
}
|
||||
|
||||
char mask[4];
|
||||
@@ -320,7 +320,7 @@ protected:
|
||||
}
|
||||
|
||||
src += payLength + MESSAGE_HEADER;
|
||||
length -= payLength + MESSAGE_HEADER;
|
||||
length -= (unsigned int) (payLength + MESSAGE_HEADER);
|
||||
wState->state.spillLength = 0;
|
||||
return false;
|
||||
} else {
|
||||
@@ -419,7 +419,7 @@ public:
|
||||
}
|
||||
if (length) {
|
||||
memcpy(wState->state.spill, src, length);
|
||||
wState->state.spillLength = length;
|
||||
wState->state.spillLength = length & 0xf;
|
||||
}
|
||||
} else if (consumeContinuation(src, length, wState, user)) {
|
||||
goto parseNext;
|
||||
|
||||
Reference in New Issue
Block a user