summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcborcommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qcborcommon.cpp')
-rw-r--r--src/corelib/serialization/qcborcommon.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/corelib/serialization/qcborcommon.cpp b/src/corelib/serialization/qcborcommon.cpp
index 5fc47fa399..b29e1f1bf6 100644
--- a/src/corelib/serialization/qcborcommon.cpp
+++ b/src/corelib/serialization/qcborcommon.cpp
@@ -271,50 +271,50 @@ QString QCborError::toString() const
{
switch (c) {
case NoError:
- Q_STATIC_ASSERT(int(NoError) == int(CborNoError));
+ static_assert(int(NoError) == int(CborNoError));
return QString();
case UnknownError:
- Q_STATIC_ASSERT(int(UnknownError) == int(CborUnknownError));
+ static_assert(int(UnknownError) == int(CborUnknownError));
return QStringLiteral("Unknown error");
case AdvancePastEnd:
- Q_STATIC_ASSERT(int(AdvancePastEnd) == int(CborErrorAdvancePastEOF));
+ static_assert(int(AdvancePastEnd) == int(CborErrorAdvancePastEOF));
return QStringLiteral("Read past end of buffer (more bytes needed)");
case InputOutputError:
- Q_STATIC_ASSERT(int(InputOutputError) == int(CborErrorIO));
+ static_assert(int(InputOutputError) == int(CborErrorIO));
return QStringLiteral("Input/Output error");
case GarbageAtEnd:
- Q_STATIC_ASSERT(int(GarbageAtEnd) == int(CborErrorGarbageAtEnd));
+ static_assert(int(GarbageAtEnd) == int(CborErrorGarbageAtEnd));
return QStringLiteral("Data found after the end of the stream");
case EndOfFile:
- Q_STATIC_ASSERT(int(EndOfFile) == int(CborErrorUnexpectedEOF));
+ static_assert(int(EndOfFile) == int(CborErrorUnexpectedEOF));
return QStringLiteral("Unexpected end of input data (more bytes needed)");
case UnexpectedBreak:
- Q_STATIC_ASSERT(int(UnexpectedBreak) == int(CborErrorUnexpectedBreak));
+ static_assert(int(UnexpectedBreak) == int(CborErrorUnexpectedBreak));
return QStringLiteral("Invalid CBOR stream: unexpected 'break' byte");
case UnknownType:
- Q_STATIC_ASSERT(int(UnknownType) == int(CborErrorUnknownType));
+ static_assert(int(UnknownType) == int(CborErrorUnknownType));
return QStringLiteral("Invalid CBOR stream: unknown type");
case IllegalType:
- Q_STATIC_ASSERT(int(IllegalType) == int(CborErrorIllegalType));
+ static_assert(int(IllegalType) == int(CborErrorIllegalType));
return QStringLiteral("Invalid CBOR stream: illegal type found");
case IllegalNumber:
- Q_STATIC_ASSERT(int(IllegalNumber) == int(CborErrorIllegalNumber));
+ static_assert(int(IllegalNumber) == int(CborErrorIllegalNumber));
return QStringLiteral("Invalid CBOR stream: illegal number encoding (future extension)");
case IllegalSimpleType:
- Q_STATIC_ASSERT(int(IllegalSimpleType) == int(CborErrorIllegalSimpleType));
+ static_assert(int(IllegalSimpleType) == int(CborErrorIllegalSimpleType));
return QStringLiteral("Invalid CBOR stream: illegal simple type");
case InvalidUtf8String:
- Q_STATIC_ASSERT(int(InvalidUtf8String) == int(CborErrorInvalidUtf8TextString));
+ static_assert(int(InvalidUtf8String) == int(CborErrorInvalidUtf8TextString));
return QStringLiteral("Invalid CBOR stream: invalid UTF-8 text string");
case DataTooLarge:
- Q_STATIC_ASSERT(int(DataTooLarge) == int(CborErrorDataTooLarge));
+ static_assert(int(DataTooLarge) == int(CborErrorDataTooLarge));
return QStringLiteral("Internal limitation: data set too large");
case NestingTooDeep:
- Q_STATIC_ASSERT(int(NestingTooDeep) == int(CborErrorNestingTooDeep));
+ static_assert(int(NestingTooDeep) == int(CborErrorNestingTooDeep));
return QStringLiteral("Internal limitation: data nesting too deep");
case UnsupportedType:
- Q_STATIC_ASSERT(int(UnsupportedType) == int(CborErrorUnsupportedType));
+ static_assert(int(UnsupportedType) == int(CborErrorUnsupportedType));
return QStringLiteral("Internal limitation: unsupported type");
}