]> git.saurik.com Git - apt.git/commitdiff
apply various style suggestions by cppcheck
authorDavid Kalnischkies <david@kalnischkies.de>
Tue, 16 Jun 2015 22:14:10 +0000 (00:14 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 10 Aug 2015 15:24:01 +0000 (17:24 +0200)
Some of them modify the ABI, but given that we prepare a big one
already, these few hardly count for much.

Git-Dch: Ignore

31 files changed:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/acquire-worker.cc
apt-pkg/acquire-worker.h
apt-pkg/acquire.cc
apt-pkg/acquire.h
apt-pkg/algorithms.h
apt-pkg/cachefilter.h
apt-pkg/cacheiterators.h
apt-pkg/cacheset.h
apt-pkg/contrib/hashes.cc
apt-pkg/contrib/hashsum_template.h
apt-pkg/contrib/strutl.cc
apt-pkg/deb/debmetaindex.cc
apt-pkg/depcache.cc
apt-pkg/depcache.h
apt-pkg/indexcopy.cc
apt-pkg/indexfile.h
apt-pkg/indexrecords.cc
apt-pkg/indexrecords.h
apt-pkg/install-progress.h
apt-pkg/orderlist.h
apt-pkg/packagemanager.h
apt-pkg/pkgcachegen.h
apt-pkg/pkgrecords.h
apt-pkg/policy.h
apt-pkg/sourcelist.h
apt-pkg/srcrecords.cc
apt-pkg/srcrecords.h
apt-pkg/tagfile.cc
cmdline/apt-extracttemplates.h

index 3313aaabcc47cea4b74ee3fc6cb626d44cbb16b6..034b7725af47f4c478822055f2a3100665465bf4 100644 (file)
@@ -120,7 +120,7 @@ static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser
    return false;
 }
                                                                        /*}}}*/
    return false;
 }
                                                                        /*}}}*/
-static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const MetaKey)/*{{{*/
+static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const &MetaKey)/*{{{*/
 {
    if (Parser == NULL)
       return HashStringList();
 {
    if (Parser == NULL)
       return HashStringList();
@@ -393,7 +393,7 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item                     /*{{{*/
    virtual std::string DescURI() const {return Target.URI;};
    virtual HashStringList GetExpectedHashes()  const {return HashStringList();};
 
    virtual std::string DescURI() const {return Target.URI;};
    virtual HashStringList GetExpectedHashes()  const {return HashStringList();};
 
-   NoActionItem(pkgAcquire * const Owner, IndexTarget const Target) :
+   NoActionItem(pkgAcquire * const Owner, IndexTarget const &Target) :
       pkgAcquire::Item(Owner), Target(Target)
    {
       Status = StatDone;
       pkgAcquire::Item(Owner), Target(Target)
    {
       Status = StatDone;
@@ -404,9 +404,9 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item                     /*{{{*/
 
 // Acquire::Item::Item - Constructor                                   /*{{{*/
 APT_IGNORE_DEPRECATED_PUSH
 
 // Acquire::Item::Item - Constructor                                   /*{{{*/
 APT_IGNORE_DEPRECATED_PUSH
-pkgAcquire::Item::Item(pkgAcquire * const Owner) :
+pkgAcquire::Item::Item(pkgAcquire * const owner) :
    FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
    FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
-    QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner)
+    QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner)
 {
    Owner->Add(this);
    Status = StatIdle;
 {
    Owner->Add(this);
    Status = StatIdle;
@@ -661,8 +661,8 @@ std::string pkgAcquire::Item::HashSum() const                               /*{{{*/
                                                                        /*}}}*/
 
 pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/
                                                                        /*}}}*/
 
 pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/
-      pkgAcqMetaBase * const TransactionManager, IndexTarget const Target) :
-   pkgAcquire::Item(Owner), Target(Target), TransactionManager(TransactionManager)
+      pkgAcqMetaBase * const transactionManager, IndexTarget const &target) :
+   pkgAcquire::Item(Owner), Target(target), TransactionManager(transactionManager)
 {
    if (TransactionManager != this)
       TransactionManager->Add(this);
 {
    if (TransactionManager != this)
       TransactionManager->Add(this);
@@ -672,7 +672,7 @@ pkgAcqTransactionItem::~pkgAcqTransactionItem()                             /*{{{*/
 {
 }
                                                                        /*}}}*/
 {
 }
                                                                        /*}}}*/
-HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const MetaKey) const    /*{{{*/
+HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const &MetaKey) const   /*{{{*/
 {
    return GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, MetaKey);
 }
 {
    return GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, MetaKey);
 }
@@ -681,7 +681,7 @@ HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const Met
 // AcqMetaBase - Constructor                                           /*{{{*/
 pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
 // AcqMetaBase - Constructor                                           /*{{{*/
 pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
-      std::vector<IndexTarget> const IndexTargets,
+      std::vector<IndexTarget> const &IndexTargets,
       IndexTarget const &DataTarget,
       indexRecords * const MetaIndexParser)
 : pkgAcqTransactionItem(Owner, TransactionManager, DataTarget),
       IndexTarget const &DataTarget,
       indexRecords * const MetaIndexParser)
 : pkgAcqTransactionItem(Owner, TransactionManager, DataTarget),
@@ -1103,11 +1103,11 @@ pkgAcqMetaBase::~pkgAcqMetaBase() {}
 pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner,       /*{{{*/
       IndexTarget const &ClearsignedTarget,
       IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget,
 pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner,       /*{{{*/
       IndexTarget const &ClearsignedTarget,
       IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget,
-      std::vector<IndexTarget> const IndexTargets,
+      std::vector<IndexTarget> const &IndexTargets,
       indexRecords * const MetaIndexParser) :
    pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser),
    ClearsignedTarget(ClearsignedTarget),
       indexRecords * const MetaIndexParser) :
    pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser),
    ClearsignedTarget(ClearsignedTarget),
