From e6baaee4968345a53e977f593362267a91041cff Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Fri, 21 Oct 2016 20:12:50 +0200 Subject: [PATCH] Cosmetic & readability changes Backport patch from https://github.com/csete/gqrx/commit/e6baaee4968345a53e977f593362267a91041cff Fix compilation in gcc-6 Signed-off-by: Valentin Ochs Signed-off-by: Gwenhael Goavec-Merou --- diff --git a/src/qtgui/plotter.cpp b/src/qtgui/plotter.cpp index e491632..b877546 100644 --- a/src/qtgui/plotter.cpp +++ b/src/qtgui/plotter.cpp @@ -1336,8 +1336,11 @@ void CPlotter::drawOverlay() #endif int level = 0; - for (; level < nLevels && tagEnd[level] > x; level++); - level %= nLevels; + while(level < nLevels && tagEnd[level] > x) + level++; + + if(level == nLevels) + level = 0; tagEnd[level] = x + nameWidth + slant - 1; m_BookmarkTags.append(qMakePair(QRect(x, level * levelHeight, nameWidth + slant, fontHeight), bookmarks[i].frequency)); -- 2.10.2