Browse Source

fix -Wmissing-field-initializers warnings

Reported-By: gcc
Git-Dch: Ignore
debian/1.8.y
David Kalnischkies 10 years ago
parent
commit
67c3067f1a
  1. 8
      apt-pkg/deb/deblistparser.cc
  2. 8
      apt-pkg/indexcopy.cc
  3. 26
      apt-private/private-show.cc
  4. 2
      cmdline/apt-cache.cc
  5. 2
      ftparchive/apt-ftparchive.cc
  6. 4
      methods/ftp.cc

8
apt-pkg/deb/deblistparser.cc

@ -34,7 +34,7 @@ static debListParser::WordList PrioList[] = {
{"standard",pkgCache::State::Standard},
{"optional",pkgCache::State::Optional},
{"extra",pkgCache::State::Extra},
{}};
{NULL, 0}};
// ListParser::debListParser - Constructor /*{{{*/
// ---------------------------------------------------------------------
@ -354,7 +354,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"hold",pkgCache::State::Hold},
{"deinstall",pkgCache::State::DeInstall},
{"purge",pkgCache::State::Purge},
{}};
{NULL, 0}};
if (GrabWord(string(Start,I-Start),WantList,Pkg->SelectedState) == false)
return _error->Error("Malformed 1st word in the Status line");
@ -370,7 +370,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"reinstreq",pkgCache::State::ReInstReq},
{"hold",pkgCache::State::HoldInst},
{"hold-reinstreq",pkgCache::State::HoldReInstReq},
{}};
{NULL, 0}};
if (GrabWord(string(Start,I-Start),FlagList,Pkg->InstState) == false)
return _error->Error("Malformed 2nd word in the Status line");
@ -392,7 +392,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
{"triggers-pending",pkgCache::State::TriggersPending},
{"post-inst-failed",pkgCache::State::HalfConfigured},
{"removal-failed",pkgCache::State::HalfInstalled},
{}};
{NULL, 0}};
if (GrabWord(string(Start,I-Start),StatusList,Pkg->CurrentState) == false)
return _error->Error("Malformed 3rd word in the Status line");

8
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;

26
apt-private/private-show.cc

@ -96,23 +96,23 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
// FIXME: add verbose that does not do the removal of the tags?
TFRewriteData RW[] = {
// delete, apt-cache show has this info and most users do not care
{"MD5sum", 0},
{"SHA1", 0},
{"SHA256", 0},
{"Filename", 0},
{"Multi-Arch", 0},
{"Architecture", 0},
{"Conffiles",0},
{"MD5sum", NULL, NULL},
{"SHA1", NULL, NULL},
{"SHA256", NULL, NULL},
{"Filename", NULL, NULL},
{"Multi-Arch", NULL, NULL},
{"Architecture", NULL, NULL},
{"Conffiles", NULL, NULL},
// we use the translated description
{"Description",0},
{"Description-md5",0},
{"Description", NULL, NULL},
{"Description-md5", NULL, NULL},
// improve
{"Installed-Size", installed_size.c_str(), 0},
{"Installed-Size", installed_size.c_str(), NULL},
{"Size", package_size.c_str(), "Download-Size"},
// add
{"APT-Manual-Installed", manual_installed, 0},
{"APT-Sources", source_index_file.c_str(), 0},
{}
{"APT-Manual-Installed", manual_installed, NULL},
{"APT-Sources", source_index_file.c_str(), NULL},
{NULL, NULL, NULL}
};
if(TFRewrite(stdout, Tags, NULL, RW) == false)

2
cmdline/apt-cache.cc

@ -532,7 +532,7 @@ bool DumpAvail(CommandLine &Cmd)
if ((File->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
{
pkgTagSection Tags;
TFRewriteData RW[] = {{"Status",0},{"Config-Version",0},{}};
TFRewriteData RW[] = {{"Status", NULL, NULL},{"Config-Version", NULL, NULL},{NULL, NULL, NULL}};
const char *Zero = 0;
if (Tags.Scan(Buffer+Jitter,VF.Size+1) == false ||
TFRewrite(stdout,Tags,&Zero,RW) == false)

2
ftparchive/apt-ftparchive.cc

@ -484,7 +484,7 @@ void LoadTree(vector<PackageMap> &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;

4
methods/ftp.cc

@ -56,9 +56,9 @@ struct AFMap
};
#ifndef AF_INET6
struct AFMap AFMap[] = {{AF_INET,1},{}};
struct AFMap AFMap[] = {{AF_INET,1},{0, 0}};
#else
struct AFMap AFMap[] = {{AF_INET,1},{AF_INET6,2},{}};
struct AFMap AFMap[] = {{AF_INET,1},{AF_INET6,2},{0, 0}};
#endif
unsigned long TimeOut = 120;

Loading…
Cancel
Save