summaryrefslogtreecommitdiff
path: root/seckey.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-21 13:47:47 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-21 13:47:47 -0400
commit1de8ca5774c2688f51b2c6e636a6507016ea8be9 (patch)
tree49d9501e88baa52b42d7cd296748b16698e5ea8c /seckey.h
parent08a206f3eb2713a17eda636ebb96ed8142a4036d (diff)
downloadcryptopp-git-1de8ca5774c2688f51b2c6e636a6507016ea8be9.tar.gz
Revert "Rewrite 'keylength < MIN_KEYLENGTH' to avoid -Wtautological-compare"
This reverts commit 08a206f3eb2713a17eda636ebb96ed8142a4036d. This broke the self tests, and casting everything to 'signed int' to avoid unsigned promots did not resolve the issue.
Diffstat (limited to 'seckey.h')
-rw-r--r--seckey.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/seckey.h b/seckey.h
index e033c8df..bbf1ea7a 100644
--- a/seckey.h
+++ b/seckey.h
@@ -215,8 +215,7 @@ public:
// TODO: Figure out how to make this CRYPTOPP_CONSTEXPR
static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
{
- // Rewrite 'keylength < MIN_KEYLENGTH' to avoid -Wtautological-compare
- if ((int)keylength - MIN_KEYLENGTH < 0)
+ if (keylength < (size_t)MIN_KEYLENGTH)
return MIN_KEYLENGTH;
else if (keylength > (size_t)MAX_KEYLENGTH)
return (size_t)MAX_KEYLENGTH;