Fix uninitialized variable warning in ProgramViewer
MODIFY
src/programviewer.cpp
src/programviewer.cpp
@@ -186,11 +186,10 @@ void ProgramViewer::breakpointAreaPaintEvent(QPaintEvent* event) {
painter.fillRect(area, gradient);
QTextBlock block = firstVisibleBlock();
- int top, bottom;
if (block.isValid()) {
+ int top, bottom;
top = static_cast<int>(blockBoundingGeometry(block).translated(contentOffset()).top());
bottom = top + static_cast<int>(blockBoundingRect(block).height());
- }
bool ok;
while (block.isValid() && top <= event->rect().bottom()) {
@@ -209,6 +208,7 @@ void ProgramViewer::breakpointAreaPaintEvent(QPaintEvent* event) {
bottom = top + static_cast<int>(blockBoundingRect(block).height());
}
}
+}
QTextBlock ProgramViewer::blockForAddress(AInt addr) const {
const uint64_t adjustedLineNumber =

Fix uninitialized variable warning in ProgramViewer