-   DetachedDataTarget(DetachedDataTarget), DetachedSigTarget(DetachedSigTarget)
+   DetachedDataTarget(DetachedDataTarget)
 {
    // index targets + (worst case:) Release/Release.gpg
    ExpectedAdditionalItems = IndexTargets.size() + 2;
 {
    // index targets + (worst case:) Release/Release.gpg
    ExpectedAdditionalItems = IndexTargets.size() + 2;
@@ -1243,7 +1243,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner,                /*{{{*/
                                  pkgAcqMetaBase * const TransactionManager,
                                 IndexTarget const &DataTarget,
                                 IndexTarget const &DetachedSigTarget,
                                  pkgAcqMetaBase * const TransactionManager,
                                 IndexTarget const &DataTarget,
                                 IndexTarget const &DetachedSigTarget,
-                                vector<IndexTarget> const IndexTargets,
+                                vector<IndexTarget> const &IndexTargets,
                                 indexRecords * const MetaIndexParser) :
    pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser),
    DetachedSigTarget(DetachedSigTarget)
                                 indexRecords * const MetaIndexParser) :
    pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser),
    DetachedSigTarget(DetachedSigTarget)
@@ -1325,7 +1325,7 @@ pkgAcqMetaIndex::~pkgAcqMetaIndex() {}
 // AcqMetaSig::AcqMetaSig - Constructor                                        /*{{{*/
 pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
 // AcqMetaSig::AcqMetaSig - Constructor                                        /*{{{*/
 pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
-      IndexTarget const Target,
+      IndexTarget const &Target,
       pkgAcqMetaIndex * const MetaIndex) :
    pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex)
 {
       pkgAcqMetaIndex * const MetaIndex) :
    pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex)
 {
@@ -1488,7 +1488,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const
 // AcqBaseIndex - Constructor                                          /*{{{*/
 pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
 // AcqBaseIndex - Constructor                                          /*{{{*/
 pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner,
       pkgAcqMetaBase * const TransactionManager,
-      IndexTarget const Target)
+      IndexTarget const &Target)
 : pkgAcqTransactionItem(Owner, TransactionManager, Target)
 {
 }
 : pkgAcqTransactionItem(Owner, TransactionManager, Target)
 {
 }
@@ -1504,7 +1504,7 @@ pkgAcqBaseIndex::~pkgAcqBaseIndex() {}
  */
 pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner,
                                  pkgAcqMetaBase * const TransactionManager,
  */
 pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner,
                                  pkgAcqMetaBase * const TransactionManager,
-                                 IndexTarget const Target)
+                                 IndexTarget const &Target)
    : pkgAcqBaseIndex(Owner, TransactionManager, Target)
 {
    Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
    : pkgAcqBaseIndex(Owner, TransactionManager, Target)
 {
    Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
@@ -1905,7 +1905,7 @@ pkgAcqDiffIndex::~pkgAcqDiffIndex() {}
  */
 pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner,
                                    pkgAcqMetaBase * const TransactionManager,
  */
 pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner,
                                    pkgAcqMetaBase * const TransactionManager,
-                                   IndexTarget const Target,
+                                   IndexTarget const &Target,
                                   vector<DiffInfo> const &diffs)
    : pkgAcqBaseIndex(Owner, TransactionManager, Target),
      available_patches(diffs)
                                   vector<DiffInfo> const &diffs)
    : pkgAcqBaseIndex(Owner, TransactionManager, Target),
      available_patches(diffs)
@@ -2128,7 +2128,7 @@ pkgAcqIndexDiffs::~pkgAcqIndexDiffs() {}
 // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor                        /*{{{*/
 pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner,
                                              pkgAcqMetaBase * const TransactionManager,
 // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor                        /*{{{*/
 pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner,
                                              pkgAcqMetaBase * const TransactionManager,
-                                             IndexTarget const Target,
+                                             IndexTarget const &Target,
                                              DiffInfo const &patch,
                                              std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
   : pkgAcqBaseIndex(Owner, TransactionManager, Target),
                                              DiffInfo const &patch,
                                              std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
   : pkgAcqBaseIndex(Owner, TransactionManager, Target),
@@ -2273,8 +2273,8 @@ pkgAcqIndexMergeDiffs::~pkgAcqIndexMergeDiffs() {}
 // AcqIndex::AcqIndex - Constructor                                    /*{{{*/
 pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner,
                          pkgAcqMetaBase * const TransactionManager,
 // AcqIndex::AcqIndex - Constructor                                    /*{{{*/
 pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner,
                          pkgAcqMetaBase * const TransactionManager,
-                         IndexTarget const Target)
-   : pkgAcqBaseIndex(Owner, TransactionManager, Target)
+                         IndexTarget const &Target)
+   : pkgAcqBaseIndex(Owner, TransactionManager, Target), Stage(STAGE_DOWNLOAD)
 {
    // autoselect the compression method
    AutoSelectCompression();
 {
    // autoselect the compression method
    AutoSelectCompression();
index df1380b5eda7211ad42959f81c9e6a53f0741d7a..36fedc7bef79a4d75d47c706e89803cc612d1b49 100644 (file)
@@ -276,7 +276,7 @@ class pkgAcquire::Item : public WeakPointable                               /*{{{*/
     *
     *  \param Owner The new owner of this item.
     */
     *
     *  \param Owner The new owner of this item.
     */
-   Item(pkgAcquire * const Owner);
+   explicit Item(pkgAcquire * const Owner);
 
    /** \brief Remove this item from its owner's queue by invoking
     *  pkgAcquire::Remove.
 
    /** \brief Remove this item from its owner's queue by invoking
     *  pkgAcquire::Remove.
@@ -347,7 +347,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item             /*{{{*/
    void *d;
    protected:
    IndexTarget const Target;
    void *d;
    protected:
    IndexTarget const Target;
-   HashStringList GetExpectedHashesFor(std::string const MetaKey) const;
+   HashStringList GetExpectedHashesFor(std::string const &MetaKey) const;
 
    bool QueueURI(pkgAcquire::ItemDesc &Item);
 
 
    bool QueueURI(pkgAcquire::ItemDesc &Item);
 
@@ -370,7 +370,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item             /*{{{*/
    virtual bool HashesRequired() const;
 
 
    virtual bool HashesRequired() const;
 
 
-   pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target);
+   pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target);
    virtual ~pkgAcqTransactionItem();
 
    friend class pkgAcqMetaBase;
    virtual ~pkgAcqTransactionItem();
 
    friend class pkgAcqMetaBase;
@@ -474,7 +474,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem              /*{{{*/
    virtual std::string GetFinalFilename() const;
 
    pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
    virtual std::string GetFinalFilename() const;
 
    pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-                 std::vector<IndexTarget> const IndexTargets,
