]> git.saurik.com Git - apt.git/commitdiff
fix a bunch of cppcheck "(warning) Member variable '<#>' is not
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 4 Mar 2012 22:47:05 +0000 (23:47 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 4 Mar 2012 22:47:05 +0000 (23:47 +0100)
initialized in the constructor." messages (no functional change)

19 files changed:
apt-pkg/acquire.cc
apt-pkg/algorithms.cc
apt-pkg/cachefile.cc
apt-pkg/cachefilter.cc
apt-pkg/deb/dpkgpm.cc
apt-pkg/orderlist.cc
apt-pkg/packagemanager.cc
apt-pkg/pkgrecords.cc
apt-pkg/pkgsystem.cc
apt-pkg/sourcelist.cc
apt-pkg/srcrecords.cc
apt-pkg/tagfile.cc
apt-pkg/version.cc
cmdline/acqprogress.cc
cmdline/apt-extracttemplates.cc
ftparchive/cachedb.h
methods/ftp.cc
methods/http.h
methods/rsh.cc

index cdc3fba4b8059994fa3251953d159a102830569b..573a85c2fafc0aeea5b62ef619bee50ec4ce9c2d 100644 (file)
@@ -766,7 +766,7 @@ void pkgAcquire::Queue::Bump()
 // AcquireStatus::pkgAcquireStatus - Constructor                       /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgAcquireStatus::pkgAcquireStatus() : Update(true), MorePulses(false)
+pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Update(true), MorePulses(false)
 {
    Start();
 }
index c337ace877374e6dd0c6afcde9d60a66d22bf5d1..ed3534f0d607e6a9e4e647394771c30634fc50e0 100644 (file)
@@ -471,7 +471,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
 // ProblemResolver::pkgProblemResolver - Constructor                   /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : Cache(*pCache)
+pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : d(NULL), Cache(*pCache)
 {
    // Allocate memory
    unsigned long Size = Cache.Head().PackageCount;
index f852542e5aefca46ce7fec1297b3f11100044612..7c2276185cbfcd8dc502791ebb41ddac499902d1 100644 (file)
@@ -30,7 +30,7 @@
 // CacheFile::CacheFile - Constructor                                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgCacheFile::pkgCacheFile() : Map(NULL), Cache(NULL), DCache(NULL),
+pkgCacheFile::pkgCacheFile() : d(NULL), Map(NULL), Cache(NULL), DCache(NULL),
                                SrcList(NULL), Policy(NULL)
 {
 }
index 210a9a9ab8f2eac5047500daabe5c31aedc55bf8..9ec3fa699ba34d9e45a645dab5bb3b88823724a6 100644 (file)
@@ -18,7 +18,7 @@
                                                                        /*}}}*/
 namespace APT {
 namespace CacheFilter {
-PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) {/*{{{*/
+PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) : d(NULL) {/*{{{*/
        pattern = new regex_t;
        int const Res = regcomp(pattern, Pattern.c_str(), REG_EXTENDED | REG_ICASE | REG_NOSUB);
        if (Res == 0)
index 8aea2e1c8fd93717df3bfbd7bf43db717ac26616..46913263446a2d6bf2de04f0a33b5e2ee4bb028c 100644 (file)
@@ -51,8 +51,10 @@ using namespace std;
 class pkgDPkgPMPrivate 
 {
 public:
-   pkgDPkgPMPrivate() : dpkgbuf_pos(0), term_out(NULL), history_out(NULL)
+   pkgDPkgPMPrivate() : stdin_is_dev_null(false), dpkgbuf_pos(0),
+                       term_out(NULL), history_out(NULL)
    {
+      dpkgbuf[0] = '\0';
    }
    bool stdin_is_dev_null;
    // the buffer we use for the dpkg status-fd reading
index 0ac9a83e3b14c1971e7dc863022d00279ad2d042..3a179b2a282f347f2594291148576dd5246f4381 100644 (file)
@@ -82,16 +82,14 @@ pkgOrderList *pkgOrderList::Me = 0;
 // OrderList::pkgOrderList - Constructor                               /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache)
+pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache),
+                                                 Primary(NULL), Secondary(NULL),
+                                                 RevDepends(NULL), Remove(NULL),
+                                                 AfterEnd(NULL), FileList(NULL),
+                                                 LoopCount(-1), Depth(0)
 {
-   FileList = 0;
-   Primary = 0;
-   Secondary = 0;
-   RevDepends = 0;
-   Remove = 0;
-   LoopCount = -1;
    Debug = _config->FindB("Debug::pkgOrderList",false);
-   
+
    /* Construct the arrays, egcs 1.0.1 bug requires the package count
       hack */
    unsigned long Size = Cache.Head().PackageCount;
index 05eb1a06b755e2e6a202c22cad72ab168f43f54d..5b5961aca23fa91f507555ae00043cbf81d44cce 100644 (file)
@@ -36,11 +36,13 @@ bool pkgPackageManager::SigINTStop = false;
 // PM::PackageManager - Constructor                                    /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache)
+pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache),
+                                                           List(NULL), Res(Incomplete)
 {
    FileNames = new string[Cache.Head().PackageCount];
-   List = 0;
    Debug = _config->FindB("Debug::pkgPackageManager",false);
+   NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
+   ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false);
 }
                                                                        /*}}}*/
 // PM::PackageManager - Destructor                                     /*{{{*/
@@ -169,10 +171,7 @@ bool pkgPackageManager::CreateOrderList()
    
    delete List;
    List = new pkgOrderList(&Cache);
-   
-   NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
-   ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false);
-   
+
    if (Debug && ImmConfigureAll) 
       clog << "CreateOrderList(): Adding Immediate flag for all packages because of APT::Immediate-Configure-All" << endl;
    
index c5b3bebd70ba5e2f3f6a4782c60eec3d2717889d..36dab3480d684cc87fef656ad46b15bd83bd04b4 100644 (file)
@@ -22,7 +22,7 @@
 // Records::pkgRecords - Constructor                                   /*{{{*/
 // ---------------------------------------------------------------------
 /* This will create the necessary structures to access the status files */
-pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), 
+pkgRecords::pkgRecords(pkgCache &Cache) : d(NULL), Cache(Cache),
   Files(Cache.HeaderP->PackageFileCount)
 {
    for (pkgCache::PkgFileIterator I = Cache.FileBegin();
index f61c140facec1926a4f27a472b1866ac824abdee..05ba6e0e69d13219689fe675b315bde97a7c1ee3 100644 (file)
@@ -26,11 +26,11 @@ unsigned long pkgSystem::GlobalListLen = 0;
 // System::pkgSystem - Constructor                                     /*{{{*/
 // ---------------------------------------------------------------------
 /* Add it to the global list.. */
-pkgSystem::pkgSystem()
+pkgSystem::pkgSystem() : Label(NULL), VS(NULL)
 {
    assert(GlobalListLen < sizeof(SysList)/sizeof(*SysList));
    SysList[GlobalListLen] = this;
-   GlobalListLen++;
+   ++GlobalListLen;
 }
                                                                        /*}}}*/
 // System::GetSystem - Get the named system                            /*{{{*/
index f5f458099f9098858967291032d69b4d9d3162e1..0fddfb45134ada915dfd445c5aa5e5ec4c132ded 100644 (file)
@@ -33,7 +33,7 @@ unsigned long pkgSourceList::Type::GlobalListLen = 0;
 // Type::Type - Constructor                                            /*{{{*/
 // ---------------------------------------------------------------------
 /* Link this to the global list of items*/
-pkgSourceList::Type::Type()
+pkgSourceList::Type::Type() : Name(NULL), Label(NULL)
 {
    ItmList[GlobalListLen] = this;
    GlobalListLen++;
index 48b643eace605c009781050125fdb965ed0a3891..d63d2c422b64b65b7d2acf233740ec113f818fd8 100644 (file)
@@ -25,7 +25,7 @@
 // SrcRecords::pkgSrcRecords - Constructor                             /*{{{*/
 // ---------------------------------------------------------------------
 /* Open all the source index files */
-pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
+pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0)
 {
    for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I)
    {
index ec86173df5fffb3db66117ebb6167e98086bb69b..79811899a9f6987567cc9113a141eeadeac9cee1 100644 (file)
@@ -30,7 +30,10 @@ using std::string;
 class pkgTagFilePrivate
 {
 public:
-   pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Size(Size)
+   pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Buffer(NULL),
+                                                            Start(NULL), End(NULL),
+                                                            Done(false), iOffset(0),
+                                                            Size(Size)
    {
    }
    FileFd &Fd;
index a9d4fb763d12c0fc15e7645b7dfc1217fa17ad4f..cb2c34c0fde1699dd02a801f1af56d7f7cec9432 100644 (file)
@@ -23,10 +23,10 @@ unsigned long pkgVersioningSystem::GlobalListLen = 0;
 // pkgVS::pkgVersioningSystem - Constructor                            /*{{{*/
 // ---------------------------------------------------------------------
 /* Link to the global list of versioning systems supported */
-pkgVersioningSystem::pkgVersioningSystem()
+pkgVersioningSystem::pkgVersioningSystem() : Label(NULL)
 {
    VSList[GlobalListLen] = this;
-   GlobalListLen++;
+   ++GlobalListLen;
 }
                                                                        /*}}}*/
 // pkgVS::GetVS - Find a VS by name                                    /*{{{*/
index 1ccb088040ff01e262039a12839c38fa287d6211..3ac350acab8d64124d71553192818af8e55f764f 100644 (file)
@@ -31,8 +31,9 @@ using namespace std;
 // ---------------------------------------------------------------------
 /* */
 AcqTextStatus::AcqTextStatus(unsigned int &ScreenWidth,unsigned int Quiet) :
-    ScreenWidth(ScreenWidth), Quiet(Quiet)
+    ScreenWidth(ScreenWidth), ID(0), Quiet(Quiet)
 {
+   BlankLine[0] = 0;
 }
                                                                        /*}}}*/
 // AcqTextStatus::Start - Downloading has started                      /*{{{*/
index d5c1a3208db11c0a7d7b78bc1bad75fc450d4c38..dc4c110a122fbbd0261c808f8039bd7c4325f14b 100644 (file)
@@ -53,8 +53,8 @@ pkgCache *DebFile::Cache = 0;
 // ---------------------------------------------------------------------
 /* */
 DebFile::DebFile(const char *debfile)
-       : File(debfile, FileFd::ReadOnly), Control(0), DepOp(0), 
-          PreDepOp(0), Config(0), Template(0), Which(None)
+       : File(debfile, FileFd::ReadOnly), Size(0), Control(NULL), ControlLen(0),
+         DepOp(0), PreDepOp(0), Config(0), Template(0), Which(None)
 {
 }
                                                                        /*}}}*/
index 377c4160728463117402a9c2f85f9ce1e82903a6..b9ced941843e5e17b3dd6d95a46e45730ee1683d 100644 (file)
@@ -126,7 +126,8 @@ class CacheDB
          Misses += S.Misses; 
          DeLinkBytes += S.DeLinkBytes;
       };
-      Stats() : Bytes(0), MD5Bytes(0), SHA1Bytes(0), SHA256Bytes(0), Packages(0), Misses(0), DeLinkBytes(0) {};
+      Stats() : Bytes(0), MD5Bytes(0), SHA1Bytes(0), SHA256Bytes(0),
+               SHA512Bytes(0),Packages(0), Misses(0), DeLinkBytes(0) {};
    } Stats;
    
    bool ReadyDB(std::string const &DB);
@@ -142,7 +143,7 @@ class CacheDB
    
    bool Clean();
    
-   CacheDB(std::string const &DB) : Dbp(0), Fd(NULL), DebFile(0) {ReadyDB(DB);};
+   CacheDB(std::string const &DB) : Dbp(0), Fd(NULL), DebFile(0) {TmpKey[0]='\0'; ReadyDB(DB);};
    ~CacheDB() {ReadyDB(std::string()); delete DebFile;};
 };
     
index ad8a7b828a2ce0563014fb6591a9641061cafbd3..b1e8d2b0a43da11b7b71ec2b6c1c4b7b8f191a20 100644 (file)
@@ -77,6 +77,7 @@ FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
 {
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    PasvAddr = 0;
+   Buffer[0] = '\0';
 }
                                                                        /*}}}*/
 // FTPConn::~FTPConn - Destructor                                      /*{{{*/
index c061ad680de03d28a19e4f3fdaed607eae3d104a..7a3ccda5407bc32ddb368ae2cb962fd6492577ec 100644 (file)
@@ -115,9 +115,10 @@ struct ServerState
   
    bool HeaderLine(std::string Line);
    bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
-   void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0;
-                 Encoding = Closes; time(&Date); ServerFd = -1; 
-                 Pipeline = true;};
+   void Reset() {Major = 0; Minor = 0; Result = 0; Code[0] = '\0'; Size = 0;
+                StartPos = 0; Encoding = Closes; time(&Date); HaveContent = false;
+                State = Header; Persistent = false; ServerFd = -1;
+                Pipeline = true;};
 
    /** \brief Result of the header acquire */
    enum RunHeadersResult {
index d249ae96102aa456e69faa60fb83ea26f43035d6..fb3782314d2152bd4e2378fda6178b04581b2d9b 100644 (file)
@@ -42,7 +42,9 @@ int RSHMethod::FailFd = -1;
 // ---------------------------------------------------------------------
 /* */
 RSHConn::RSHConn(URI Srv) : Len(0), WriteFd(-1), ReadFd(-1),
-                            ServerName(Srv), Process(-1) {}
+                            ServerName(Srv), Process(-1) {
+   Buffer[0] = '\0';
+}
                                                                        /*}}}*/
 // RSHConn::RSHConn - Destructor                                       /*{{{*/
 // ---------------------------------------------------------------------