From b52c6552c44fcb997b0db9f5e9f17b4674dd5359 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 30 Apr 2019 12:07:07 +0200 Subject: Add 'explicit' to most single argument constructors This prevents implicit conversions that we do not want, such as having a FileFd* being converted to a debListParser. Two cases are not yet handled because they require changes in code using them: 1. The classes in hashes.h 2. The URI class - this one is used quite a lot --- apt-pkg/deb/debindexfile.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/deb/debindexfile.h') diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 5c89f9c54..222fed229 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -44,7 +44,7 @@ public: virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; - debStatusIndex(std::string const &File); + explicit debStatusIndex(std::string const &File); virtual ~debStatusIndex(); }; @@ -83,7 +83,7 @@ public: // Interface for the Cache Generator virtual bool HasPackages() const APT_OVERRIDE; - debTranslationsIndex(IndexTarget const &Target); + explicit debTranslationsIndex(IndexTarget const &Target); virtual ~debTranslationsIndex(); }; @@ -141,7 +141,7 @@ public: // Interface for acquire - debDebPkgFileIndex(std::string const &DebFile); + explicit debDebPkgFileIndex(std::string const &DebFile); virtual ~debDebPkgFileIndex(); //FIXME: use proper virtual-handling on next ABI break @@ -162,7 +162,7 @@ public: virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE {return false;}; - debDscFileIndex(std::string const &DscFile); + explicit debDscFileIndex(std::string const &DscFile); virtual ~debDscFileIndex(); }; @@ -191,7 +191,7 @@ public: // Abort if the file does not exist. virtual bool Exists() const APT_OVERRIDE {return true;}; - debStringPackageIndex(std::string const &content); + explicit debStringPackageIndex(std::string const &content); virtual ~debStringPackageIndex(); }; #endif -- cgit v1.2.3