From d67abb9de150bce764e263757aa2f0544faeedf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Thu, 1 Jun 2023 10:50:12 +0300 Subject: [PATCH] CTF: Use static with operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also fix coding style in the operator. Pick-to: 6.5 Change-Id: Ia8f85a7bb7aa2d6f55923c80f72b734fc8dbd693 Reviewed-by: Hatem ElKharashy Reviewed-by: Janne Koskinen Reviewed-by: Antti Määttä --- src/plugins/tracing/qctflib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/tracing/qctflib.cpp b/src/plugins/tracing/qctflib.cpp index 3690bb63702..367ee3c3c8e 100644 --- a/src/plugins/tracing/qctflib.cpp +++ b/src/plugins/tracing/qctflib.cpp @@ -31,10 +31,10 @@ static const char traceMetadataTemplate[] = static const size_t traceMetadataSize = sizeof(traceMetadataTemplate); template -QByteArray &operator<<(QByteArray &arr, T val) +static QByteArray &operator<<(QByteArray &arr, T val) { static_assert(std::is_arithmetic_v); - arr.append((char *)&val, sizeof(val)); + arr.append(reinterpret_cast(&val), sizeof(val)); return arr; }