From e8afd16892e87a6e2f17c1019ee455f5583387c2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 00:14:10 +0200 Subject: apply various style suggestions by cppcheck Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore --- apt-pkg/cacheset.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-pkg/cacheset.h') diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 1a6feb5f7..7fd740335 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -265,7 +265,7 @@ APT_IGNORE_DEPRECATED_POP void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; } CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; } PackageContainerInterface(); - PackageContainerInterface(CacheSetHelper::PkgSelector const by); + explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by); virtual ~PackageContainerInterface(); APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { @@ -310,7 +310,7 @@ public: /*{{{*/ public std::iterator { typename Container::const_iterator _iter; public: - const_iterator(typename Container::const_iterator i) : _iter(i) {} + explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } operator typename Container::const_iterator(void) const { return _iter; } @@ -324,7 +324,7 @@ public: /*{{{*/ public std::iterator { typename Container::iterator _iter; public: - iterator(typename Container::iterator i) : _iter(i) {} + explicit iterator(typename Container::iterator i) : _iter(i) {} pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } operator typename Container::iterator(void) const { return _iter; } @@ -359,7 +359,7 @@ public: /*{{{*/ const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); } PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {} - PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {} + explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {} APT_IGNORE_DEPRECATED_PUSH APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {} APT_IGNORE_DEPRECATED_POP @@ -568,7 +568,7 @@ public: APT_PUBLIC iterator begin() { return _cont->PkgBegin(); } APT_PUBLIC iterator end() { return _cont->PkgEnd(); } - APT_PUBLIC PackageUniverse(pkgCache * const Owner); + explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner); APT_PUBLIC virtual ~PackageUniverse(); private: @@ -744,7 +744,7 @@ public: /*{{{*/ public std::iterator {/*{{{*/ typename Container::const_iterator _iter; public: - const_iterator(typename Container::const_iterator i) : _iter(i) {} + explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } operator typename Container::const_iterator(void) const { return _iter; } @@ -758,7 +758,7 @@ public: /*{{{*/ public std::iterator { typename Container::iterator _iter; public: - iterator(typename Container::iterator i) : _iter(i) {} + explicit iterator(typename Container::iterator i) : _iter(i) {} pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } operator typename Container::iterator(void) const { return _iter; } -- cgit v1.2.3-70-g09d2