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 --- methods/file.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'methods/file.cc') diff --git a/methods/file.cc b/methods/file.cc index 9cdd5bc2d..9fc4cd76c 100644 --- a/methods/file.cc +++ b/methods/file.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) --- methods/file.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'methods/file.cc') diff --git a/methods/file.cc b/methods/file.cc index 9fc4cd76c..d58652e6e 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -40,7 +40,7 @@ class FileMethod : public pkgAcqMethod bool FileMethod::Fetch(FetchItem *Itm) { URI Get = Itm->Uri; - string File = Get.Path; + std::string File = Get.Path; FetchResult Res; if (Get.Host.empty() == false) return _error->Error(_("Invalid URI, local URIS must not start with //")); @@ -58,10 +58,10 @@ bool FileMethod::Fetch(FetchItem *Itm) } // See if we can compute a file without a .gz exentsion - string::size_type Pos = File.rfind(".gz"); + std::string::size_type Pos = File.rfind(".gz"); if (Pos + 3 == File.length()) { - File = string(File,0,Pos); + File = std::string(File,0,Pos); if (stat(File.c_str(),&Buf) == 0) { FetchResult AltRes; -- 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 --- methods/file.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'methods/file.cc') diff --git a/methods/file.cc b/methods/file.cc index d58652e6e..5025c996d 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 109eb1511d0cdfa4af3196105cada30bcbb77bc8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 17 Dec 2011 23:53:31 +0100 Subject: try to avoid direct usage of .Fd() if possible and do read()s and co on the FileFd instead --- methods/file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods/file.cc') diff --git a/methods/file.cc b/methods/file.cc index 5025c996d..7ed4e6f60 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -83,7 +83,7 @@ bool FileMethod::Fetch(FetchItem *Itm) Hashes Hash; FileFd Fd(Res.Filename, FileFd::ReadOnly); - Hash.AddFD(Fd.Fd(), Fd.Size()); + Hash.AddFD(Fd); Res.TakeHashes(Hash); URIDone(Res); return true; -- cgit v1.2.3