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 --- ftparchive/apt-ftparchive.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftparchive') diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 712f8469a..d14b68044 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -484,7 +484,7 @@ void LoadTree(vector &PkgList,Configuration &Setup) struct SubstVar const Vars[] = {{"$(DIST)",&Dist}, {"$(SECTION)",&Section}, {"$(ARCH)",&Arch}, - {}}; + {NULL, NULL}}; mode_t const Perms = Block.FindI("FileMode", Permissions); bool const LongDesc = Block.FindB("LongDescription", LongDescription); TranslationWriter *TransWriter; -- 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 --- ftparchive/override.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ftparchive') diff --git a/ftparchive/override.cc b/ftparchive/override.cc index d2130db8a..82cbc4c19 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -201,7 +201,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source) } /*}}}*/ -// Override::GetItem - Get a architecture specific item /*{{{*/ +// Override::GetItem - Get a architecture specific item /*{{{*/ // --------------------------------------------------------------------- /* Returns a override item for the given package and the given architecture. * Treats "all" special @@ -232,10 +232,10 @@ Override::Item* Override::GetItem(string const &Package, string const &Architect { result->FieldOverride[foI->first] = foI->second; } - } - } + } + } return result; -}; +} // Override::Item::SwapMaint - Swap the maintainer field if necessary /*{{{*/ -- cgit v1.2.3 From c3ccac9232c2684b15f75fa8622a9a290aeca123 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 03:11:54 +0100 Subject: warning: no previous declaration for foobar() [-Wmissing-declarations] Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations --- ftparchive/apt-ftparchive.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ftparchive') diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index d14b68044..c28ad5c5c 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -438,7 +438,7 @@ bool PackageMap::GenContents(Configuration &Setup, // --------------------------------------------------------------------- /* This populates the PkgList with all the possible permutations of the section/arch lists. */ -void LoadTree(vector &PkgList,Configuration &Setup) +static void LoadTree(vector &PkgList,Configuration &Setup) { // Load the defaults string DDir = Setup.Find("TreeDefault::Directory", @@ -550,7 +550,7 @@ void LoadTree(vector &PkgList,Configuration &Setup) // LoadBinDir - Load a 'bindirectory' section from the Generate Config /*{{{*/ // --------------------------------------------------------------------- /* */ -void LoadBinDir(vector &PkgList,Configuration &Setup) +static void LoadBinDir(vector &PkgList,Configuration &Setup) { mode_t const Permissions = Setup.FindI("Default::FileMode",0644); @@ -586,7 +586,7 @@ void LoadBinDir(vector &PkgList,Configuration &Setup) // ShowHelp - Show the help text /*{{{*/ // --------------------------------------------------------------------- /* */ -bool ShowHelp(CommandLine &CmdL) +static bool ShowHelp(CommandLine &CmdL) { ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); @@ -639,7 +639,7 @@ bool ShowHelp(CommandLine &CmdL) // SimpleGenPackages - Generate a Packages file for a directory tree /*{{{*/ // --------------------------------------------------------------------- /* This emulates dpkg-scanpackages's command line interface. 'mostly' */ -bool SimpleGenPackages(CommandLine &CmdL) +static bool SimpleGenPackages(CommandLine &CmdL) { if (CmdL.FileSize() < 2) return ShowHelp(CmdL); @@ -667,7 +667,7 @@ bool SimpleGenPackages(CommandLine &CmdL) // SimpleGenContents - Generate a Contents listing /*{{{*/ // --------------------------------------------------------------------- /* */ -bool SimpleGenContents(CommandLine &CmdL) +static bool SimpleGenContents(CommandLine &CmdL) { if (CmdL.FileSize() < 2) return ShowHelp(CmdL); @@ -689,7 +689,7 @@ bool SimpleGenContents(CommandLine &CmdL) // SimpleGenSources - Generate a Sources file for a directory tree /*{{{*/ // --------------------------------------------------------------------- /* This emulates dpkg-scanpackages's command line interface. 'mostly' */ -bool SimpleGenSources(CommandLine &CmdL) +static bool SimpleGenSources(CommandLine &CmdL) { if (CmdL.FileSize() < 2) return ShowHelp(CmdL); @@ -722,7 +722,7 @@ bool SimpleGenSources(CommandLine &CmdL) /*}}}*/ // SimpleGenRelease - Generate a Release file for a directory tree /*{{{*/ // --------------------------------------------------------------------- -bool SimpleGenRelease(CommandLine &CmdL) +static bool SimpleGenRelease(CommandLine &CmdL) { if (CmdL.FileSize() < 2) return ShowHelp(CmdL); @@ -747,7 +747,7 @@ bool SimpleGenRelease(CommandLine &CmdL) // Generate - Full generate, using a config file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool Generate(CommandLine &CmdL) +static bool Generate(CommandLine &CmdL) { struct CacheDB::Stats SrcStats; if (CmdL.FileSize() < 2) @@ -911,7 +911,7 @@ bool Generate(CommandLine &CmdL) // Clean - Clean out the databases /*{{{*/ // --------------------------------------------------------------------- /* */ -bool Clean(CommandLine &CmdL) +static bool Clean(CommandLine &CmdL) { if (CmdL.FileSize() != 2) return ShowHelp(CmdL); -- 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 --- ftparchive/apt-ftparchive.cc | 2 +- ftparchive/contents.cc | 2 +- ftparchive/override.cc | 2 +- ftparchive/writer.cc | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ftparchive') diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index c28ad5c5c..f13e4648a 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -586,7 +586,7 @@ static void LoadBinDir(vector &PkgList,Configuration &Setup) // ShowHelp - Show the help text /*{{{*/ // --------------------------------------------------------------------- /* */ -static bool ShowHelp(CommandLine &CmdL) +static bool ShowHelp(CommandLine &) { ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 80fe6e17e..be4d2a61e 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -316,7 +316,7 @@ bool ContentsExtract::Read(debDebFile &Deb) // ContentsExtract::DoItem - Extract an item /*{{{*/ // --------------------------------------------------------------------- /* This just tacks the name onto the end of our memory buffer */ -bool ContentsExtract::DoItem(Item &Itm,int &Fd) +bool ContentsExtract::DoItem(Item &Itm, int &/*Fd*/) { unsigned long Len = strlen(Itm.Name); diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 82cbc4c19..38d76a6a3 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -129,7 +129,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) // Override::ReadExtraOverride - Read the extra override file /*{{{*/ // --------------------------------------------------------------------- /* This parses the extra override file and reads it into the map */ -bool Override::ReadExtraOverride(string const &File,bool const &Source) +bool Override::ReadExtraOverride(string const &File,bool const &/*Source*/) { if (File.empty() == true) return true; diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 7ecfe78ed..edc0fddea 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -72,9 +72,9 @@ FTWScanner::FTWScanner(string const &Arch): Arch(Arch) /*}}}*/ // FTWScanner::Scanner - FTW Scanner /*{{{*/ // --------------------------------------------------------------------- -/* This is the FTW scanner, it processes each directory element in the +/* This is the FTW scanner, it processes each directory element in the directory tree. */ -int FTWScanner::ScannerFTW(const char *File,const struct stat *sb,int Flag) +int FTWScanner::ScannerFTW(const char *File,const struct stat * /*sb*/,int Flag) { if (Flag == FTW_DNR) { @@ -951,7 +951,7 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres // ReleaseWriter::ReleaseWriter - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -ReleaseWriter::ReleaseWriter(string const &DB) +ReleaseWriter::ReleaseWriter(string const &/*DB*/) { if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == 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) --- ftparchive/apt-ftparchive.cc | 17 +++++++++++++---- ftparchive/cachedb.cc | 4 ++++ ftparchive/cachedb.h | 8 +++++--- ftparchive/contents.cc | 3 +-- ftparchive/contents.h | 8 +++++--- ftparchive/multicompress.cc | 6 ++++-- ftparchive/multicompress.h | 3 ++- ftparchive/override.cc | 3 +++ ftparchive/writer.cc | 25 +++++++++++++++++-------- ftparchive/writer.h | 4 +++- 10 files changed, 57 insertions(+), 24 deletions(-) (limited to 'ftparchive') diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index f13e4648a..692f19e25 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -17,14 +17,23 @@ #include #include #include -#include +#include +#include #include #include -#include - +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cachedb.h" +#include "override.h" #include "apt-ftparchive.h" -#include "contents.h" #include "multicompress.h" #include "writer.h" diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index c2318bf53..523c6b5fa 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -19,8 +19,12 @@ #include #include #include +#include #include // htonl, etc +#include +#include +#include #include "cachedb.h" diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index b9ced9418..49b9a0ef5 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -12,17 +12,19 @@ #ifndef CACHEDB_H #define CACHEDB_H - #include #include -#include -#include #include #include +#include +#include +#include #include "contents.h" +class FileFd; + class CacheDB { protected: diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index be4d2a61e..7a1fb779e 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -36,13 +36,12 @@ #include #include -#include +#include #include #include #include #include -#include #include "contents.h" diff --git a/ftparchive/contents.h b/ftparchive/contents.h index 4af9db574..dbbb83350 100644 --- a/ftparchive/contents.h +++ b/ftparchive/contents.h @@ -9,11 +9,13 @@ /*}}}*/ #ifndef CONTENTS_H #define CONTENTS_H - -#include -#include + #include +#include +#include +#include + class debDebFile; class GenContents diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 1555d2f2d..f35d5304a 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -20,13 +20,15 @@ #include #include #include +#include +#include -#include +#include +#include #include #include #include #include -#include #include "multicompress.h" #include diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 388fad22e..ddd1815a3 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -22,7 +22,8 @@ #include #include #include - +#include + class MultiCompress { // An output file diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 38d76a6a3..b4cd49b6c 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -16,6 +16,9 @@ #include #include +#include +#include +#include #include "override.h" diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index edc0fddea..153c4fb42 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -13,28 +13,37 @@ // Include Files /*{{{*/ #include -#include -#include #include -#include -#include -#include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include #include #include #include +#include +#include "apt-ftparchive.h" #include "writer.h" #include "cachedb.h" -#include "apt-ftparchive.h" #include "multicompress.h" #include diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 4932b0cc8..86884dcfc 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -13,14 +13,16 @@ #ifndef WRITER_H #define WRITER_H - #include #include #include #include #include #include +#include +#include +#include "contents.h" #include "cachedb.h" #include "override.h" #include "apt-ftparchive.h" -- cgit v1.2.3 From 6c50447eb443768764f83b3ba86ef32780ba6dde Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Apr 2014 14:41:35 +0200 Subject: reduce delta from ubuntu --- ftparchive/override.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftparchive') diff --git a/ftparchive/override.cc b/ftparchive/override.cc index b4cd49b6c..8a0c5bab1 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -37,7 +37,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) if (F == 0) return _error->Errno("fopen",_("Unable to open %s"),File.c_str()); - char Line[500]; + char Line[1000]; unsigned long long Counter = 0; while (fgets(Line,sizeof(Line),F) != 0) { @@ -141,7 +141,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &/*Source*/) if (F == 0) return _error->Errno("fopen",_("Unable to open %s"),File.c_str()); - char Line[500]; + char Line[1000]; unsigned long long Counter = 0; while (fgets(Line,sizeof(Line),F) != 0) { -- cgit v1.2.3