mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:36:30 +02:00
Fix assertion message
This commit is contained in:
parent
f15d87fff1
commit
8e653c3a65
1 changed files with 3 additions and 2 deletions
|
@ -98,10 +98,11 @@ void ControlPacket::writeType() {
|
||||||
void ControlPacket::readType() {
|
void ControlPacket::readType() {
|
||||||
ControlBitAndType bitAndType = *reinterpret_cast<ControlBitAndType*>(_packet.get());
|
ControlBitAndType bitAndType = *reinterpret_cast<ControlBitAndType*>(_packet.get());
|
||||||
|
|
||||||
Q_ASSERT_X(bitAndType & CONTROL_BIT_MASK, "ControlPacket::readHeader()", "This should be a control packet");
|
Q_ASSERT_X(bitAndType & CONTROL_BIT_MASK, "ControlPacket::readType()", "This should be a control packet");
|
||||||
|
|
||||||
uint16_t packetType = (bitAndType & ~CONTROL_BIT_MASK) >> (8 * sizeof(Type));
|
uint16_t packetType = (bitAndType & ~CONTROL_BIT_MASK) >> (8 * sizeof(Type));
|
||||||
Q_ASSERT_X(packetType <= ControlPacket::Type::HandshakeRequest, "ControlPacket::readType()", "Received a control packet with wrong type");
|
Q_ASSERT_X(packetType <= ControlPacket::Type::HandshakeRequest, "ControlPacket::readType()",
|
||||||
|
"Received a control packet with invalid type");
|
||||||
|
|
||||||
// read the type
|
// read the type
|
||||||
_type = (Type) packetType;
|
_type = (Type) packetType;
|
||||||
|
|
Loading…
Reference in a new issue