thiago added a comment.
Quickly checking on openSUSE Tumbleweed In D14302#297185 <https://phabricator.kde.org/D14302#297185>, @lvsouza wrote: > I think I know what is happening. This line > > QDeadlineTimer timer(qMax(timeout, -1)); // QDT only takes -1 as "forever" > > passes the result of qMax() to QDeadlineTimer's constructor. That constructor receives a quint64. Since qMax() is a template: The constructor takes a qint64, not a quint64. > inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; } > > it will use the type of the assigned variable (quint64 in this case) as T and casting -1 to INT64_MAX. Changing the line to: Again, incorrect. It will use the type T, which must be the same for both arguments. The timeout parameter is int and the -1 literal is int. So the comparison is performed in int, which should return 0. REPOSITORY R271 KDBusAddons REVISION DETAIL https://phabricator.kde.org/D14302 To: jtamate, dfaure, #frameworks, thiago Cc: lvsouza, kde-frameworks-devel, michaelh, ngraham, bruns