From cd5a60089a1554e764a69f21fc621d0ce53f57e7 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 20 Apr 2021 11:02:11 +0200 Subject: [PATCH] Avoid combining enum values from different enum types Fixes static analyzer warnings. Task-number: QTBUG-91911 Change-Id: I55599d53bb98ada74ceb73d5668fcc18813c3ec4 Reviewed-by: Volker Hilsheimer --- src/gui/painting/qpen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index 229384587e..978c96af96 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -909,9 +909,9 @@ QDataStream &operator<<(QDataStream &s, const QPen &p) if (s.version() < 3) { s << (quint8)p.style(); } else if (s.version() < QDataStream::Qt_4_3) { - s << (quint8)(p.style() | p.capStyle() | p.joinStyle()); + s << (quint8)(uint(p.style()) | uint(p.capStyle()) | uint(p.joinStyle())); } else { - s << (quint16)(p.style() | p.capStyle() | p.joinStyle()); + s << (quint16)(uint(p.style()) | uint(p.capStyle()) | uint(p.joinStyle())); s << (bool)(dd->cosmetic); }