Преглед изворни кода

fix some cppcheck: (warning) Member variable is not initialized in the constructor.

David Kalnischkies пре 15 година
родитељ
комит
dd6882853b
4 измењених фајлова са 5 додато и 5 уклоњено
  1. 2 1
      apt-pkg/aptconfiguration.h
  2. 2 1
      apt-pkg/indexfile.cc
  3. 1 1
      apt-pkg/tagfile.h
  4. 0 2
      cmdline/apt-get.cc

+ 2 - 1
apt-pkg/aptconfiguration.h

@@ -13,6 +13,7 @@
 // Include Files							/*{{{*/
 #include <string>
 #include <vector>
+#include <limits>
 									/*}}}*/
 namespace APT {
 class Configuration {							/*{{{*/
@@ -94,7 +95,7 @@ public:									/*{{{*/
 		Compressor(char const *name, char const *extension, char const *binary,
 			   char const *compressArg, char const *uncompressArg,
 			   unsigned short const cost);
-		Compressor() {};
+		Compressor() : Cost(std::numeric_limits<unsigned short>::max()) {};
 	};
 
 	/** \brief Return a vector of Compressors supported for data.tar's

+ 2 - 1
apt-pkg/indexfile.cc

@@ -27,7 +27,8 @@ unsigned long pkgIndexFile::Type::GlobalListLen = 0;
 pkgIndexFile::Type::Type()
 {
    ItmList[GlobalListLen] = this;
-   GlobalListLen++;   
+   GlobalListLen++;
+   Label = NULL;
 }
 									/*}}}*/
 // Type::GetType - Locate the type by name				/*{{{*/

+ 1 - 1
apt-pkg/tagfile.h

@@ -79,7 +79,7 @@ class pkgTagSection
       Stop = this->Stop;
    };
    
-   pkgTagSection() : Section(0), Stop(0) {};
+   pkgTagSection() : Section(0), TagCount(0), Stop(0) {};
 };
 
 class pkgTagFile

+ 0 - 2
cmdline/apt-get.cc

@@ -869,9 +869,7 @@ struct TryToInstall {
 struct TryToRemove {
    pkgCacheFile* Cache;
    pkgProblemResolver* Fix;
-   bool FixBroken;
    bool PurgePkgs;
-   unsigned long AutoMarkChanged;
 
    TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
 				PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};