Просмотр исходного кода

fix: Member variable 'X' is not initialized in the constructor.

Reported-By: cppcheck
Git-Dch: Ignore
David Kalnischkies лет назад: 11
Родитель
Сommit
25613a61f6

+ 6 - 15
apt-pkg/acquire.cc

@@ -581,27 +581,18 @@ pkgAcquire::UriIterator pkgAcquire::UriEnd()
 // Acquire::MethodConfig::MethodConfig - Constructor			/*{{{*/
 // Acquire::MethodConfig::MethodConfig - Constructor			/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-pkgAcquire::MethodConfig::MethodConfig()
+pkgAcquire::MethodConfig::MethodConfig() : d(NULL), Next(0), SingleInstance(false),
+   Pipeline(false), SendConfig(false), LocalOnly(false), NeedsCleanup(false),
+   Removable(false)
 {
 {
-   SingleInstance = false;
-   Pipeline = false;
-   SendConfig = false;
-   LocalOnly = false;
-   Removable = false;
-   Next = 0;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // Queue::Queue - Constructor						/*{{{*/
 // Queue::Queue - Constructor						/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : Name(Name), 
-            Owner(Owner)
+pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : d(NULL), Next(0),
+   Name(Name), Items(0), Workers(0), Owner(Owner), PipeDepth(0), MaxPipeDepth(1)
 {
 {
-   Items = 0;
-   Next = 0;
-   Workers = 0;
-   MaxPipeDepth = 1;
-   PipeDepth = 0;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // Queue::~Queue - Destructor						/*{{{*/
 // Queue::~Queue - Destructor						/*{{{*/
@@ -805,7 +796,7 @@ void pkgAcquire::Queue::Bump()
 // AcquireStatus::pkgAcquireStatus - Constructor			/*{{{*/
 // AcquireStatus::pkgAcquireStatus - Constructor			/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Update(true), MorePulses(false)
+pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Percent(0), Update(true), MorePulses(false)
 {
 {
    Start();
    Start();
 }
 }

+ 1 - 1
apt-pkg/acquire.h

@@ -585,7 +585,7 @@ class pkgAcquire::UriIterator
     *
     *
     *  \param Q The queue over which this UriIterator should iterate.
     *  \param Q The queue over which this UriIterator should iterate.
     */
     */
-   UriIterator(pkgAcquire::Queue *Q) : CurQ(Q), CurItem(0)
+   UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0)
    {
    {
       while (CurItem == 0 && CurQ != 0)
       while (CurItem == 0 && CurQ != 0)
       {
       {

+ 7 - 3
apt-pkg/cdrom.cc

@@ -913,10 +913,14 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
-pkgUdevCdromDevices::pkgUdevCdromDevices()                     		/*{{{*/
-   : libudev_handle(NULL)
+pkgUdevCdromDevices::pkgUdevCdromDevices()				/*{{{*/
+: libudev_handle(NULL), udev_new(NULL), udev_enumerate_add_match_property(NULL),
+   udev_enumerate_scan_devices(NULL), udev_enumerate_get_list_entry(NULL),
+   udev_device_new_from_syspath(NULL), udev_enumerate_get_udev(NULL),
+   udev_list_entry_get_name(NULL), udev_device_get_devnode(NULL),
+   udev_enumerate_new(NULL), udev_list_entry_get_next(NULL),
+   udev_device_get_property_value(NULL), udev_enumerate_add_match_sysattr(NULL)
 {
 {
-
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 

+ 1 - 1
apt-pkg/contrib/fileutl.cc

@@ -896,7 +896,7 @@ class FileFdPrivate {							/*{{{*/
 	   bool eof;
 	   bool eof;
 	   bool compressing;
 	   bool compressing;
 
 
-	   LZMAFILE() : file(NULL), eof(false), compressing(false) {}
+	   LZMAFILE() : file(NULL), eof(false), compressing(false) { buffer[0] = '\0'; }
 	   ~LZMAFILE() {
 	   ~LZMAFILE() {
 	      if (compressing == true)
 	      if (compressing == true)
 	      {
 	      {

+ 2 - 0
apt-pkg/install-progress.cc

@@ -21,6 +21,8 @@
 namespace APT {
 namespace APT {
 namespace Progress {
 namespace Progress {
 
 
+PackageManager::PackageManager() : d(NULL), percentage(0.0), last_reported_progress(-1) {};
+PackageManager::~PackageManager() {};
 
 
 /* Return a APT::Progress::PackageManager based on the global
 /* Return a APT::Progress::PackageManager based on the global
  * apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)
  * apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)

+ 2 - 3
apt-pkg/install-progress.h

@@ -26,9 +26,8 @@ namespace Progress {
     int last_reported_progress;
     int last_reported_progress;
 
 
  public:
  public:
-    PackageManager()
-       : percentage(0.0), last_reported_progress(-1) {};
-    virtual ~PackageManager() {};
+    PackageManager();
+    virtual ~PackageManager();
 
 
     /* Global Start/Stop */
     /* Global Start/Stop */
     virtual void Start(int /*child_pty*/=-1) {};
     virtual void Start(int /*child_pty*/=-1) {};

+ 1 - 1
apt-pkg/metaindex.h

@@ -53,7 +53,7 @@ class metaIndex
 
 
    metaIndex(std::string const &URI, std::string const &Dist, 
    metaIndex(std::string const &URI, std::string const &Dist, 
              char const * const Type) 
              char const * const Type) 
-      : Indexes(NULL), Type(Type), URI(URI), Dist(Dist)
+      : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
    {
    {
       /* nothing */
       /* nothing */
    }
    }

+ 1 - 0
apt-pkg/pkgcache.cc

@@ -84,6 +84,7 @@ pkgCache::Header::Header()
    FileList = 0;
    FileList = 0;
    VerSysName = 0;
    VerSysName = 0;
    Architecture = 0;
    Architecture = 0;
+   Architectures = 0;
    HashTableSize = _config->FindI("APT::Cache-HashTableSize", 10 * 1048);
    HashTableSize = _config->FindI("APT::Cache-HashTableSize", 10 * 1048);
    memset(Pools,0,sizeof(Pools));
    memset(Pools,0,sizeof(Pools));
 
 

+ 1 - 1
apt-pkg/pkgcachegen.h

@@ -193,7 +193,7 @@ class pkgCacheGenerator::ListParser
    virtual bool CollectFileProvides(pkgCache &/*Cache*/,
    virtual bool CollectFileProvides(pkgCache &/*Cache*/,
 				    pkgCache::VerIterator &/*Ver*/) {return true;};
 				    pkgCache::VerIterator &/*Ver*/) {return true;};
 
 
-   ListParser() : FoundFileDeps(false) {};
+   ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {};
    virtual ~ListParser() {};
    virtual ~ListParser() {};
 };
 };
 									/*}}}*/
 									/*}}}*/

+ 1 - 1
apt-pkg/tagfile.h

@@ -43,7 +43,7 @@ class pkgTagSection
       unsigned int StartValue;
       unsigned int StartValue;
       unsigned int NextInBucket;
       unsigned int NextInBucket;
 
 
-      TagData(unsigned int const StartTag) : StartTag(StartTag), NextInBucket(0) {}
+      TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
    };
    };
    std::vector<TagData> Tags;
    std::vector<TagData> Tags;
    unsigned int LookupTable[0x100];
    unsigned int LookupTable[0x100];

+ 1 - 1
ftparchive/sources.h

@@ -17,7 +17,7 @@ class DscExtract
    bool TakeDsc(const void *Data, unsigned long Size);
    bool TakeDsc(const void *Data, unsigned long Size);
    bool Read(std::string FileName);
    bool Read(std::string FileName);
    
    
-   DscExtract() : Data(0), Length(0) {
+   DscExtract() : Data(0), Length(0), IsClearSigned(false) {
      Data = new char[maxSize];
      Data = new char[maxSize];
    };
    };
    ~DscExtract() { 
    ~DscExtract() { 

+ 3 - 2
methods/ftp.cc

@@ -75,9 +75,10 @@ time_t FtpMethod::FailTime = 0;
 // FTPConn::FTPConn - Constructor					/*{{{*/
 // FTPConn::FTPConn - Constructor					/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), 
+FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
                             DataListenFd(-1), ServerName(Srv),
                             DataListenFd(-1), ServerName(Srv),
-			    ForceExtended(false), TryPassive(true)
+			    ForceExtended(false), TryPassive(true),
+			    PeerAddrLen(0), ServerAddrLen(0)
 {
 {
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    PasvAddr = 0;
    PasvAddr = 0;

+ 2 - 3
methods/https.h

@@ -69,10 +69,9 @@ class HttpsMethod : public pkgAcqMethod
 
 
    public:
    public:
    FileFd *File;
    FileFd *File;
-      
-   HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), File(NULL)
+
+   HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), Server(NULL), File(NULL)
    {
    {
-      File = 0;
       curl = curl_easy_init();
       curl = curl_easy_init();
    };
    };