From 2b734a7ec429825c7007c1093883229e069d36c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jul 2019 15:48:59 +0200 Subject: Apply various suggestions by cppcheck Reported-By: cppcheck --- cmdline/apt-cache.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'cmdline/apt-cache.cc') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 499c9edc9..acf00bdda 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -136,12 +136,12 @@ static bool DumpPackage(CommandLine &CmdL) /* */ static map_pointer_t PackageNext(pkgCache::Package const * const P) { return P->NextPackage; } static map_pointer_t GroupNext(pkgCache::Group const * const G) { return G->Next; } -template -static void ShowHashTableStats(std::string Type, - T *StartP, - map_pointer_t *Hashtable, - unsigned long Size, - map_pointer_t(*Next)(T const * const)) +template +static void ShowHashTableStats(char const *const Type, + T *StartP, + map_pointer_t *Hashtable, + unsigned long Size, + map_pointer_t (*Next)(T const *const)) { // hashtable stats for the HashTable unsigned long NumBuckets = Size; @@ -201,8 +201,7 @@ static bool Stats(CommandLine &CmdL) int NVirt = 0; int DVirt = 0; int Missing = 0; - pkgCache::PkgIterator I = Cache->PkgBegin(); - for (;I.end() != true; ++I) + for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) { if (I->VersionList != 0 && I->ProvidesList == 0) { -- cgit v1.2.3-70-g09d2