summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-11-04 21:08:55 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-05 12:21:33 +0100
commit258b9e512c4001e806c5c0966acecd3d742ec6e9 (patch)
treec8bdbb43dd9e1b5d54b90e4845065a653d585ca5 /apt-private
parent9fb4e6510faaa9c84b88d4cb567bf3deebf8e0b7 (diff)
downloadapt-258b9e512c4001e806c5c0966acecd3d742ec6e9.tar.gz
apply various suggestions made by cppcheck
Reported-By: cppcheck Git-Dch: Ignore
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/acqprogress.cc3
-rw-r--r--apt-private/private-cachefile.h2
-rw-r--r--apt-private/private-cacheset.cc6
-rw-r--r--apt-private/private-cacheset.h2
-rw-r--r--apt-private/private-install.cc2
-rw-r--r--apt-private/private-list.cc2
-rw-r--r--apt-private/private-show.cc2
7 files changed, 8 insertions, 11 deletions
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index dcc538a39..a33d51c71 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -176,8 +176,6 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
if (Quiet > 0)
return true;
- enum {Long = 0,Medium,Short} Mode = Medium;
-
std::string Line;
{
std::stringstream S;
@@ -203,6 +201,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
if (I->CurrentItem->Owner->ActiveSubprocess.empty() == false)
S << " " << I->CurrentItem->Owner->ActiveSubprocess;
+ enum {Long = 0,Medium,Short} Mode = Medium;
// Add the current progress
if (Mode == Long)
S << " " << I->CurrentSize;
diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h
index 51703b0ad..27642e025 100644
--- a/apt-private/private-cachefile.h
+++ b/apt-private/private-cachefile.h
@@ -46,7 +46,7 @@ class SortedPackageUniverse : public APT::PackageUniverse
void LazyInit() const;
public:
- SortedPackageUniverse(CacheFile &Cache);
+ explicit SortedPackageUniverse(CacheFile &Cache);
class const_iterator : public APT::Container_iterator_base<APT::PackageContainerInterface, SortedPackageUniverse, SortedPackageUniverse::const_iterator, std::vector<map_pointer_t>::const_iterator, pkgCache::PkgIterator>
{
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index 439b844d5..981766cdf 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -179,8 +179,8 @@ CacheSetHelperVirtuals::CacheSetHelperVirtuals(bool const ShowErrors, GlobalErro
/*}}}*/
// CacheSetHelperAPTGet - responsible for message telling from the CacheSets/*{{{*/
-CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &out) :
- APT::CacheSetHelper{true}, out(out)
+CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &pout) :
+ APT::CacheSetHelper{true}, out(pout)
{
explicitlyNamed = true;
}
@@ -245,8 +245,6 @@ bool CacheSetHelperAPTGet::showVirtualPackageErrors(pkgCacheFile &Cache)
"This may mean that the package is missing, has been obsoleted, or\n"
"is only available from another source\n"),Pkg.FullName(true).c_str());
- std::string List;
- std::string VersionsList;
std::vector<bool> Seen(Cache.GetPkgCache()->Head().PackageCount, false);
APT::PackageList pkglist;
for (pkgCache::DepIterator Dep = Pkg.RevDependsList();
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 2b452ab7d..4cbc4efa1 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -89,7 +89,7 @@ class APT_PUBLIC CacheSetHelperAPTGet : public APT::CacheSetHelper {
public:
std::list<std::pair<pkgCache::VerIterator, std::string> > selectedByRelease;
- CacheSetHelperAPTGet(std::ostream &out);
+ explicit CacheSetHelperAPTGet(std::ostream &out);
virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE;
virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE;
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 52572ed80..74a2424c5 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -666,7 +666,7 @@ struct PkgIsExtraInstalled {
pkgCacheFile * const Cache;
APT::VersionSet const * const verset;
PkgIsExtraInstalled(pkgCacheFile * const Cache, APT::VersionSet const * const Container) : Cache(Cache), verset(Container) {}
- bool operator() (pkgCache::PkgIterator const Pkg)
+ bool operator() (pkgCache::PkgIterator const &Pkg)
{
if ((*Cache)[Pkg].Install() == false)
return false;
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index c4d5e8bc3..a948c7d9f 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -41,7 +41,7 @@ struct PackageSortAlphabetic /*{{{*/
class PackageNameMatcher : public Matcher
{
public:
- PackageNameMatcher(const char **patterns)
+ explicit PackageNameMatcher(const char **patterns)
{
for(int i=0; patterns[i] != NULL; ++i)
{
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index aaa4268c6..34214d955 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -396,7 +396,7 @@ bool Policy(CommandLine &CmdL)
continue;
}
// New code
- for (pkgCache::VerIterator V = I.VersionList(); !V.end(); V++) {
+ for (pkgCache::VerIterator V = I.VersionList(); !V.end(); ++V) {
auto Prio = Plcy->GetPriority(V, false);
if (Prio == 0)
continue;