From: Uwe Hermann Date: Mon, 21 May 2018 14:38:13 +0000 (+0200) Subject: tracegroup.cpp: Fix a potential unintended integer division. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c3b911b571c430cecf563a1d2234698e6aff6c34;p=pulseview.git tracegroup.cpp: Fix a potential unintended integer division. Reported by Coverity (CID 279773): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions -5 and 2, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. --- diff --git a/pv/views/trace/tracegroup.cpp b/pv/views/trace/tracegroup.cpp index 3fbb864e..6df8f650 100644 --- a/pv/views/trace/tracegroup.cpp +++ b/pv/views/trace/tracegroup.cpp @@ -85,8 +85,8 @@ pair TraceGroup::v_extents() const void TraceGroup::paint_label(QPainter &p, const QRect &rect, bool hover) { const QRectF r = label_rect(rect).adjusted( - LineThickness / 2, LineThickness / 2, - -LineThickness / 2, -LineThickness / 2); + LineThickness / 2.0, LineThickness / 2.0, + -LineThickness / 2.0, -LineThickness / 2.0); // Paint the label const QPointF points[] = {