summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-17 10:01:21 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-17 10:52:07 (GMT)
commit213e2c937b667dba7e4996b0857ae5791c6d5fc8 (patch)
treeb8db403c4859966fa7a18fcf413a00cf8e3eecd4
parent83940f25dba51a9942ab55ed8475fc7fc8a8da84 (diff)
downloadQt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.zip
Qt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.tar.gz
Qt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.tar.bz2
Fixed coverity warnings
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/gui/itemviews/qlistview.cpp1
-rw-r--r--src/gui/itemviews/qlistview_p.h7
-rw-r--r--src/gui/itemviews/qtreewidget.cpp1
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/styles/qstyleoption.cpp6
-rw-r--r--src/gui/text/qcssparser_p.h2
-rw-r--r--src/xml/dom/qdom.cpp5
8 files changed, 13 insertions, 13 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 4108136..35b85c3 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -811,7 +811,7 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
#endif
if (readFromDevice < bytesToBuffer)
- d->buffer.truncate(readFromDevice < 0 ? 0 : int(readFromDevice));
+ d->buffer.truncate(int(readFromDevice));
if (!d->buffer.isEmpty()) {
lastReadChunkSize = d->buffer.read(data + readSoFar, maxSize - readSoFar);
readSoFar += lastReadChunkSize;
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 1870a3b..3ab3204 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1957,7 +1957,6 @@ bool QListView::event(QEvent *e)
QListViewPrivate::QListViewPrivate()
: QAbstractItemViewPrivate(),
dynamicListView(0),
- staticListView(0),
wrap(false),
space(0),
flow(QListView::TopToBottom),
diff --git a/src/gui/itemviews/qlistview_p.h b/src/gui/itemviews/qlistview_p.h
index 1131059..6c8d324 100644
--- a/src/gui/itemviews/qlistview_p.h
+++ b/src/gui/itemviews/qlistview_p.h
@@ -351,9 +351,10 @@ public:
QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const;
- // ### FIXME: we only need one at a time
- QDynamicListViewBase *dynamicListView;
- QStaticListViewBase *staticListView;
+ union {
+ QDynamicListViewBase *dynamicListView;
+ QStaticListViewBase *staticListView;
+ };
// ### FIXME: see if we can move the members into the dynamic/static classes
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 025f83c..1ab69df 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -1768,6 +1768,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
// special case for check state in tristate
if (children.count() && (itemFlags & Qt::ItemIsTristate))
return childrenCheckState(column);
+ // fallthrough intended
default:
if (column >= 0 && column < values.size()) {
const QVector<QWidgetItemData> &column_values = values.at(column);
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 6a7889a..478a2a8 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -313,7 +313,7 @@ QByteArray QPdf::generatePath(const QPainterPath &path, const QTransform &matrix
Qt::FillRule fillRule = path.fillRule();
- const char *op = 0;
+ const char *op = "";
switch (flags) {
case ClipPath:
op = (fillRule == Qt::WindingFill) ? "W n\n" : "W* n\n";
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index 98996e2..eabbb8d 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -712,7 +712,7 @@ QStyleOptionFrameV2 &QStyleOptionFrameV2::operator=(const QStyleOptionFrame &oth
Constructs a QStyleOptionFrameV3 object.
*/
QStyleOptionFrameV3::QStyleOptionFrameV3()
- : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame)
+ : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame), unused(0)
{
}
@@ -726,7 +726,7 @@ QStyleOptionFrameV3::QStyleOptionFrameV3()
\internal
*/
QStyleOptionFrameV3::QStyleOptionFrameV3(int version)
- : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame)
+ : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame), unused(0)
{
}
@@ -4845,7 +4845,7 @@ QStyleOptionTabBarBaseV2 &QStyleOptionTabBarBaseV2::operator = (const QStyleOpti
/*! \internal */
QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(int version)
- : QStyleOptionTabBarBase(version)
+ : QStyleOptionTabBarBase(version), documentMode(false)
{
}
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index c685b08..6f73445 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -504,7 +504,7 @@ const int NumPseudos = 46;
struct Pseudo
{
- Pseudo() : negated(false) { }
+ Pseudo() : type(0), negated(false) { }
quint64 type;
QString name;
QString function;
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index a7dfaa9..85a31c7 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -1845,8 +1845,7 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
oldChild->prev = 0;
// We are no longer interested in the old node
- if (oldChild)
- oldChild->ref.deref();
+ oldChild->ref.deref();
return oldChild;
}
@@ -4355,7 +4354,7 @@ bool QDomAttr::specified() const
QDomElement QDomAttr::ownerElement() const
{
Q_ASSERT(impl->parent());
- if (!impl || !impl->parent()->isElement())
+ if (!impl->parent()->isElement())
return QDomElement();
return QDomElement((QDomElementPrivate*)(impl->parent()));
}