Explorar o código

Fix more warnings from clang

Reported-By: clang++ -Werror
Michael Vogt %!s(int64=12) %!d(string=hai) anos
pai
achega
32228b90a7

+ 3 - 3
apt-pkg/acquire-item.cc

@@ -1364,7 +1364,7 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
 pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,			/*{{{*/
 pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,			/*{{{*/
 				 string URI,string URIDesc,string ShortDesc,
 				 string URI,string URIDesc,string ShortDesc,
 				 string SigFile,
 				 string SigFile,
-				 const vector<struct IndexTarget*>* IndexTargets,
+				 const vector<IndexTarget*>* IndexTargets,
 				 indexRecords* MetaIndexParser) :
 				 indexRecords* MetaIndexParser) :
    Item(Owner), RealURI(URI), SigFile(SigFile), IndexTargets(IndexTargets),
    Item(Owner), RealURI(URI), SigFile(SigFile), IndexTargets(IndexTargets),
    MetaIndexParser(MetaIndexParser), AuthPass(false), IMSHit(false)
    MetaIndexParser(MetaIndexParser), AuthPass(false), IMSHit(false)
@@ -1556,7 +1556,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)				/*{{{*/
 	 }
 	 }
    }
    }
 
 
-   for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
+   for (vector <IndexTarget*>::const_iterator Target = IndexTargets->begin();
         Target != IndexTargets->end();
         Target != IndexTargets->end();
         ++Target)
         ++Target)
    {
    {
@@ -1778,7 +1778,7 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire *Owner,		/*{{{*/
 		string const &URI, string const &URIDesc, string const &ShortDesc,
 		string const &URI, string const &URIDesc, string const &ShortDesc,
 		string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
 		string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
 		string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
 		string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
-		const vector<struct IndexTarget*>* IndexTargets,
+		const vector<IndexTarget*>* IndexTargets,
 		indexRecords* MetaIndexParser) :
 		indexRecords* MetaIndexParser) :
 	pkgAcqMetaIndex(Owner, URI, URIDesc, ShortDesc, "", IndexTargets, MetaIndexParser),
 	pkgAcqMetaIndex(Owner, URI, URIDesc, ShortDesc, "", IndexTargets, MetaIndexParser),
 	MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
 	MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),

+ 8 - 7
apt-pkg/acquire-item.h

@@ -46,6 +46,7 @@
 class indexRecords;
 class indexRecords;
 class pkgRecords;
 class pkgRecords;
 class pkgSourceList;
 class pkgSourceList;
+class IndexTarget;
 
 
 /** \brief Represents the process by which a pkgAcquire object should	{{{
 /** \brief Represents the process by which a pkgAcquire object should	{{{
  *  retrieve a file or a collection of files.
  *  retrieve a file or a collection of files.
@@ -745,7 +746,7 @@ class pkgAcqIndex : public pkgAcquire::Item
    pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
    pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
 	       std::string ShortDesc, HashString ExpectedHash, 
 	       std::string ShortDesc, HashString ExpectedHash, 
 	       std::string compressExt="");
 	       std::string compressExt="");
-   pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
+   pkgAcqIndex(pkgAcquire *Owner, IndexTarget const * const Target,
 			 HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
 			 HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
    void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
    void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
 };
 };
@@ -777,7 +778,7 @@ class pkgAcqIndexTrans : public pkgAcqIndex
     */
     */
    pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
    pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
 		    std::string ShortDesc);
 		    std::string ShortDesc);
-   pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
+   pkgAcqIndexTrans(pkgAcquire *Owner, IndexTarget const * const Target,
 		    HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
 		    HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
 };
 };
 									/*}}}*/
 									/*}}}*/
@@ -876,7 +877,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
     *
     *
     *  \todo Why a list of pointers instead of a list of structs?
     *  \todo Why a list of pointers instead of a list of structs?
     */
     */
-   const std::vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<IndexTarget*>* IndexTargets;
 
 
    public:
    public:
    
    
@@ -890,7 +891,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
    /** \brief Create a new pkgAcqMetaSig. */
    /** \brief Create a new pkgAcqMetaSig. */
    pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
    pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
 		 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
 		 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
-		 const std::vector<struct IndexTarget*>* IndexTargets,
+		 const std::vector<IndexTarget*>* IndexTargets,
 		 indexRecords* MetaIndexParser);
 		 indexRecords* MetaIndexParser);
    virtual ~pkgAcqMetaSig();
    virtual ~pkgAcqMetaSig();
 };
 };
@@ -924,7 +925,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    std::string SigFile;
    std::string SigFile;
 
 
    /** \brief The index files to download. */
    /** \brief The index files to download. */
-   const std::vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<IndexTarget*>* IndexTargets;
 
 
    /** \brief The parser for the meta-index file. */
    /** \brief The parser for the meta-index file. */
    indexRecords* MetaIndexParser;
    indexRecords* MetaIndexParser;
@@ -987,7 +988,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    pkgAcqMetaIndex(pkgAcquire *Owner,
    pkgAcqMetaIndex(pkgAcquire *Owner,
 		   std::string URI,std::string URIDesc, std::string ShortDesc,
 		   std::string URI,std::string URIDesc, std::string ShortDesc,
 		   std::string SigFile,
 		   std::string SigFile,
-		   const std::vector<struct IndexTarget*>* IndexTargets,
+		   const std::vector<IndexTarget*>* IndexTargets,
 		   indexRecords* MetaIndexParser);
 		   indexRecords* MetaIndexParser);
 };
 };
 									/*}}}*/
 									/*}}}*/
@@ -1021,7 +1022,7 @@ public:
 		std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
 		std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
 		std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
 		std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
 		std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
 		std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
-		const std::vector<struct IndexTarget*>* IndexTargets,
+		const std::vector<IndexTarget*>* IndexTargets,
 		indexRecords* MetaIndexParser);
 		indexRecords* MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
    virtual ~pkgAcqMetaClearSig();
 };
 };

+ 1 - 1
apt-pkg/cacheset.h

@@ -584,7 +584,7 @@ public:									/*{{{*/
 
 
 	static VersionContainer FromString(pkgCacheFile &Cache, std::string const &pkg,
 	static VersionContainer FromString(pkgCacheFile &Cache, std::string const &pkg,
 			Version const &fallback, CacheSetHelper &helper,
 			Version const &fallback, CacheSetHelper &helper,
-			bool const onlyFromName = false) {
+                                           bool const /*onlyFromName = false*/) {
 		VersionContainer vercon;
 		VersionContainer vercon;
 		VersionContainerInterface::FromString(&vercon, Cache, pkg, fallback, helper);
 		VersionContainerInterface::FromString(&vercon, Cache, pkg, fallback, helper);
 		return vercon;
 		return vercon;

+ 4 - 4
apt-pkg/deb/debmetaindex.cc

@@ -186,8 +186,8 @@ debReleaseIndex::~debReleaseIndex() {
 			delete *S;
 			delete *S;
 }
 }
 
 
-vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
-	vector <struct IndexTarget *>* IndexTargets = new vector <IndexTarget *>;
+vector <IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
+	vector <IndexTarget *>* IndexTargets = new vector <IndexTarget *>;
 
 
 	map<string, vector<debSectionEntry const*> >::const_iterator const src = ArchEntries.find("source");
 	map<string, vector<debSectionEntry const*> >::const_iterator const src = ArchEntries.find("source");
 	if (src != ArchEntries.end()) {
 	if (src != ArchEntries.end()) {
@@ -255,8 +255,8 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
 
 
    // special case for --print-uris
    // special case for --print-uris
    if (GetAll) {
    if (GetAll) {
-      vector <struct IndexTarget *> *targets = ComputeIndexTargets();
-      for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) {
+      vector <IndexTarget *> *targets = ComputeIndexTargets();
+      for (vector <IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) {
 	 new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
 	 new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
 			 (*Target)->ShortDesc, HashString());
 			 (*Target)->ShortDesc, HashString());
       }
       }

+ 2 - 1
apt-pkg/deb/debmetaindex.h

@@ -18,6 +18,7 @@
 
 
 class pkgAcquire;
 class pkgAcquire;
 class pkgIndexFile;
 class pkgIndexFile;
+class IndexTarget;
 
 
 class debReleaseIndex : public metaIndex {
 class debReleaseIndex : public metaIndex {
    public:
    public:
@@ -44,7 +45,7 @@ class debReleaseIndex : public metaIndex {
 
 
    virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
    virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
    virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
    virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
-   std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
+   std::vector <IndexTarget *>* ComputeIndexTargets() const;
    std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
    std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
 
 
    std::string MetaIndexInfo(const char *Type) const;
    std::string MetaIndexInfo(const char *Type) const;

+ 3 - 2
apt-pkg/deb/debsrcrecords.cc

@@ -55,12 +55,13 @@ const char **debSrcRecordParser::Binaries()
       char* binStartNext = strchrnul(bin, ',');
       char* binStartNext = strchrnul(bin, ',');
       char* binEnd = binStartNext - 1;
       char* binEnd = binStartNext - 1;
       for (; isspace(*binEnd) != 0; --binEnd)
       for (; isspace(*binEnd) != 0; --binEnd)
-	 binEnd = '\0';
+	 binEnd = 0;
       StaticBinList.push_back(bin);
       StaticBinList.push_back(bin);
       if (*binStartNext != ',')
       if (*binStartNext != ',')
 	 break;
 	 break;
       *binStartNext = '\0';
       *binStartNext = '\0';
-      for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin);
+      for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin)
+         ;
    } while (*bin != '\0');
    } while (*bin != '\0');
    StaticBinList.push_back(NULL);
    StaticBinList.push_back(NULL);
 
 

+ 1 - 1
apt-pkg/pkgrecords.cc

@@ -26,7 +26,7 @@
 // Records::pkgRecords - Constructor					/*{{{*/
 // Records::pkgRecords - Constructor					/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* This will create the necessary structures to access the status files */
 /* This will create the necessary structures to access the status files */
-pkgRecords::pkgRecords(pkgCache &Cache) : d(NULL), Cache(Cache),
+pkgRecords::pkgRecords(pkgCache &aCache) : d(NULL), Cache(aCache),
   Files(Cache.HeaderP->PackageFileCount)
   Files(Cache.HeaderP->PackageFileCount)
 {
 {
    for (pkgCache::PkgFileIterator I = Cache.FileBegin();
    for (pkgCache::PkgFileIterator I = Cache.FileBegin();