From 67c3067f1a615fd6ff0b332c2a526d052442913d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Feb 2014 22:22:41 +0100 Subject: fix -Wmissing-field-initializers warnings Reported-By: gcc Git-Dch: Ignore --- apt-pkg/indexcopy.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 7694cb1dd..9ea244139 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -436,8 +436,8 @@ bool PackageCopy::GetFile(string &File,unsigned long long &Size) /* */ bool PackageCopy::RewriteEntry(FILE *Target,string File) { - TFRewriteData Changes[] = {{"Filename",File.c_str()}, - {}}; + TFRewriteData Changes[] = {{ "Filename", File.c_str(), NULL }, + { NULL, NULL, NULL }}; if (TFRewrite(Target,*Section,TFRewritePackageOrder,Changes) == false) return false; @@ -482,8 +482,8 @@ bool SourceCopy::GetFile(string &File,unsigned long long &Size) bool SourceCopy::RewriteEntry(FILE *Target,string File) { string Dir(File,0,File.rfind('/')); - TFRewriteData Changes[] = {{"Directory",Dir.c_str()}, - {}}; + TFRewriteData Changes[] = {{ "Directory", Dir.c_str(), NULL }, + { NULL, NULL, NULL }}; if (TFRewrite(Target,*Section,TFRewriteSourceOrder,Changes) == false) return false; -- cgit v1.2.3 From d3e8fbb395f57954acd7a2095f02ce530a05ec6a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 01:20:53 +0100 Subject: =?UTF-8?q?warning:=20extra=20=E2=80=98;=E2=80=99=20[-Wpedantic]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git-Dch: Ignore Reported-By: gcc -Wpedantic --- apt-pkg/indexcopy.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 9ea244139..89c9d531f 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -646,12 +646,12 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd, int fd[2]) { ExecGPGV(File, FileOut, statusfd, fd); return false; -}; +} bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd) { ExecGPGV(File, FileOut, statusfd); return false; -}; +} /*}}}*/ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ vector &List, pkgCdromStatus *log) -- cgit v1.2.3 From e788a834ce421042e727b72e43177edaa47e53a7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 02:18:11 +0100 Subject: warning: useless cast to type A [-Wuseless-cast] Git-Dch: Ignore Reported-By: gcc -Wuseless-cast --- apt-pkg/indexcopy.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 89c9d531f..38356df18 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -65,7 +65,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, for (std::vector::const_iterator c = compressor.begin(); c != compressor.end(); ++c) { - if (stat(std::string(file + c->Extension).c_str(), &Buf) != 0) + if (stat((file + c->Extension).c_str(), &Buf) != 0) continue; found = true; break; @@ -160,7 +160,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, // Get the size struct stat Buf; - if (stat(string(CDROM + Prefix + File).c_str(),&Buf) != 0 || + if (stat((CDROM + Prefix + File).c_str(),&Buf) != 0 || Buf.st_size == 0) { bool Mangled = false; @@ -175,7 +175,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, } if (Mangled == false || - stat(string(CDROM + Prefix + File).c_str(),&Buf) != 0) + stat((CDROM + Prefix + File).c_str(),&Buf) != 0) { if (Debug == true) clog << "Missed(2): " << OrigFile << endl; @@ -286,7 +286,7 @@ bool IndexCopy::ReconstructPrefix(string &Prefix,string OrigPath,string CD, while (1) { struct stat Buf; - if (stat(string(CD + MyPrefix + File).c_str(),&Buf) != 0) + if (stat((CD + MyPrefix + File).c_str(),&Buf) != 0) { if (Debug == true) cout << "Failed, " << CD + MyPrefix + File << endl; @@ -315,7 +315,7 @@ bool IndexCopy::ReconstructChop(unsigned long &Chop,string Dir,string File) while (1) { struct stat Buf; - if (stat(string(Dir + File).c_str(),&Buf) != 0) + if (stat((Dir + File).c_str(),&Buf) != 0) { File = ChopDirs(File,1); Depth++; @@ -676,7 +676,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ for (std::vector::const_iterator c = compressor.begin(); c != compressor.end(); ++c) { - if (stat(std::string(file + c->Extension).c_str(), &Buf) != 0) + if (stat((file + c->Extension).c_str(), &Buf) != 0) continue; found = true; break; -- cgit v1.2.3 From 655122418d714f342b5d9789f45f8035f3fe8b9a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 1 Mar 2014 15:11:42 +0100 Subject: =?UTF-8?q?warning:=20unused=20parameter=20=E2=80=98foo=E2=80=99?= =?UTF-8?q?=20[-Wunused-parameter]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-By: gcc -Wunused-parameter Git-Dch: Ignore --- apt-pkg/indexcopy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 38356df18..59afa86ec 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -551,7 +551,7 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/ } /*}}}*/ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, /*{{{*/ - vector PkgList,vector SrcList) + vector /*PkgList*/,vector /*SrcList*/) { if (SigList.empty() == true) return true; -- cgit v1.2.3 From 453b82a388013e522b3a1b9fcd6ed0810dab1f4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Mar 2014 22:11:25 +0100 Subject: cleanup headers and especially #includes everywhere Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use) --- apt-pkg/indexcopy.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 59afa86ec..3a1385fa5 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -20,17 +20,17 @@ #include #include #include -#include #include +#include +#include #include #include #include #include -#include -#include #include #include +#include #include "indexcopy.h" #include -- cgit v1.2.3 From a02db58fd50ef7fc2f0284852c6b3f98e458a232 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 Mar 2014 00:33:10 +0100 Subject: follow method attribute suggestions by gcc Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn} --- apt-pkg/indexcopy.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 3a1385fa5..854ba1bd7 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -642,15 +642,13 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, } /*}}}*/ // SigVerify::RunGPGV - deprecated wrapper calling ExecGPGV /*{{{*/ -bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, +APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd, int fd[2]) { ExecGPGV(File, FileOut, statusfd, fd); - return false; } -bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, +APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd) { ExecGPGV(File, FileOut, statusfd); - return false; } /*}}}*/ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ -- cgit v1.2.3