Base: cppcoreguidelines

This commit is contained in:
wmayer
2023-11-23 17:25:37 +01:00
committed by wwmayer
parent b5adfff293
commit c2694fd7d9
11 changed files with 51 additions and 55 deletions

View File

@@ -60,6 +60,7 @@ struct StdInputStream::TextCodec
{
QTextCodec* textCodec = QTextCodec::codecForName("UTF-8");
if (textCodec) {
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
const QString text = textCodec->toUnicode(reinterpret_cast<char*>(toFill),
static_cast<int>(len),
&state);
@@ -85,6 +86,7 @@ struct StdInputStream::TextCodec
{
void validateBytes(XMLByte* const toFill, std::streamsize len)
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
QByteArray encodedString(reinterpret_cast<char*>(toFill), static_cast<int>(len));
auto toUtf16 = QStringDecoder(QStringDecoder::Utf8);
QString text = toUtf16(encodedString);
@@ -133,7 +135,7 @@ XMLSize_t StdInputStream::readBytes(XMLByte* const toFill, const XMLSize_t maxTo
// Read up to the maximum bytes requested. We return the number
// actually read.
//
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
stream.read(reinterpret_cast<char*>(toFill), static_cast<std::streamsize>(maxToRead));
std::streamsize len = stream.gcount();