summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/hashes.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:54:38 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:54:38 +0100
commit99813a2eaa7c0cce1d7d8c811827733ed66458de (patch)
tree61fe422eeca8c5bd5cb2de6060f11e71343d4602 /apt-pkg/contrib/hashes.h
parentd30b30ad1e1ce434df84e15e2573c43ac152f9e3 (diff)
parent0b5e329a8ba2461ccb7017d3adfc972f9dccd830 (diff)
Merge branch 'feature/happy-gcc'
Fixing various real and imagined bugs reported by gcc warnings
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: