diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-10-26 23:17:03 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-11-08 14:26:00 +0100 |
commit | 586d8704716a10e0f8b9c400cab500f5353eebe6 (patch) | |
tree | 9318582dc8c53a88084ad00c4dfa6d02c83b3ca6 /apt-pkg/contrib/hashes.cc | |
parent | 23fb7b2cbbda62c99a199d29ad62205b23d35af4 (diff) |
replace ignore-deprecated #pragma dance with _Pragma
For compatibility we use/provide and fill quiet some deprecated methods
and fields, which subsequently earns us a warning for using them. These
warnings therefore have to be disabled for these codeparts and that is
what this change does now in a slightly more elegant way.
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib/hashes.cc')
-rw-r--r-- | apt-pkg/contrib/hashes.cc | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 55180c642..6e7080bc9 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -258,10 +258,7 @@ public: bool Hashes::Add(const unsigned char * const Data,unsigned long long const Size, unsigned int const Hashes) { bool Res = true; -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif +APT_IGNORE_DEPRECATED_PUSH if ((Hashes & MD5SUM) == MD5SUM) Res &= MD5.Add(Data, Size); if ((Hashes & SHA1SUM) == SHA1SUM) @@ -270,9 +267,7 @@ bool Hashes::Add(const unsigned char * const Data,unsigned long long const Size, Res &= SHA256.Add(Data, Size); if ((Hashes & SHA512SUM) == SHA512SUM) Res &= SHA512.Add(Data, Size); -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif +APT_IGNORE_DEPRECATED_POP d->FileSize += Size; return Res; } @@ -323,28 +318,18 @@ bool Hashes::AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes HashStringList Hashes::GetHashStringList() { HashStringList hashes; -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif +APT_IGNORE_DEPRECATED_PUSH hashes.push_back(HashString("MD5Sum", MD5.Result().Value())); hashes.push_back(HashString("SHA1", SHA1.Result().Value())); hashes.push_back(HashString("SHA256", SHA256.Result().Value())); hashes.push_back(HashString("SHA512", SHA512.Result().Value())); -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif +APT_IGNORE_DEPRECATED_POP std::string SizeStr; strprintf(SizeStr, "%llu", d->FileSize); hashes.push_back(HashString("Checksum-FileSize", SizeStr)); return hashes; } -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif +APT_IGNORE_DEPRECATED_PUSH Hashes::Hashes() { d = new PrivateHashes(); } Hashes::~Hashes() { delete d; } -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif +APT_IGNORE_DEPRECATED_POP |