From ea54214002c09eeb4dd498d97a564471ec9993c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 10:09:00 +0200 Subject: reorder includes: add if needed and include it at first --- apt-inst/deb/debfile.cc | 2 ++ apt-inst/deb/dpkgdb.cc | 2 ++ 2 files changed, 4 insertions(+) (limited to 'apt-inst/deb') diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index a40cd1ae8..e80d8c735 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -16,6 +16,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index a75cf59ca..3112acdbd 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include -- cgit v1.2.3 From 8f3ba4e8708cb72be19dacc2af4f601ee5fea292 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 13:31:29 +0200 Subject: do not pollute namespace in the headers with using (Closes: #500198) --- apt-inst/deb/debfile.cc | 6 +++--- apt-inst/deb/debfile.h | 4 ++-- apt-inst/deb/dpkgdb.h | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'apt-inst/deb') diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index e80d8c735..8ade547f5 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -107,8 +107,8 @@ bool debDebFile::ExtractControl(pkgDataBase &DB) return false; // Get into the temporary directory - string Cwd = SafeGetCWD(); - string Tmp; + std::string Cwd = SafeGetCWD(); + std::string Tmp; if (DB.GetMetaTmp(Tmp) == false) return false; if (chdir(Tmp.c_str()) != 0) @@ -174,7 +174,7 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) pkgCache::VerIterator debDebFile::MergeControl(pkgDataBase &DB) { // Open the control file - string Tmp; + std::string Tmp; if (DB.GetMetaTmp(Tmp) == false) return pkgCache::VerIterator(DB.GetCache()); FileFd Fd(Tmp + "control",FileFd::ReadOnly); diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index 6b9f8ffc8..e404d81db 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -68,7 +68,7 @@ class debDebFile::MemControlExtract : public pkgDirStream char *Control; pkgTagSection Section; unsigned long Length; - string Member; + std::string Member; // Members from DirStream virtual bool DoItem(Item &Itm,int &Fd); @@ -81,7 +81,7 @@ class debDebFile::MemControlExtract : public pkgDirStream bool TakeControl(const void *Data,unsigned long Size); MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {}; - MemControlExtract(string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; + MemControlExtract(std::string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; ~MemControlExtract() {delete [] Control;}; }; /*}}}*/ diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h index 125845f96..3656929aa 100644 --- a/apt-inst/deb/dpkgdb.h +++ b/apt-inst/deb/dpkgdb.h @@ -25,14 +25,14 @@ class debDpkgDB : public pkgDataBase { protected: - - string AdminDir; + + std::string AdminDir; DynamicMMap *CacheMap; DynamicMMap *FileMap; unsigned long DiverInode; signed long DiverTime; - - virtual bool InitMetaTmp(string &Dir); + + virtual bool InitMetaTmp(std::string &Dir); bool ReadFList(OpProgress &Progress); bool ReadDiversions(); bool ReadConfFiles(); -- cgit v1.2.3 From 472ff00ef2e48383805d281c6364ec27839e3f4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 19:14:19 +0200 Subject: use forward declaration in headers if possible instead of includes --- apt-inst/deb/debfile.cc | 1 + apt-inst/deb/debfile.h | 5 ++++- apt-inst/deb/dpkgdb.cc | 2 ++ apt-inst/deb/dpkgdb.h | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) (limited to 'apt-inst/deb') diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index 8ade547f5..4bd065cf8 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index e404d81db..2c4734f9e 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -25,9 +25,12 @@ #include -#include #include #include +#include + +class FileFd; +class pkgDataBase; class debDebFile { diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index 3112acdbd..819c123f6 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h index 3656929aa..f28563a93 100644 --- a/apt-inst/deb/dpkgdb.h +++ b/apt-inst/deb/dpkgdb.h @@ -22,6 +22,11 @@ #include +#include + +class DynamicMMap; +class OpProgress; + class debDpkgDB : public pkgDataBase { protected: -- cgit v1.2.3