summaryrefslogtreecommitdiff
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
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
-rw-r--r--CMake/Documentation.cmake4
-rw-r--r--apt-pkg/acquire-item.cc4
-rw-r--r--apt-pkg/acquire-item.h12
-rw-r--r--apt-pkg/sourcelist.cc2
-rw-r--r--apt-private/private-cacheset.h1
-rw-r--r--apt-private/private-install.cc2
-rw-r--r--doc/CMakeLists.txt7
-rw-r--r--doc/examples/CMakeLists.txt2
-rw-r--r--methods/connect.cc4
-rw-r--r--methods/copy.cc2
-rw-r--r--methods/file.cc2
-rw-r--r--methods/http.cc2
-rw-r--r--methods/http.h4
-rw-r--r--methods/rred.cc2
-rw-r--r--methods/store.cc2
-rw-r--r--test/libapt/stringview_test.cc3
16 files changed, 30 insertions, 25 deletions
diff --git a/CMake/Documentation.cmake b/CMake/Documentation.cmake
index f3eb4c5e1..d7f136020 100644
--- a/CMake/Documentation.cmake
+++ b/CMake/Documentation.cmake
@@ -154,14 +154,16 @@ function(xsltproc_one)
if (DOC_MANPAGE)
if (language)
set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${language}/${document}.${section}")
+ set(manpage_l10npath "/${language}")
else()
+ set(manpage_l10npath "")
set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.${section}")
endif()
set(manpage_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl")
set(manpage_params)
install(FILES ${manpage_output}
- DESTINATION ${CMAKE_INSTALL_MANDIR}/${language}/man${section}
+ DESTINATION ${CMAKE_INSTALL_MANDIR}${manpage_l10npath}/man${section}
OPTIONAL)
endif()
if (DOC_HTML)
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))
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index e8dba5a7d..cad8e4a00 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -68,6 +68,7 @@ class Matcher {
public:
virtual bool operator () (const pkgCache::PkgIterator &/*P*/) {
return true;}
+ virtual ~Matcher() = default;
};
// FIXME: add default argument for OpProgress (or overloaded function)
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 57b5c0d5e..3f05cf9fb 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -986,7 +986,7 @@ std::vector<PseudoPkg> GetAllPackagesAsPseudo(pkgSourceList *const SL, CommandLi
std::vector<PseudoPkg> GetPseudoPackages(pkgSourceList *const SL, CommandLine &CmdL, bool (*Add)(pkgSourceList *const, PseudoPkg &&, std::vector<PseudoPkg> &), std::string const &pseudoArch)/*{{{*/
{
std::vector<PseudoPkg> 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) {
return AddIfVolatile(SL, VolatileCmdL, Add, I, pseudoArch);
});
return VolatileCmdL;
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 72a1fed88..493c36c08 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -22,13 +22,14 @@ set(ENTITIES
apt-verbatim.ent
../vendor/${CURRENT_VENDOR}/apt-vendor.ent
)
+set(USR_SHARE_DOC "${CMAKE_INSTALL_DATAROOTDIR}/doc")
if(WITH_DOC OR WITH_DOC_GUIDES)
add_docbook(apt-doc HTML TEXT ALL
DOCUMENTS
guide.dbk
offline.dbk
- INSTALL ${CMAKE_INSTALL_DOCDIR}/../apt-doc
+ INSTALL ${USR_SHARE_DOC}/apt-doc
LINGUAS ${LINGUAS}
TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES}
DEPENDS ${ENTITIES}
@@ -40,7 +41,7 @@ add_docbook(libapt-pkg-doc HTML TEXT ALL
dpkg-tech.dbk
files.dbk
method.dbk
- INSTALL ${CMAKE_INSTALL_DOCDIR}/../libapt-pkg-doc
+ INSTALL ${USR_SHARE_DOC}/libapt-pkg-doc
LINGUAS ${LINGUAS}
TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES}
DEPENDS ${ENTITIES}
@@ -65,7 +66,7 @@ add_custom_target(apt-doxygen ALL
)
install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/doxygen/html
- DESTINATION ${CMAKE_INSTALL_DOCDIR}/../libapt-pkg-doc
+ DESTINATION ${USR_SHARE_DOC}/libapt-pkg-doc
PATTERN "*.map" EXCLUDE
PATTERN "*.md5" EXCLUDE
)
diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt
index 8d9ea068f..be638d081 100644
--- a/doc/examples/CMakeLists.txt
+++ b/doc/examples/CMakeLists.txt
@@ -1,4 +1,4 @@
install(FILES apt.conf configure-index preferences
DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
install(FILES apt-ftparchive.conf ftp-archive.conf
- DESTINATION ${CMAKE_INSTALL_DOCDIR}/../apt-utils/examples)
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/apt-utils/examples)
diff --git a/methods/connect.cc b/methods/connect.cc
index f3e199d0a..12847c594 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -85,7 +85,7 @@ static bool ConnectionAllowed(char const * const Service, std::string const &Hos
/*}}}*/
// File Descriptor based Fd /*{{{*/
-struct FdFd : public MethodFd
+struct FdFd final : public MethodFd
{
int fd = -1;
int Fd() APT_OVERRIDE { return fd; }
@@ -805,7 +805,7 @@ ResultState UnwrapSocks(std::string Host, int Port, URI Proxy, std::unique_ptr<M
// UnwrapTLS - Handle TLS connections /*{{{*/
// ---------------------------------------------------------------------
/* Performs a TLS handshake on the socket */
-struct TlsFd : public MethodFd
+struct TlsFd final : public MethodFd
{
std::unique_ptr<MethodFd> UnderlyingFd;
gnutls_session_t session;
diff --git a/methods/copy.cc b/methods/copy.cc
index 82eed150c..44205e4cd 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -24,7 +24,7 @@
#include <apti18n.h>
/*}}}*/
-class CopyMethod : public aptMethod
+class CopyMethod final : public aptMethod
{
virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE;
diff --git a/methods/file.cc b/methods/file.cc
index b2fe133f2..0a76c0c94 100644
--- a/methods/file.cc
+++ b/methods/file.cc
@@ -27,7 +27,7 @@
#include <apti18n.h>
/*}}}*/
-class FileMethod : public aptMethod
+class FileMethod final : public aptMethod
{
virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE;
diff --git a/methods/http.cc b/methods/http.cc
index 4d0e60d93..1e76a1f57 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -279,7 +279,7 @@ CircleBuf::~CircleBuf() /*{{{*/
// UnwrapHTTPConnect - Does the HTTP CONNECT handshake /*{{{*/
// ---------------------------------------------------------------------
/* Performs a TLS handshake on the socket */
-struct HttpConnectFd : public MethodFd
+struct HttpConnectFd final : public MethodFd
{
std::unique_ptr<MethodFd> UnderlyingFd;
std::string Buffer;
diff --git a/methods/http.h b/methods/http.h
index cae579afe..5bfcbc8a2 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -90,7 +90,7 @@ class CircleBuf
~CircleBuf();
};
-struct HttpServerState: public ServerState
+struct HttpServerState final : public ServerState
{
// This is the connection itself. Output is data FROM the server
CircleBuf In;
@@ -121,7 +121,7 @@ struct HttpServerState: public ServerState
virtual ~HttpServerState() {Close();};
};
-class HttpMethod : public BaseHttpMethod
+class HttpMethod final : public BaseHttpMethod
{
public:
virtual void SendReq(FetchItem *Itm) APT_OVERRIDE;
diff --git a/methods/rred.cc b/methods/rred.cc
index aeefea5a2..bef2e969e 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -598,7 +598,7 @@ class Patch {
};
#ifndef APT_EXCLUDE_RRED_METHOD_CODE
-class RredMethod : public aptMethod {
+class RredMethod final : public aptMethod {
private:
bool Debug;
diff --git a/methods/store.cc b/methods/store.cc
index 23d6b43d0..ed2eb3fe1 100644
--- a/methods/store.cc
+++ b/methods/store.cc
@@ -31,7 +31,7 @@
#include <apti18n.h>
/*}}}*/
-class StoreMethod : public aptMethod
+class StoreMethod final : public aptMethod
{
virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE;
diff --git a/test/libapt/stringview_test.cc b/test/libapt/stringview_test.cc
index 5abb7a8e1..5b82a0da5 100644
--- a/test/libapt/stringview_test.cc
+++ b/test/libapt/stringview_test.cc
@@ -35,7 +35,8 @@ TEST(StringViewTest,FooString)
static_assert( 3 == defString.length(), "def right size");
EXPECT_EQ(0, defString.to_string().compare(0, defString.length(), defString.data(), 3));
- APT::StringView strString{std::string{"foo"}};
+ std::string strstr{"foo"};
+ APT::StringView strString{strstr};
EXPECT_EQ(3u, strString.length());
EXPECT_EQ(0, strString.to_string().compare(0, strString.length(), strString.data(), 3));