From 8a477e689e58eb9cc2bc30bd3a2cd19fb61c866e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 11 Sep 2017 12:01:39 +0100 Subject: [PATCH] Minor clang warnings++ --- src/core/copysourceshred.h | 2 +- src/core/partitiontable.cpp | 2 +- src/core/partitiontable.h | 2 +- src/gui/partresizerwidget.cpp | 4 ++-- src/jobs/setpartflagsjob.cpp | 2 +- src/ops/resizeoperation.cpp | 2 +- src/util/capacity.cpp | 3 +-- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/copysourceshred.h b/src/core/copysourceshred.h index b66b1fa..43bc09d 100644 --- a/src/core/copysourceshred.h +++ b/src/core/copysourceshred.h @@ -61,7 +61,7 @@ protected: const QFile& sourceFile() const { return m_SourceFile; } - qint32 size() const { + qint64 size() const { return m_Size; } diff --git a/src/core/partitiontable.cpp b/src/core/partitiontable.cpp index e793bb0..cbf4914 100644 --- a/src/core/partitiontable.cpp +++ b/src/core/partitiontable.cpp @@ -483,7 +483,7 @@ QString PartitionTable::tableTypeToName(TableType l) return xi18nc("@item partition table name", "unknown"); } -qint64 PartitionTable::maxPrimariesForTableType(TableType l) +qint32 PartitionTable::maxPrimariesForTableType(TableType l) { for (const auto &type : tableTypes) if (l == type.type) diff --git a/src/core/partitiontable.h b/src/core/partitiontable.h index 60acf9c..49b887a 100644 --- a/src/core/partitiontable.h +++ b/src/core/partitiontable.h @@ -179,7 +179,7 @@ public: static PartitionTable::TableType nameToTableType(const QString& n); static QString tableTypeToName(TableType l); - static qint64 maxPrimariesForTableType(TableType l); + static qint32 maxPrimariesForTableType(TableType l); static bool tableTypeSupportsExtended(TableType l); static bool tableTypeIsReadOnly(TableType l); diff --git a/src/gui/partresizerwidget.cpp b/src/gui/partresizerwidget.cpp index 6753384..eb4d4d9 100644 --- a/src/gui/partresizerwidget.cpp +++ b/src/gui/partresizerwidget.cpp @@ -98,11 +98,11 @@ void PartResizerWidget::init(Device& d, Partition& p, qint64 minFirst, qint64 ma if (!readOnly()) { QPixmap pixmap(handleWidth(), handleHeight()); pixmap.fill(Qt::transparent); - QPainter p(&pixmap); + QPainter painter(&pixmap); QStyleOption opt; opt.state |= QStyle::State_Horizontal; opt.rect = pixmap.rect().adjusted(0, 2, 0, -2); - style()->drawControl(QStyle::CE_Splitter, &opt, &p, this); + style()->drawControl(QStyle::CE_Splitter, &opt, &painter, this); if (moveAllowed()) leftHandle().setPixmap(pixmap); diff --git a/src/jobs/setpartflagsjob.cpp b/src/jobs/setpartflagsjob.cpp index dfa1a9b..5947e07 100644 --- a/src/jobs/setpartflagsjob.cpp +++ b/src/jobs/setpartflagsjob.cpp @@ -68,7 +68,7 @@ bool SetPartFlagsJob::run(Report& parent) : backendPartitionTable->getPartitionBySector(partition().firstSector()); if (backendPartition) { - quint32 count = 0; + int count = 0; for (const auto &f : PartitionTable::flagList()) { emit progress(++count); diff --git a/src/ops/resizeoperation.cpp b/src/ops/resizeoperation.cpp index 290a6ab..37cf627 100644 --- a/src/ops/resizeoperation.cpp +++ b/src/ops/resizeoperation.cpp @@ -227,7 +227,7 @@ QString ResizeOperation::description() const case MoveRightShrink: return xi18nc("@info:status describe resize/move action", "Move partition %1 to the right by %2 and shrink it from %3 to %4", partition().deviceNode(), moveDelta, origCapacity, newCapacity); - default: + case None: qWarning() << "Could not determine what to do with partition " << partition().deviceNode() << "."; break; } diff --git a/src/util/capacity.cpp b/src/util/capacity.cpp index 092f91e..9e8d6fa 100644 --- a/src/util/capacity.cpp +++ b/src/util/capacity.cpp @@ -46,8 +46,7 @@ Capacity::Capacity(const Partition& p, Type t) : switch (t) { case Used: m_Size = p.used(); break; case Available: m_Size = p.available(); break; - case Total: m_Size = p.capacity(); break; - default: break; + case Total: m_Size = p.capacity(); } }