+                 std::vector<IndexTarget> const &IndexTargets,
                  IndexTarget const &DataTarget,
                  indexRecords* const MetaIndexParser);
    virtual ~pkgAcqMetaBase();
                  IndexTarget const &DataTarget,
                  indexRecords* const MetaIndexParser);
    virtual ~pkgAcqMetaBase();
@@ -511,7 +511,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
    /** \brief Create a new pkgAcqMetaIndex. */
    pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
                   IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
    /** \brief Create a new pkgAcqMetaIndex. */
    pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
                   IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
-                  std::vector<IndexTarget> const IndexTargets, indexRecords * const MetaIndexParser);
+                  std::vector<IndexTarget> const &IndexTargets, indexRecords * const MetaIndexParser);
    virtual ~pkgAcqMetaIndex();
 
    friend class pkgAcqMetaSig;
    virtual ~pkgAcqMetaIndex();
 
    friend class pkgAcqMetaSig;
@@ -548,7 +548,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
                     pkgAcquire::MethodConfig const * const Cnf);
 
    /** \brief Create a new pkgAcqMetaSig. */
                     pkgAcquire::MethodConfig const * const Cnf);
 
    /** \brief Create a new pkgAcqMetaSig. */
-   pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target,
+   pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target,
         pkgAcqMetaIndex * const MetaIndex);
    virtual ~pkgAcqMetaSig();
 };
         pkgAcqMetaIndex * const MetaIndex);
    virtual ~pkgAcqMetaSig();
 };
@@ -560,7 +560,6 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
 
    IndexTarget const ClearsignedTarget;
    IndexTarget const DetachedDataTarget;
 
    IndexTarget const ClearsignedTarget;
    IndexTarget const DetachedDataTarget;
-   IndexTarget const DetachedSigTarget;
 
 public:
    virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
 
 public:
    virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
@@ -573,7 +572,7 @@ public:
                IndexTarget const &ClearsignedTarget,
                IndexTarget const &DetachedDataTarget,
                IndexTarget const &DetachedSigTarget,
                IndexTarget const &ClearsignedTarget,
                IndexTarget const &DetachedDataTarget,
                IndexTarget const &DetachedSigTarget,
-               std::vector<IndexTarget> const IndexTargets,
+               std::vector<IndexTarget> const &IndexTargets,
                indexRecords * const MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
 };
                indexRecords * const MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
 };
@@ -588,7 +587,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem
    virtual std::string GetFinalFilename() const;
 
    pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
    virtual std::string GetFinalFilename() const;
 
    pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-                   IndexTarget const Target);
+                   IndexTarget const &Target);
    virtual ~pkgAcqBaseIndex();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqBaseIndex();
 };
                                                                        /*}}}*/
@@ -652,7 +651,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex
     *  \param ShortDesc A short description of the list file to download.
     */
    pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
     *  \param ShortDesc A short description of the list file to download.
     */
    pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-                   IndexTarget const Target);
+                   IndexTarget const &Target);
    virtual ~pkgAcqDiffIndex();
  private:
    APT_HIDDEN void QueueOnIMSHit() const;
    virtual ~pkgAcqDiffIndex();
  private:
    APT_HIDDEN void QueueOnIMSHit() const;
@@ -751,7 +750,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
     *  check if it was the last one to complete the download step
     */
    pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
     *  check if it was the last one to complete the download step
     */
    pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-                         IndexTarget const Target, DiffInfo const &patch,
+                         IndexTarget const &Target, DiffInfo const &patch,
                          std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
    virtual ~pkgAcqIndexMergeDiffs();
 };
                          std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
    virtual ~pkgAcqIndexMergeDiffs();
 };
@@ -865,7 +864,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *  that depends on it.
     */
    pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
     *  that depends on it.
     */
    pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-                    IndexTarget const Target,
+                    IndexTarget const &Target,
                    std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>());
    virtual ~pkgAcqIndexDiffs();
 };
                    std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>());
    virtual ~pkgAcqIndexDiffs();
 };
@@ -943,7 +942,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex
    virtual std::string GetMetaKey() const;
 
    pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
    virtual std::string GetMetaKey() const;
 
    pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
-               IndexTarget const Target);
+               IndexTarget const &Target);
    virtual ~pkgAcqIndex();
 
    private:
    virtual ~pkgAcqIndex();
 
    private:
index ef195d44bfb23541a27dfdd224e64691941e1f87..55fa5734fad77a372497e32383395a1284e5b96d 100644 (file)
@@ -47,7 +47,7 @@ using namespace std;
 // ---------------------------------------------------------------------
 /* */
 pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf,
 // ---------------------------------------------------------------------
 /* */
 pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf,
