mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
more warning fixes
This commit is contained in:
parent
adb6ffe7c4
commit
851764a705
2 changed files with 7 additions and 6 deletions
|
@ -288,7 +288,7 @@ int AvatarData::parseData(const QByteArray& packet) {
|
|||
// joint data
|
||||
int jointCount = *sourceBuffer++;
|
||||
_jointData.resize(jointCount);
|
||||
unsigned char validity;
|
||||
unsigned char validity = 0; // although always set below, this fixes a warning of potential uninitialized use
|
||||
int validityBit = 0;
|
||||
for (int i = 0; i < jointCount; i++) {
|
||||
if (validityBit == 0) {
|
||||
|
|
|
@ -217,11 +217,12 @@ int HandData::decodeRemoteData(const QByteArray& dataByteArray) {
|
|||
palm.setActive(false);
|
||||
}
|
||||
|
||||
// One byte for error checking safety.
|
||||
unsigned char requiredLength = (unsigned char)(sourceBuffer - startPosition);
|
||||
unsigned char checkLength = *sourceBuffer++;
|
||||
assert(checkLength == requiredLength);
|
||||
|
||||
// One byte for error checking safety. Last byte contains the expected length (less itself)
|
||||
// actualLength less expected byte = (sourceBuffer - startPosition)
|
||||
// expectedLength less expected byte = (*sourceBuffer)
|
||||
assert((unsigned char)(sourceBuffer - startPosition) == (unsigned char)(*sourceBuffer));
|
||||
sourceBuffer++; // skip the trailing byte which is expected length
|
||||
|
||||
return sourceBuffer - startPosition;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue