Skip to content

Commit 2846508

Browse files
committed
Fix a compile error under newer compilers
i is unsigned, so abs() would be meaningless. Explicitly cast it to signed to make it work.
1 parent d86cf94 commit 2846508

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/rootwindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void RootWindow::animateButtons(Example *example, float from, float to, float de
9494
Button *button = static_cast<Button *>(m_buttonGrid->child());
9595
for (unsigned i=0; i<m_examples.size(); ++i) {
9696
assert(button);
97-
int distance = abs(pos - i);
97+
int distance = abs(pos - (int)i);
9898
button->scheduleRotation(from, to, 0.3, delay + distance * 0.05);
9999
button = static_cast<Button *>(button->sibling());
100100
}

0 commit comments

Comments
 (0)