-                          pkgAcquireStatus *Log) : Log(Log)
+                          pkgAcquireStatus *log) : Log(log)
 {
    OwnerQ = Q;
    Config = Cnf;
 {
    OwnerQ = Q;
    Config = Cnf;
index b8e8fefed4230de6395a2b9fa42ca9751cad049e..31b9d3b88b838bdb6febf78413bd1d7f019b7a3e 100644 (file)
@@ -317,7 +317,7 @@ class pkgAcquire::Worker : public WeakPointable
     *  \param Config A location in which to store information about
     *  the fetch method.
     */
     *  \param Config A location in which to store information about
     *  the fetch method.
     */
-   Worker(MethodConfig *Config);
+   explicit Worker(MethodConfig *Config);
 
    /** \brief Clean up this worker.
     *
 
    /** \brief Clean up this worker.
     *
index 75df858a83219fb056041f5b1a23ab9aaa064ced..f70feeeec8c67bbd5e0ef32d13a39dd9342b51a5 100644 (file)
@@ -653,8 +653,8 @@ pkgAcquire::MethodConfig::MethodConfig() : d(NULL), Next(0), SingleInstance(fals
 // Queue::Queue - Constructor                                          /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 // Queue::Queue - Constructor                                          /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : d(NULL), Next(0),
-   Name(Name), Items(0), Workers(0), Owner(Owner), PipeDepth(0), MaxPipeDepth(1)
+pkgAcquire::Queue::Queue(string const &name,pkgAcquire * const owner) : d(NULL), Next(0),
+   Name(name), Items(0), Workers(0), Owner(owner), PipeDepth(0), MaxPipeDepth(1)
 {
 }
                                                                        /*}}}*/
 {
 }
                                                                        /*}}}*/
index b7e6c68f1b522c2455644c8bb34eb8e025b7c5e8..661b35f3489c19e2cef0f004606e5f3b548d0dd2 100644 (file)
@@ -369,7 +369,7 @@ class pkgAcquire
    bool GetLock(std::string const &Lock);
 
    /** \brief Construct a new pkgAcquire. */
    bool GetLock(std::string const &Lock);
 
    /** \brief Construct a new pkgAcquire. */
-   pkgAcquire(pkgAcquireStatus *Log);
+   explicit pkgAcquire(pkgAcquireStatus *Log);
    pkgAcquire();
 
    /** \brief Destroy this pkgAcquire object.
    pkgAcquire();
 
    /** \brief Destroy this pkgAcquire object.
@@ -584,7 +584,7 @@ class pkgAcquire::Queue
     *  \param Name The name of the new queue.
     *  \param Owner The download process that owns the new queue.
     */
     *  \param Name The name of the new queue.
     *  \param Owner The download process that owns the new queue.
     */
-   Queue(std::string Name,pkgAcquire *Owner);
+   Queue(std::string const &Name,pkgAcquire * const Owner);
 
    /** Shut down all the worker processes associated with this queue
     *  and empty the queue.
 
    /** Shut down all the worker processes associated with this queue
     *  and empty the queue.
@@ -625,7 +625,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);
+   explicit UriIterator(pkgAcquire::Queue *Q);
    virtual ~UriIterator();
 };
                                                                        /*}}}*/
    virtual ~UriIterator();
 };
                                                                        /*}}}*/
index dab844220689f6d99870a797b868a493db796c61..9c9ceead4f091d11fd8210ad55dcbb539cc4aa96 100644 (file)
@@ -67,7 +67,7 @@ class pkgSimulate : public pkgPackageManager                          /*{{{*/
         return (*Cache)[Pkg].CandidateVerIter(*Cache);
       }
       
         return (*Cache)[Pkg].CandidateVerIter(*Cache);
       }
       
-      Policy(pkgDepCache *Cache) : Cache(Cache) {};
+      explicit Policy(pkgDepCache *Cache) : Cache(Cache) {};
    };
    
    unsigned char *Flags;
    };
    
    unsigned char *Flags;
@@ -87,7 +87,7 @@ private:
 
    public:
 
 
    public:
 
-   pkgSimulate(pkgDepCache *Cache);
+   explicit pkgSimulate(pkgDepCache *Cache);
    virtual ~pkgSimulate();
 };
                                                                        /*}}}*/
    virtual ~pkgSimulate();
 };
                                                                        /*}}}*/
@@ -155,7 +155,7 @@ class pkgProblemResolver                                            /*{{{*/
 
    APT_DEPRECATED void InstallProtect();
 
 
    APT_DEPRECATED void InstallProtect();
 
-   pkgProblemResolver(pkgDepCache *Cache);
+   explicit pkgProblemResolver(pkgDepCache *Cache);
    virtual ~pkgProblemResolver();
 };
                                                                        /*}}}*/
    virtual ~pkgProblemResolver();
 };
                                                                        /*}}}*/
index b4697b773d93d014b9b3b5dd87aeb9c5deed7cbf..df9e9460a4b71b3ef36482f7d25c432484468cdd 100644 (file)
@@ -53,7 +53,7 @@ public:
 class NOTMatcher : public Matcher {
    Matcher * const matcher;
 public:
 class NOTMatcher : public Matcher {
    Matcher * const matcher;
 public:
-   NOTMatcher(Matcher * const matcher);
+   explicit NOTMatcher(Matcher * const matcher);
    virtual bool operator() (pkgCache::PkgIterator const &Pkg);
    virtual bool operator() (pkgCache::GrpIterator const &Grp);
    virtual bool operator() (pkgCache::VerIterator const &Ver);
    virtual bool operator() (pkgCache::PkgIterator const &Pkg);
    virtual bool operator() (pkgCache::GrpIterator const &Grp);
    virtual bool operator() (pkgCache::VerIterator const &Ver);
@@ -65,7 +65,7 @@ class ANDMatcher : public Matcher {
 public:
    // 5 ought to be enough for everybody… c++11 variadic templates would be nice
    ANDMatcher();
 public:
    // 5 ought to be enough for everybody… c++11 variadic templates would be nice
    ANDMatcher();
-   ANDMatcher(Matcher * const matcher1);
+   explicit ANDMatcher(Matcher * const matcher1);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
    ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
@@ -81,7 +81,7 @@ class ORMatcher : public Matcher {
 public:
    // 5 ought to be enough for everybody… c++11 variadic templates would be nice
    ORMatcher();
 public:
    // 5 ought to be enough for everybody… c++11 variadic templates would be nice
    ORMatcher();
-   ORMatcher(Matcher * const matcher1);
+   explicit ORMatcher(Matcher * const matcher1);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
    ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
@@ -96,7 +96,7 @@ public:
 class PackageNameMatchesRegEx : public PackageMatcher {                        /*{{{*/
        regex_t* pattern;
 public:
 class PackageNameMatchesRegEx : public PackageMatcher {                        /*{{{*/
        regex_t* pattern;
 public:
-       PackageNameMatchesRegEx(std::string const &Pattern);
+       explicit PackageNameMatchesRegEx(std::string const &Pattern);
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual bool operator() (pkgCache::GrpIterator const &Grp);
        virtual ~PackageNameMatchesRegEx();
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual bool operator() (pkgCache::GrpIterator const &Grp);
        virtual ~PackageNameMatchesRegEx();
@@ -105,7 +105,7 @@ public:
 class PackageNameMatchesFnmatch : public PackageMatcher {              /*{{{*/
        const std::string Pattern;
 public:
 class PackageNameMatchesFnmatch : public PackageMatcher {              /*{{{*/
        const std::string Pattern;
 public:
-       PackageNameMatchesFnmatch(std::string const &Pattern);
+       explicit PackageNameMatchesFnmatch(std::string const &Pattern);
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual bool operator() (pkgCache::GrpIterator const &Grp);
        virtual ~PackageNameMatchesFnmatch() {};
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual bool operator() (pkgCache::GrpIterator const &Grp);
        virtual ~PackageNameMatchesFnmatch() {};
@@ -140,7 +140,7 @@ public:
 class PackageIsNewInstall : public PackageMatcher {                    /*{{{*/
        pkgCacheFile * const Cache;
 public:
 class PackageIsNewInstall : public PackageMatcher {                    /*{{{*/
        pkgCacheFile * const Cache;
 public:
-       PackageIsNewInstall(pkgCacheFile * const Cache);
+       explicit PackageIsNewInstall(pkgCacheFile * const Cache);
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual ~PackageIsNewInstall();
 };
        virtual bool operator() (pkgCache::PkgIterator const &Pkg);
        virtual ~PackageIsNewInstall();
 };
index 301da6fc495a0c57099f22d4980039827262ac03..f3b107699e35c68a20a1f6f975a4fb6b33e88916 100644 (file)
@@ -107,7 +107,7 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
 
        public:
        // This constructor is the 'begin' constructor, never use it.
 
        public:
        // This constructor is the 'begin' constructor, never use it.
-       inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
+       explicit inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
                S = OwnerPointer();
                operator ++(0);
        }
                S = OwnerPointer();
                operator ++(0);
        }
@@ -148,7 +148,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
 
        public:
        // This constructor is the 'begin' constructor, never use it.
 
        public:
        // This constructor is the 'begin' constructor, never use it.
-       inline PkgIterator(pkgCache &Owner) : Iterator<Package, PkgIterator>(Owner), HashIndex(-1) {
+       explicit inline PkgIterator(pkgCache &Owner) : Iterator<Package, PkgIterator>(Owner), HashIndex(-1) {
                S = OwnerPointer();
                operator ++(0);
        }
                S = OwnerPointer();
                operator ++(0);
        }
@@ -394,7 +394,7 @@ class pkgCache::RlsFileIterator : public Iterator<ReleaseFile, RlsFileIterator>
 
        // Constructors
        inline RlsFileIterator() : Iterator<ReleaseFile, RlsFileIterator>() {}
 
        // Constructors
        inline RlsFileIterator() : Iterator<ReleaseFile, RlsFileIterator>() {}
-       inline RlsFileIterator(pkgCache &Owner) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Owner.RlsFileP) {}
+       explicit inline RlsFileIterator(pkgCache &Owner) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Owner.RlsFileP) {}
        inline RlsFileIterator(pkgCache &Owner,ReleaseFile *Trg) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Trg) {}
 };
                                                                        /*}}}*/
        inline RlsFileIterator(pkgCache &Owner,ReleaseFile *Trg) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Trg) {}
 };
                                                                        /*}}}*/
@@ -430,7 +430,7 @@ class pkgCache::PkgFileIterator : public Iterator<PackageFile, PkgFileIterator>
 
        // Constructors
        inline PkgFileIterator() : Iterator<PackageFile, PkgFileIterator>() {}
 
        // Constructors
        inline PkgFileIterator() : Iterator<PackageFile, PkgFileIterator>() {}
-       inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {}
+       explicit inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {}
        inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator<PackageFile, PkgFileIterator>(Owner, Trg) {}
 };
                                                                        /*}}}*/
        inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator<PackageFile, PkgFileIterator>(Owner, Trg) {}
 };
                                                                        /*}}}*/
index 1a6feb5f7c95879b43cbaccc055c5cc703c47472..7fd740335bb7a093f29a2c9ed20d952e1179a582 100644 (file)
@@ -265,7 +265,7 @@ APT_IGNORE_DEPRECATED_POP
        void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; }
        CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
        PackageContainerInterface();
        void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; }
        CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
        PackageContainerInterface();
-       PackageContainerInterface(CacheSetHelper::PkgSelector const by);
+       explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by);
        virtual ~PackageContainerInterface();
 
        APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
        virtual ~PackageContainerInterface();
 
        APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
@@ -310,7 +310,7 @@ public:                                                                     /*{{{*/
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {
                typename Container::const_iterator _iter;
        public:
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {
                typename Container::const_iterator _iter;
        public:
-               const_iterator(typename Container::const_iterator i) : _iter(i) {}
+               explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
@@ -324,7 +324,7 @@ public:                                                                     /*{{{*/
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
-               iterator(typename Container::iterator i) : _iter(i) {}
+               explicit iterator(typename Container::iterator i) : _iter(i) {}
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }
@@ -359,7 +359,7 @@ public:                                                                     /*{{{*/
        const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
 
        PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {}
        const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
 
        PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {}
-       PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
+       explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
 APT_IGNORE_DEPRECATED_PUSH
        APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
 APT_IGNORE_DEPRECATED_POP
 APT_IGNORE_DEPRECATED_PUSH
        APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
 APT_IGNORE_DEPRECATED_POP
@@ -568,7 +568,7 @@ public:
        APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
        APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
 
        APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
        APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
 
-       APT_PUBLIC PackageUniverse(pkgCache * const Owner);
+       explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner);
        APT_PUBLIC virtual ~PackageUniverse();
 
 private:
        APT_PUBLIC virtual ~PackageUniverse();
 
 private:
@@ -744,7 +744,7 @@ public:                                                                     /*{{{*/
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {/*{{{*/
                typename Container::const_iterator _iter;
        public:
                               public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {/*{{{*/
                typename Container::const_iterator _iter;
        public:
-               const_iterator(typename Container::const_iterator i) : _iter(i) {}
+               explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::const_iterator(void) const { return _iter; }
@@ -758,7 +758,7 @@ public:                                                                     /*{{{*/
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
                         public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
                typename Container::iterator _iter;
        public:
-               iterator(typename Container::iterator i) : _iter(i) {}
+               explicit iterator(typename Container::iterator i) : _iter(i) {}
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; }
                operator typename Container::iterator(void) const { return _iter; }
index 46cf0ba083af22cd62f182a6688df7b5f4669137..05a1376536eadb5038a3838229dde30575ebf6ef 100644 (file)
@@ -276,7 +276,7 @@ public:
    unsigned long long FileSize;
    unsigned int CalcHashes;
 
    unsigned long long FileSize;
    unsigned int CalcHashes;
 
-   PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {}
+   explicit PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {}
 };
                                                                        /*}}}*/
 // Hashes::Add* - Add the contents of data or FD                       /*{{{*/
 };
                                                                        /*}}}*/
 // Hashes::Add* - Add the contents of data or FD                       /*{{{*/
