mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 08:22:09 +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() {
|
||||
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));
|
||||
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
|
||||
_type = (Type) packetType;
|
||||
|
|
Loading…
Reference in a new issue