[mythtv-firehose] mythtv/master commit: 1e2947b69 by Gavin Hurlbut (Beirdo)

MythTV noreply at mythtv.org
Mon Feb 13 01:03:06 UTC 2012


      Author:  Gavin Hurlbut <ghurlbut at mythtv.org>
 Change Date:  2012-02-12T17:02:36-08:00
   Push Date:  2012/02/12 17:02:43 -0800
  Repository:  mythtv
      Branch:  master
New Revision:  1e2947b698529c7302e6dd2654e6804685b1c224
   Changeset:  https://github.com/MythTV/mythtv/commit/1e2947b69

Log:

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.

Modified:

   mythtv/libs/libmythupnp/upnpcds.cpp
   mythtv/libs/libmythupnp/upnputil.cpp



More information about the mythtv-firehose mailing list