chore(cpn): Fix compiler warnings when building (#3383)

* Fix build warnings.

* Rename 'flags' function.
This commit is contained in:
philmoz
2023-05-15 11:24:54 +10:00
committed by GitHub
parent 54483e6c4e
commit d29317ecd0
9 changed files with 11 additions and 14 deletions
+1 -2
View File
@@ -39,7 +39,7 @@ class RleBitmap
{ {
public: public:
RleBitmap(const uint8_t *src, size_t offset) : RleBitmap(const uint8_t *src, size_t offset) :
state(RLE_FIRST_BYTE), src(src), curPtr(src), byte(0), curCount(0), pos(0) state(RLE_FIRST_BYTE), curPtr(src), byte(0), curCount(0), pos(0)
{ {
width = *curPtr++; width = *curPtr++;
rawRows = *curPtr++; rawRows = *curPtr++;
@@ -145,7 +145,6 @@ public:
private: private:
enum State {RLE_FIRST_BYTE, RLE_SECOND_BYTE, RLE_CONTINUE} state; enum State {RLE_FIRST_BYTE, RLE_SECOND_BYTE, RLE_CONTINUE} state;
const uint8_t* src;
const uint8_t* curPtr; const uint8_t* curPtr;
uint8_t width; uint8_t width;
-1
View File
@@ -29,7 +29,6 @@
RleFile::RleFile(): RleFile::RleFile():
eeprom(NULL), eeprom(NULL),
eeprom_size(0), eeprom_size(0),
eeFs(NULL),
eeFsArm(NULL), eeFsArm(NULL),
eepromFatHeader(NULL) eepromFatHeader(NULL)
{ {
-1
View File
@@ -94,7 +94,6 @@ class RleFile
unsigned int version; unsigned int version;
uint8_t *eeprom; uint8_t *eeprom;
unsigned int eeprom_size; unsigned int eeprom_size;
EeFs *eeFs;
EeFsArm *eeFsArm; EeFsArm *eeFsArm;
unsigned int eeFsVersion; unsigned int eeFsVersion;
unsigned int eeFsBlockSize; unsigned int eeFsBlockSize;
+1 -1
View File
@@ -138,7 +138,7 @@ bool RepoFilteredItemModel::filterAcceptsRow(int sourceRow, const QModelIndex &
} }
} }
const int RepoFilteredItemModel::flags(const int id) const const int RepoFilteredItemModel::getFlags(const int id) const
{ {
return value(id, RIMR_Flags).toInt(); return value(id, RIMR_Flags).toInt();
} }
+1 -1
View File
@@ -106,7 +106,7 @@ class RepoFilteredItemModel: public QSortFilterProxyModel, public RepoItemModelB
const int count() const { return rowCount(); } const int count() const { return rowCount(); }
const QString date(const int id) const; const QString date(const int id) const;
const int flags(const int id) const; const int getFlags(const int id) const;
const int id(const int row) const ; const int id(const int row) const ;
const int id(const QVariant & value, const Qt::MatchFlags flags = Qt::MatchExactly, const int role = Qt::DisplayRole) const; const int id(const QVariant & value, const Qt::MatchFlags flags = Qt::MatchExactly, const int role = Qt::DisplayRole) const;
const bool isEmpty() const { return rowCount() == 0; } const bool isEmpty() const { return rowCount() == 0; }
+1 -1
View File
@@ -53,7 +53,7 @@ void RepoMetaData::dumpFilteredItemModel() const
const int RepoMetaData::flags() const const int RepoMetaData::flags() const
{ {
return m_filteredItemModel->flags(id()); return m_filteredItemModel->getFlags(id());
} }
int RepoMetaData::getSetId() int RepoMetaData::getSetId()
+5 -5
View File
@@ -84,10 +84,10 @@ class RepoReleases : public QObject, public RepoMetaData
explicit RepoReleases(QObject * parent, UpdateStatus * status, UpdateNetwork * network); explicit RepoReleases(QObject * parent, UpdateStatus * status, UpdateNetwork * network);
virtual ~RepoReleases() {} virtual ~RepoReleases() {}
virtual void init(const QString & repoPath, const QString & nightly, const int resultsPerPage); void init(const QString & repoPath, const QString & nightly, const int resultsPerPage) override;
virtual int setId(const int id) override; int setId(const int id) override;
virtual bool retrieveMetaDataAll(); bool retrieveMetaDataAll() override;
virtual bool retrieveMetaDataOne(const int id) { return false; } // not implemented bool retrieveMetaDataOne(const int id) override { return false; } // not implemented
int channelLatestId(); int channelLatestId();
void setChannel(const int channel); void setChannel(const int channel);
@@ -100,5 +100,5 @@ class RepoReleases : public QObject, public RepoMetaData
ReleasesRawItemModel* const m_rawItemModel; ReleasesRawItemModel* const m_rawItemModel;
ReleasesFilteredItemModel* const m_filteredItemModel; ReleasesFilteredItemModel* const m_filteredItemModel;
virtual void dumpItemModel(const QString modelName, const QAbstractItemModel * itemModel) const; void dumpItemModel(const QString modelName, const QAbstractItemModel * itemModel) const override;
}; };
+1 -1
View File
@@ -560,7 +560,7 @@ const bool UpdateInterface::isReleaseLatest()
const bool UpdateInterface::isSettingsIndexValid() const const bool UpdateInterface::isSettingsIndexValid() const
{ {
return m_id > -1 && m_id < MAX_COMPONENTS; return (int)m_id > -1 && (int)m_id < MAX_COMPONENTS;
} }
const bool UpdateInterface::isUpdateAvailable() const bool UpdateInterface::isUpdateAvailable()
+1 -1
View File
@@ -28,7 +28,7 @@
constexpr char GH_API_VERSION[] {"2022-11-28"}; constexpr char GH_API_VERSION[] {"2022-11-28"};
constexpr char GH_ACCEPT_HEADER_CONTENT[] {"application/octet-stream"}; constexpr char GH_ACCEPT_HEADER_CONTENT[] {"application/octet-stream"};
constexpr char GH_ACCEPT_HEADER_METADATA[] {"application/vnd.github+json"}; constexpr char GH_ACCEPT_HEADER_METADATA[] {"application/vnd.github+json"};
constexpr char GH_ACCEPT_HEADER_RAW[] {"application/vnd.github.raw"}; // constexpr char GH_ACCEPT_HEADER_RAW[] {"application/vnd.github.raw"};
UpdateNetwork::UpdateNetwork(QObject * parent, UpdateStatus * status) : UpdateNetwork::UpdateNetwork(QObject * parent, UpdateStatus * status) :
QObject(parent), QObject(parent),