index 869dc5cb76a41ddc3c251063edc6f22629231d4a..d0ea0971ea5e2502e92ef18845789604765836fa 100644 (file)
@@ -87,7 +87,7 @@ class HashSumValue
          Sum[I] = S[I];
    }
 
          Sum[I] = S[I];
    }
 
-   HashSumValue(std::string Str)
+   explicit HashSumValue(std::string const &Str)
    {
          memset(Sum,0,sizeof(Sum));
          Set(Str);
    {
          memset(Sum,0,sizeof(Sum));
          Set(Str);
index 5731b5a2b157b4d316b698e7bcbee8132f9ca252..05624f7fba8a6f4fea0fd2d19ee92f871d97756a 100644 (file)
@@ -1308,7 +1308,7 @@ void ioprintf(ostream &out,const char *format,...)
    va_list args;
    ssize_t size = 400;
    while (true) {
    va_list args;
    ssize_t size = 400;
    while (true) {
-      bool ret = false;
+      bool ret;
       va_start(args,format);
       ret = iovprintf(out, format, args, size);
       va_end(args);
       va_start(args,format);
       ret = iovprintf(out, format, args, size);
       va_end(args);
@@ -1322,7 +1322,7 @@ void strprintf(string &out,const char *format,...)
    ssize_t size = 400;
    std::ostringstream outstr;
    while (true) {
    ssize_t size = 400;
    std::ostringstream outstr;
    while (true) {
-      bool ret = false;
+      bool ret;
       va_start(args,format);
       ret = iovprintf(outstr, format, args, size);
       va_end(args);
       va_start(args,format);
       ret = iovprintf(outstr, format, args, size);
       va_end(args);
index 34fc988385068dcf53fc0454eefbd6a3b75c012b..430a5021b2e07a11d737d15c476b3e187acbf97c 100644 (file)
@@ -103,7 +103,7 @@ debReleaseIndex::~debReleaseIndex() {
 }
 
 template<typename CallC>
 }
 
 template<typename CallC>
-void foreachTarget(std::string const URI, std::string const Dist,
+void foreachTarget(std::string const &URI, std::string const &Dist,
       std::map<std::string, std::vector<debReleaseIndex::debSectionEntry const *> > const &ArchEntries,
       CallC &Call)
 {
       std::map<std::string, std::vector<debReleaseIndex::debSectionEntry const *> > const &ArchEntries,
       CallC &Call)
 {
index 36e1ac9ecf7001cbcd04ae481b8042a4b0b25ee3..921cbced55f6470fc8b7893966a137ce5fa94657 100644 (file)
@@ -95,7 +95,9 @@ pkgDepCache::ActionGroup::~ActionGroup()
 // ---------------------------------------------------------------------
 /* */
 pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) :
 // ---------------------------------------------------------------------
 /* */
 pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) :
-  group_level(0), Cache(pCache), PkgState(0), DepState(0)
+  group_level(0), Cache(pCache), PkgState(0), DepState(0),
+   iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0),
+   iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0)
 {
    DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false);
    DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false);
 {
    DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false);
    DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false);
@@ -947,7 +949,7 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
 /* */
 struct CompareProviders {
    pkgCache::PkgIterator const Pkg;
 /* */
 struct CompareProviders {
    pkgCache::PkgIterator const Pkg;
-   CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {};
+   explicit CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {};
    //bool operator() (APT::VersionList::iterator const &AV, APT::VersionList::iterator const &BV)
    bool operator() (pkgCache::VerIterator const &AV, pkgCache::VerIterator const &BV)
    {
    //bool operator() (APT::VersionList::iterator const &AV, APT::VersionList::iterator const &BV)
    bool operator() (pkgCache::VerIterator const &AV, pkgCache::VerIterator const &BV)
    {
index 94c1088f2ad12620269c630eee5749867414c9cf..0594a253d2e1cb0c1fa1a4e058b1c6c2f3d7e1a2 100644 (file)
@@ -179,7 +179,7 @@ class pkgDepCache : protected pkgCache::Namespace
        *  As long as this object exists, no automatic cleanup
        *  operations will be undertaken.
        */
        *  As long as this object exists, no automatic cleanup
        *  operations will be undertaken.
        */
-       ActionGroup(pkgDepCache &cache);
+       explicit ActionGroup(pkgDepCache &cache);
 
        /** \brief Clean up the action group before it is destroyed.
         *
 
        /** \brief Clean up the action group before it is destroyed.
         *
index 120d061ad942816bce25739db05ec0fd8750b6ba..b0f191deda9cd82f2aa9ac87869e351e9d22b206 100644 (file)
@@ -424,7 +424,6 @@ bool PackageCopy::GetFile(string &File,unsigned long long &Size)
 // PackageCopy::RewriteEntry - Rewrite the entry with a new filename   /*{{{*/
 bool PackageCopy::RewriteEntry(FileFd &Target,string const &File)
 {
 // PackageCopy::RewriteEntry - Rewrite the entry with a new filename   /*{{{*/
 bool PackageCopy::RewriteEntry(FileFd &Target,string const &File)
 {
-   string const Dir(File,0,File.rfind('/'));
    std::vector<pkgTagSection::Tag> Changes;
    Changes.push_back(pkgTagSection::Tag::Rewrite("Filename", File));
 
    std::vector<pkgTagSection::Tag> Changes;
    Changes.push_back(pkgTagSection::Tag::Rewrite("Filename", File));
 
index c51879bb895c760c172fa8bc6f34f94816d772e6..b6472e201c2761367d222c411a5c1a890fa1eaf9 100644 (file)
@@ -144,7 +144,7 @@ class pkgIndexFile
 
    bool IsTrusted() const { return Trusted; };
 
 
    bool IsTrusted() const { return Trusted; };
 
-   pkgIndexFile(bool Trusted);
+   explicit pkgIndexFile(bool Trusted);
    virtual ~pkgIndexFile();
 };
 
    virtual ~pkgIndexFile();
 };
 
index 7e6da9558e017af0ea799b32bc3aa958891d5d03..5a93d826fe29de75447b678a9009ff9a6af1c878 100644 (file)
@@ -42,7 +42,7 @@ APT_PURE bool indexRecords::GetSupportsAcquireByHash() const
    return this->SupportsAcquireByHash;
 }
 
    return this->SupportsAcquireByHash;
 }
 
-APT_PURE bool indexRecords::CheckDist(const string MaybeDist) const
+APT_PURE bool indexRecords::CheckDist(string const &MaybeDist) const
 {
    return (this->Dist == MaybeDist
           || this->Suite == MaybeDist);
 {
    return (this->Dist == MaybeDist
           || this->Suite == MaybeDist);
@@ -63,7 +63,7 @@ APT_PURE time_t indexRecords::GetDate() const
    return this->Date;
 }
 
    return this->Date;
 }
 
-APT_PURE indexRecords::checkSum *indexRecords::Lookup(const string MetaKey)
+APT_PURE indexRecords::checkSum *indexRecords::Lookup(string const &MetaKey)
 {
    std::map<std::string, indexRecords::checkSum* >::const_iterator sum = Entries.find(MetaKey);
    if (sum == Entries.end())
 {
    std::map<std::string, indexRecords::checkSum* >::const_iterator sum = Entries.find(MetaKey);
    if (sum == Entries.end())
@@ -76,7 +76,7 @@ APT_PURE bool indexRecords::Exists(string const &MetaKey) const
    return Entries.find(MetaKey) != Entries.end();
 }
 
    return Entries.find(MetaKey) != Entries.end();
 }
 
-bool indexRecords::Load(const string Filename)                         /*{{{*/
+bool indexRecords::Load(string const &Filename)                                /*{{{*/
 {
    FileFd Fd;
    if (OpenMaybeClearSignedFile(Filename, Fd) == false)
 {
    FileFd Fd;
    if (OpenMaybeClearSignedFile(Filename, Fd) == false)
@@ -272,23 +272,10 @@ void indexRecords::SetTrusted(bool const Trusted)
       this->Trusted = NEVER_TRUSTED;
 }
 
       this->Trusted = NEVER_TRUSTED;
 }
 
-#if APT_PKG_ABI >= 413
 indexRecords::indexRecords(const string &ExpectedDist) :
    Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
    SupportsAcquireByHash(false)
 {
 }
 indexRecords::indexRecords(const string &ExpectedDist) :
    Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
    SupportsAcquireByHash(false)
 {
 }
-#else
-indexRecords::indexRecords() :
-   Trusted(CHECK_TRUST), d(NULL), ExpectedDist(""), ValidUntil(0),
-   SupportsAcquireByHash(false)
-{
-}
-indexRecords::indexRecords(const string ExpectedDist) :
-   Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
-   SupportsAcquireByHash(false)
-{
-}
-#endif
 
 indexRecords::~indexRecords() {}
 
 indexRecords::~indexRecords() {}
index f7dfa3235176ebecb1c3727344ddb80ea1c3443c..3ff0725907a305cb013bf81d7dcbecec76e671b5 100644 (file)
@@ -40,21 +40,16 @@ class indexRecords
    std::map<std::string,checkSum *> Entries;
 
    public:
    std::map<std::string,checkSum *> Entries;
 
    public:
-#if APT_PKG_ABI >= 413
-   indexRecords(const std::string &ExpectedDist = "");
-#else
-   indexRecords();
-   indexRecords(const std::string ExpectedDist);
-#endif
+   explicit indexRecords(const std::string &ExpectedDist = "");
 
    // Lookup function
 
    // Lookup function
-   virtual checkSum *Lookup(const std::string MetaKey);
+   virtual checkSum *Lookup(std::string const &MetaKey);
    /** \brief tests if a checksum for this file is available */
    bool Exists(std::string const &MetaKey) const;
    std::vector<std::string> MetaKeys();
 
    /** \brief tests if a checksum for this file is available */
    bool Exists(std::string const &MetaKey) const;
    std::vector<std::string> MetaKeys();
 
-   virtual bool Load(std::string Filename);
-   virtual bool CheckDist(const std::string MaybeDist) const;
+   virtual bool Load(std::string const &Filename);
+   virtual bool CheckDist(std::string const &MaybeDist) const;
 
    std::string GetDist() const;
    std::string GetSuite() const;
 
    std::string GetDist() const;
    std::string GetSuite() const;
index a4c5daf7f682fad0d59f9a433b9e0d9637764a0a..5da3624c07c058aafc25d102ec5b94ccf4b43779 100644 (file)
@@ -69,7 +69,7 @@ namespace Progress {
     void WriteToStatusFd(std::string msg);
 
  public:
     void WriteToStatusFd(std::string msg);
 
  public:
-    PackageManagerProgressFd(int progress_fd);
+    explicit PackageManagerProgressFd(int progress_fd);
     virtual ~PackageManagerProgressFd();
 
     virtual void StartDpkg();
     virtual ~PackageManagerProgressFd();
 
     virtual void StartDpkg();
@@ -100,7 +100,7 @@ namespace Progress {
     void WriteToStatusFd(std::string msg);
 
  public:
     void WriteToStatusFd(std::string msg);
 
  public:
-    PackageManagerProgressDeb822Fd(int progress_fd);
+    explicit PackageManagerProgressDeb822Fd(int progress_fd);
     virtual ~PackageManagerProgressDeb822Fd();
 
     virtual void StartDpkg();
     virtual ~PackageManagerProgressDeb822Fd();
 
     virtual void StartDpkg();
index 29ef79b84f3ba21d99a777863d060808e320d13f..6d9f45eed16a3329298324b0cef531f9588904e0 100644 (file)
@@ -122,7 +122,7 @@ class pkgOrderList : protected pkgCache::Namespace
 
    int Score(PkgIterator Pkg);
 
 
    int Score(PkgIterator Pkg);
 
-   pkgOrderList(pkgDepCache *Cache);
+   explicit pkgOrderList(pkgDepCache *Cache);
    virtual ~pkgOrderList();
 };
 
    virtual ~pkgOrderList();
 };
 
index 60414ae1cb2c2ab0f5395bf1c66bf0dd24513a10..2cdf92cdd0e96354c13e00111a3beb199dd3cee2 100644 (file)
@@ -141,7 +141,7 @@ class pkgPackageManager : protected pkgCache::Namespace
    /** \brief returns all packages dpkg let disappear */
    inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
 
    /** \brief returns all packages dpkg let disappear */
    inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
 
-   pkgPackageManager(pkgDepCache *Cache);
+   explicit pkgPackageManager(pkgDepCache *Cache);
    virtual ~pkgPackageManager();
 
    private:
    virtual ~pkgPackageManager();
 
    private:
index 3c1a40972238045b63088a2721ba6818cf493620..c7b6de1b6b5a62f6f3a22a43ef52a3474a2bd796 100644 (file)
@@ -54,7 +54,7 @@ class APT_HIDDEN pkgCacheGenerator                                    /*{{{*/
    template<typename Iter> class Dynamic {
       public:
       static std::vector<Iter*> toReMap;
    template<typename Iter> class Dynamic {
       public:
       static std::vector<Iter*> toReMap;
-      Dynamic(Iter &I) {
+      explicit Dynamic(Iter &I) {
         toReMap.push_back(&I);
       }
 
         toReMap.push_back(&I);
       }
 
index 66eb17857e829fc83b6f889f96fb9d82f23b0757..766e845aa5923b85786c98ea633740a6a241be3e 100644 (file)
@@ -42,7 +42,7 @@ class pkgRecords                                                      /*{{{*/
    Parser &Lookup(pkgCache::DescFileIterator const &Desc);
 
    // Construct destruct
    Parser &Lookup(pkgCache::DescFileIterator const &Desc);
 
    // Construct destruct
-   pkgRecords(pkgCache &Cache);
+   explicit pkgRecords(pkgCache &Cache);
    virtual ~pkgRecords();
 };
                                                                        /*}}}*/
    virtual ~pkgRecords();
 };
                                                                        /*}}}*/
index 4efe2ec504aa90ccf7c7a02f0b9446aeff4fc769..0d2b468bca768b0f6cde9f274379587ae7524324 100644 (file)
@@ -59,7 +59,7 @@ class pkgPolicy : public pkgDepCache::Policy
    struct PkgPin : Pin
    {
       std::string Pkg;
    struct PkgPin : Pin
    {
       std::string Pkg;
-      PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {};
+      explicit PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {};
    };
    
    Pin *Pins;
    };
    
    Pin *Pins;
@@ -85,7 +85,7 @@ class pkgPolicy : public pkgDepCache::Policy
 
    bool InitDefaults();
    
 
    bool InitDefaults();
    
-   pkgPolicy(pkgCache *Owner);
+   explicit pkgPolicy(pkgCache *Owner);
    virtual ~pkgPolicy();
    private:
    pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg);
    virtual ~pkgPolicy();
    private:
    pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg);
index c92643829f952242042831d4f7708338360c36e3..d9eacc08fbff7d02a5d4a03df4e6f3dba08f59e0 100644 (file)
@@ -117,7 +117,7 @@ class pkgSourceList
    time_t GetLastModifiedTime();
 
    pkgSourceList();
    time_t GetLastModifiedTime();
 
    pkgSourceList();
-   pkgSourceList(std::string File);
+   explicit pkgSourceList(std::string File);
    virtual ~pkgSourceList();
 };
 
    virtual ~pkgSourceList();
 };
 
