Please sign in to comment.
Silence some pesky QList assertion warnings
Seems that in profile build mode, we get a lot of warnings like the two being silenced here: /usr/include/qt4/QtCore/qlist.h: In function ‘QString LookupUDN(QString)’: /usr/include/qt4/QtCore/qlist.h:447: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false and /usr/include/qt4/QtCore/qlist.h: In member function ‘virtual UPnpCDSExtensionResults* UPnpCDSExtension::ProcessKey(UPnpCDSRequest*, UPnpCDSExtensionResults*, QStringList&)’: /usr/include/qt4/QtCore/qlist.h:447: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false This turns out to be from QList's  operator and it's built-in range-check. When you feed it with "blah.size() - 2", GCC complains as it is not sure that blah.size() - 2 > blah.size() is always false. To get around this, I have restructured the code not to use this construct, but instead using removeLast() to drop the last item of the list (it's not used later), and then takeLast() to grab the second-last item. Note that this is what blah.size() - 2 is looking for as  is 0-based. Additionally, as Qt docs say it is more efficient, I have changed some blah.size() == 0 to blah.isEmpty() and the like.
- Loading branch information...
Showing with 12 additions and 14 deletions.