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/contrib/arfile.cc | 5 ++++- apt-inst/contrib/extracttar.cc | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 8018f4d30..533c563f9 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -14,13 +14,16 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include - /*}}}*/ + #include + /*}}}*/ struct ARArchive::MemberHeader { diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 01b6b3836..487027c3d 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -16,8 +16,9 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include +#include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include + #include /*}}}*/ -- cgit v1.2.3 From 650faab01603caac04494d54cf6b10a65c00ea13 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 17:46:48 +0200 Subject: Support large files in the complete toolset. Indexes of this size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895) --- apt-inst/contrib/arfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index 7f6c68302..e2063cd71 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -54,7 +54,7 @@ struct ARArchive::Member unsigned long UID; unsigned long GID; unsigned long Mode; - unsigned long Size; + unsigned long long Size; // Location of the data. unsigned long Start; -- 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/contrib/arfile.cc | 2 +- apt-inst/contrib/arfile.h | 2 +- apt-inst/contrib/extracttar.h | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 533c563f9..4e078349e 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -115,7 +115,7 @@ bool ARArchive::LoadHeaders() { unsigned int I = sizeof(Head.Name) - 1; for (; Head.Name[I] == ' ' || Head.Name[I] == '/'; I--); - Memb->Name = string(Head.Name,I+1); + Memb->Name = std::string(Head.Name,I+1); } // Account for the AR header alignment diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index e2063cd71..bfc128ace 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -49,7 +49,7 @@ class ARArchive struct ARArchive::Member { // Fields from the header - string Name; + std::string Name; unsigned long MTime; unsigned long UID; unsigned long GID; diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 42f8ef534..27c453d0d 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -19,8 +19,6 @@ #include -using std::min; - class ExtractTar { protected: @@ -38,7 +36,7 @@ class ExtractTar int GZPid; FileFd InFd; bool Eof; - string DecompressProg; + std::string DecompressProg; // Fork and reap gzip bool StartGzip(); @@ -48,7 +46,7 @@ class ExtractTar bool Go(pkgDirStream &Stream); - ExtractTar(FileFd &Fd,unsigned long Max,string DecompressionProgram); + ExtractTar(FileFd &Fd,unsigned long Max,std::string DecompressionProgram); virtual ~ExtractTar(); }; -- 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/contrib/arfile.cc | 1 + apt-inst/contrib/arfile.h | 3 ++- apt-inst/contrib/extracttar.cc | 1 + apt-inst/contrib/extracttar.h | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'apt-inst/contrib') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 4e078349e..2dee1a40d 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index bfc128ace..2be1323d1 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -17,7 +17,8 @@ #include -#include + +class FileFd; class ARArchive { diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 487027c3d..12919a7cd 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 27c453d0d..8754e8dcc 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -15,9 +15,10 @@ #define PKGLIB_EXTRACTTAR_H #include -#include -#include +#include + +class pkgDirStream; class ExtractTar { -- cgit v1.2.3