index 3175ee75f5145bd3d7a829f6be2d36f05952fea0..bbab9d796c2ecf22f2e0f9969cf006f00de3ffe7 100644 (file)
@@ -178,3 +178,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
+
+
+pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : iIndex(Index) {}
+pkgSrcRecords::Parser::~Parser() {}
index dda66ce4886fd665a98fe3201f49740792cb6489..71173c95354b8a4c757c0df688d3ce9fc37f6c99 100644 (file)
@@ -48,6 +48,7 @@ APT_IGNORE_DEPRECATED_POP
    // Abstract parser for each source record
    class Parser
    {
    // Abstract parser for each source record
    class Parser
    {
+      void *d;
       protected:
       
       const pkgIndexFile *iIndex;
       protected:
       
       const pkgIndexFile *iIndex;
@@ -85,9 +86,9 @@ APT_IGNORE_DEPRECATED_POP
 
       virtual bool Files(std::vector<pkgSrcRecords::File> &F) = 0;
       bool Files2(std::vector<pkgSrcRecords::File2> &F);
 
       virtual bool Files(std::vector<pkgSrcRecords::File> &F) = 0;
       bool Files2(std::vector<pkgSrcRecords::File2> &F);
-      
-      Parser(const pkgIndexFile *Index) : iIndex(Index) {};
-      virtual ~Parser() {};
+
+      explicit Parser(const pkgIndexFile *Index);
+      virtual ~Parser();
    };
    
    private:
    };
    
    private:
