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/deb/debsrcrecords.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/deb/debsrcrecords.cc')
-rw-r--r-- | apt-pkg/deb/debsrcrecords.cc | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 97f43aca2..d3c137bb9 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -170,16 +170,8 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List) // we have it already, store the new hash and be done if (file != List.end()) { -#if __GNUC__ >= 4 - // set for compatibility only, so warn users not us - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif if (checksumField == "Files") - file->MD5Hash = hash; -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif + APT_IGNORE_DEPRECATED(file->MD5Hash = hash;) // an error here indicates that we have two different hashes for the same file if (file->Hashes.push_back(hashString) == false) return _error->Error("Error parsing checksum in %s of source package %s", checksumField.c_str(), Package().c_str()); @@ -192,16 +184,8 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &List) F.Size = strtoull(size.c_str(), NULL, 10); F.Hashes.push_back(hashString); -#if __GNUC__ >= 4 - // set for compatibility only, so warn users not us - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif if (checksumField == "Files") - F.MD5Hash = hash; -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif + APT_IGNORE_DEPRECATED(F.MD5Hash = hash;) // Try to guess what sort of file it is we are getting. string::size_type Pos = F.Path.length()-1; |