From 534b6f3fb3a4bd14d78942cab7eb430dd98e471c Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 23 Apr 2022 19:46:58 +0200 Subject: SLICE() Add a macro to make slicing clear in the code and quiet for static analysis. --- lib/e2ee/qolmmessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/e2ee') diff --git a/lib/e2ee/qolmmessage.cpp b/lib/e2ee/qolmmessage.cpp index 81b166b0..f9b4a5c2 100644 --- a/lib/e2ee/qolmmessage.cpp +++ b/lib/e2ee/qolmmessage.cpp @@ -4,6 +4,8 @@ #include "qolmmessage.h" +#include "util.h" + using namespace Quotient; QOlmMessage::QOlmMessage(QByteArray ciphertext, QOlmMessage::Type type) @@ -26,7 +28,7 @@ QOlmMessage::Type QOlmMessage::type() const QByteArray QOlmMessage::toCiphertext() const { - return QByteArray(*this); + return SLICE(*this, QByteArray); } QOlmMessage QOlmMessage::fromCiphertext(const QByteArray &ciphertext) -- cgit v1.2.3