summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/hashes.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-12-13 13:26:38 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:53:34 +0100
commit957381a0d26ec11a172ebfc64f892d1b31f0c193 (patch)
tree503ae7e87a16a01a4d642f668ec284a258369de0 /apt-pkg/contrib/hashes.h
parent5d5ca1aac76448cdfd16972090d246c44671dce6 (diff)
convert various c-style casts to C++-style
gcc was warning about ignored type qualifiers for all of them due to the last 'const', so dropping that and converting to static_cast in the process removes the here harmless warning to avoid hidden real issues in them later on. Reported-By: gcc Gbp-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib/hashes.h')
-rw-r--r--apt-pkg/contrib/hashes.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h
index 11521008a..dc91c1dd3 100644
--- a/apt-pkg/contrib/hashes.h
+++ b/apt-pkg/contrib/hashes.h
@@ -197,7 +197,7 @@ class Hashes
bool Add(const unsigned char * const Data, unsigned long long const Size) APT_NONNULL(2);
APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes) APT_NONNULL(2);
inline bool Add(const char * const Data) APT_NONNULL(2)
- {return Add((unsigned char const * const)Data,strlen(Data));};
+ {return Add(reinterpret_cast<unsigned char const *>(Data),strlen(Data));};
inline bool Add(const unsigned char * const Beg,const unsigned char * const End) APT_NONNULL(2,3)
{return Add(Beg,End-Beg);};
@@ -227,12 +227,12 @@ APT_IGNORE_DEPRECATED_POP
private:
APT_HIDDEN APT_PURE inline unsigned int boolsToFlag(bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512)
{
- unsigned int Hashes = ~0;
- if (addMD5 == false) Hashes &= ~MD5SUM;
- if (addSHA1 == false) Hashes &= ~SHA1SUM;
- if (addSHA256 == false) Hashes &= ~SHA256SUM;
- if (addSHA512 == false) Hashes &= ~SHA512SUM;
- return Hashes;
+ unsigned int hashes = ~0;
+ if (addMD5 == false) hashes &= ~MD5SUM;
+ if (addSHA1 == false) hashes &= ~SHA1SUM;
+ if (addSHA256 == false) hashes &= ~SHA256SUM;
+ if (addSHA512 == false) hashes &= ~SHA512SUM;
+ return hashes;
}
public: