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) --- apt-pkg/contrib/fileutl.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apt-pkg/contrib/fileutl.h') diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index e752e9621..6fdea1294 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -94,7 +95,7 @@ class FileFd And as the auto-conversation converts a 'unsigned long *' to a 'bool' instead of 'unsigned long long *' we need to provide this explicitely - otherwise applications magically start to fail… */ - __deprecated bool Read(void *To,unsigned long long Size,unsigned long *Actual) + bool Read(void *To,unsigned long long Size,unsigned long *Actual) APT_DEPRECATED { unsigned long long R; bool const T = Read(To, Size, &R); @@ -118,7 +119,7 @@ class FileFd // Simple manipulators inline int Fd() {return iFd;}; inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);}; - __deprecated gzFile gzFd(); + gzFile gzFd() APT_DEPRECATED; inline bool IsOpen() {return iFd >= 0;}; inline bool Failed() {return (Flags & Fail) == Fail;}; @@ -152,8 +153,8 @@ class FileFd bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor); // private helpers to set Fail flag and call _error->Error - bool FileFdErrno(const char* Function, const char* Description,...) __like_printf(3) __cold; - bool FileFdError(const char* Description,...) __like_printf(2) __cold; + bool FileFdErrno(const char* Function, const char* Description,...) APT_PRINTF(3) APT_COLD; + bool FileFdError(const char* Description,...) APT_PRINTF(2) APT_COLD; }; bool RunScripts(const char *Cnf); @@ -161,7 +162,7 @@ bool CopyFile(FileFd &From,FileFd &To); int GetLock(std::string File,bool Errors = true); bool FileExists(std::string File); bool RealFileExists(std::string File); -bool DirectoryExists(std::string const &Path) __attrib_const; +bool DirectoryExists(std::string const &Path) APT_CONST; bool CreateDirectory(std::string const &Parent, std::string const &Path); time_t GetModificationTime(std::string const &Path); -- cgit v1.2.3 From a02db58fd50ef7fc2f0284852c6b3f98e458a232 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 Mar 2014 00:33:10 +0100 Subject: follow method attribute suggestions by gcc Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn} --- apt-pkg/contrib/fileutl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/contrib/fileutl.h') diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 6fdea1294..35f3ab0f4 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -119,7 +119,7 @@ class FileFd // Simple manipulators inline int Fd() {return iFd;}; inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);}; - gzFile gzFd() APT_DEPRECATED; + gzFile gzFd() APT_DEPRECATED APT_PURE; inline bool IsOpen() {return iFd >= 0;}; inline bool Failed() {return (Flags & Fail) == Fail;}; -- cgit v1.2.3