diff options
author | Flo <Blacktempel@hotmail.de> | 2016-09-04 14:10:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-04 14:10:43 +0200 |
commit | 262d125fb2bb0718896dc792305dcee2424cd02a (patch) | |
tree | 0cd23f2d8bf08d5529308423e2df2da6acc17eb5 /seckey.h | |
parent | a11985e6e464043268427d34ada6b55aed76f688 (diff) | |
download | cryptopp-git-262d125fb2bb0718896dc792305dcee2424cd02a.tar.gz |
Update seckey.h
InvalidRounds expects a std::string, so it can be constructed in-place and the `__BORLANDC__` define can be removed.
Diffstat (limited to 'seckey.h')
-rw-r--r-- | seckey.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -80,16 +80,16 @@ protected: //! \throws InvalidRounds if the number of rounds are invalid
inline void ThrowIfInvalidRounds(int rounds, const Algorithm *alg)
{
-#if defined(__BORLANDC__)
- if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
- throw InvalidRounds(alg ? alg->AlgorithmName() : std::string("VariableRounds"), rounds);
-#elif (M==INT_MAX) // Coverity and result_independent_of_operands
- if (rounds < MIN_ROUNDS)
- throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
-#else
- if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
- throw InvalidRounds(alg ? alg->AlgorithmName() : "VariableRounds", rounds);
-#endif
+ if (M == INT_MAX) // Coverity and result_independent_of_operands
+ {
+ if (rounds < MIN_ROUNDS)
+ throw InvalidRounds(alg ? alg->AlgorithmName() : std::string("VariableRounds"), rounds);
+ }
+ else
+ {
+ if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
+ throw InvalidRounds(alg ? alg->AlgorithmName() : std::string("VariableRounds"), rounds);
+ }
}
//! \brief Validates the number of rounds for an algorithm
|