summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-11-22 14:07:42 +0000
committerJulian Andres Klode <jak@debian.org>2024-11-22 14:07:42 +0000
commitb3c8a3cbb0f51d9cf704ca6a1c050fb50a0fb22d (patch)
treebb6f4b311745f5334d95e0d36c7a2f85384f0ee2 /apt-pkg
parentdcb81196776f5c31063e5f57104b4b021f37aa00 (diff)
parent8c760266c8c736bff62055c008ab74d78f3ed82a (diff)
Merge branch 'fix/warnings' into 'main'
Fix a small bunch of compile-time warnings See merge request apt-team/apt!404
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc4
-rw-r--r--apt-pkg/acquire-item.h12
-rw-r--r--apt-pkg/sourcelist.cc2
3 files changed, 9 insertions, 9 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 12292eb28..73e9940ee 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -717,7 +717,7 @@ bool pkgAcqIndexDiffs::AcquireByHash() const
}
/*}}}*/
-class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/
+class APT_HIDDEN NoActionItem final : public pkgAcquire::Item /*{{{*/
/* The sole purpose of this class is having an item which does nothing to
reach its done state to prevent cleanup deleting the mentioned file.
Handy in cases in which we know we have the file already, like IMS-Hits. */
@@ -741,7 +741,7 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/
}
};
/*}}}*/
-class APT_HIDDEN CleanupItem : public pkgAcqTransactionItem /*{{{*/
+class APT_HIDDEN CleanupItem final : public pkgAcqTransactionItem /*{{{*/
/* This class ensures that a file which was configured but isn't downloaded
for various reasons isn't kept in an old version in the lists directory.
In a way its the reverse of NoActionItem as it helps with removing files
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 22da9815d..cfea61cf6 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -530,7 +530,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
*
* \sa pkgAcqMetaIndex
*/
-class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
+class APT_HIDDEN pkgAcqMetaSig final : public pkgAcqTransactionItem
{
void * const d;
@@ -560,7 +560,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
};
/*}}}*/
/** \brief An item responsible for downloading clearsigned metaindexes {{{*/
-class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
+class APT_HIDDEN pkgAcqMetaClearSig final : public pkgAcqMetaIndex
{
void * const d;
IndexTarget const DetachedDataTarget;
@@ -707,7 +707,7 @@ struct APT_HIDDEN DiffInfo { /*{{{*/
*
* \sa pkgAcqIndexDiffs, pkgAcqIndex
*/
-class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqIndex
+class APT_HIDDEN pkgAcqDiffIndex final : public pkgAcqIndex
{
void * const d;
std::vector<pkgAcqIndexMergeDiffs*> * diffs;
@@ -773,7 +773,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqIndex
*
* \sa pkgAcqDiffIndex, pkgAcqIndex
*/
-class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
+class APT_HIDDEN pkgAcqIndexMergeDiffs final : public pkgAcqBaseIndex
{
protected:
@@ -848,7 +848,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
*
* \sa pkgAcqDiffIndex, pkgAcqIndex
*/
-class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
+class APT_HIDDEN pkgAcqIndexDiffs final : public pkgAcqBaseIndex
{
private:
@@ -1194,7 +1194,7 @@ class APT_PUBLIC pkgAcqFile : public pkgAcquire::Item
virtual ~pkgAcqFile();
};
/*}}}*/
-class APT_HIDDEN pkgAcqAuxFile : public pkgAcqFile /*{{{*/
+class APT_HIDDEN pkgAcqAuxFile final : public pkgAcqFile /*{{{*/
{
pkgAcquire::Item *const Owner;
pkgAcquire::Worker *const Worker;
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 65412b458..819344281 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -614,7 +614,7 @@ bool pkgSourceList::AddVolatileFile(std::string const &File)
/*}}}*/
void pkgSourceList::AddVolatileFiles(CommandLine &CmdL, std::vector<std::string> * const VolatileCmdL)/*{{{*/
{
- std::remove_if(CmdL.FileList + 1, CmdL.FileList + 1 + CmdL.FileSize(), [&](char const * const I) {
+ (void)std::remove_if(CmdL.FileList + 1, CmdL.FileList + 1 + CmdL.FileSize(), [&](char const * const I) {
if (I != nullptr && (I[0] == '/' || (I[0] == '.' && (I[1] == '\0' || (I[1] == '.' && (I[2] == '\0' || I[2] == '/')) || I[1] == '/'))))
{
if (AddVolatileFile(I, VolatileCmdL))