@@ -110,8 +111,8 @@ APT_IGNORE_DEPRECATED_POP
    // Locate a package by name and return pointer to the Parser.
    // The pointer is owned by libapt.
    Parser* Find(const char *Package,bool const &SrcOnly = false);
    // Locate a package by name and return pointer to the Parser.
    // The pointer is owned by libapt.
    Parser* Find(const char *Package,bool const &SrcOnly = false);
-   
-   pkgSrcRecords(pkgSourceList &List);
+
+   explicit pkgSrcRecords(pkgSourceList &List);
    virtual ~pkgSrcRecords();
 };
 
    virtual ~pkgSrcRecords();
 };
 
index 5ff495fbdc5797322b7ee155c8e5bfc4076a47ff..130aef19d34e7014f4fc592d94ae468aa0dcd2c8 100644 (file)
@@ -59,7 +59,7 @@ public:
       unsigned int StartValue;
       unsigned int NextInBucket;
 
       unsigned int StartValue;
       unsigned int NextInBucket;
 
-      TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
+      explicit TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
    };
    std::vector<TagData> Tags;
 };
    };
    std::vector<TagData> Tags;
 };
index 829cdae755c39b5ca8eb5c1d6542c6f3589310e0..b129a2d51d5fc9ac298650664a9ba5900a5458ac 100644 (file)
@@ -24,7 +24,7 @@ class DebFile : public pkgDirStream
        unsigned long ControlLen;
        
 public:
        unsigned long ControlLen;
        
 public:
-       DebFile(const char *FileName);
+       explicit DebFile(const char *FileName);
        ~DebFile();
        bool DoItem(Item &I, int &fd);
        bool Process(pkgDirStream::Item &I, const unsigned char *data, 
        ~DebFile();
        bool DoItem(Item &I, int &fd);
        bool Process(pkgDirStream::Item &I, const unsigned char *data,