D14302: Don't block forever in ensureKdeinitRunning

Thiago Macieira noreply at phabricator.kde.org
Tue Jul 24 19:47:34 BST 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180724/a2fc70f6/attachment.html>


More information about the Kde-frameworks-devel mailing list