summaryrefslogtreecommitdiff
path: root/examples/triage/byte.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2020-05-28 19:37:36 -0400
committerRusty Wagner <rusty@vector35.com>2020-05-29 23:59:09 -0400
commitc5ae680e93164baf7499ac6822ab0621a5af24d6 (patch)
treea675a7cc47f613ac4924daba8acced8e21119d56 /examples/triage/byte.cpp
parent13b7a030ad88730d4fde7dfbe27f6d0b0ae65084 (diff)
Update to Qt 5.15
Diffstat (limited to 'examples/triage/byte.cpp')
-rw-r--r--examples/triage/byte.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/triage/byte.cpp b/examples/triage/byte.cpp
index cac2c587..db614dec 100644
--- a/examples/triage/byte.cpp
+++ b/examples/triage/byte.cpp
@@ -145,16 +145,17 @@ uint64_t ByteView::getCurrentOffset()
}
-void ByteView::getSelectionOffsets(uint64_t& start, uint64_t& end)
+BNAddressRange ByteView::getSelectionOffsets()
{
- start = m_selectionStartAddr;
- end = m_cursorAddr;
+ uint64_t start = m_selectionStartAddr;
+ uint64_t end = m_cursorAddr;
if (end < start)
{
uint64_t t = start;
start = end;
end = t;
}
+ return { start, end };
}
@@ -580,9 +581,8 @@ void ByteView::paintEvent(QPaintEvent* event)
// Compute selection range
bool selection = false;
- uint64_t selStart, selEnd;
- getSelectionOffsets(selStart, selEnd);
- if (selStart != selEnd)
+ BNAddressRange selectionRange = getSelectionOffsets();
+ if (selectionRange.start != selectionRange.end)
selection = true;
// Draw selection
@@ -596,18 +596,18 @@ void ByteView::paintEvent(QPaintEvent* event)
int endX = 0;
for (size_t i = 0; i < m_lines.size(); i++)
{
- if (selStart >= m_lines[i].address)
+ if (selectionRange.start >= m_lines[i].address)
{
startY = (int)(i - m_topLine);
- startX = (int)(selStart - m_lines[i].address);
+ startX = (int)(selectionRange.start - m_lines[i].address);
if (startX > (int)m_cols)
startX = (int)m_cols;
startValid = true;
}
- if (selEnd >= m_lines[i].address)
+ if (selectionRange.end >= m_lines[i].address)
{
endY = (int)(i - m_topLine);
- endX = (int)(selEnd - m_lines[i].address);
+ endX = (int)(selectionRange.end - m_lines[i].address);
if (endX > (int)m_cols)
endX = (int)m_cols;
endValid = true;