Put arguments in parantheses in assert macro definitions

This commit is contained in:
Kamil Śliwak
2022-04-06 22:26:21 +02:00
parent 0bb885dab2
commit 3c5930dd8e
5 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ inline std::string stringOrDefault(std::string _string, std::string _defaultStri
if (!(_condition)) \
solThrow( \
_exceptionType, \
::solidity::util::assertions::stringOrDefault(_description, _defaultDescription) \
::solidity::util::assertions::stringOrDefault((_description), (_defaultDescription)) \
); \
} \
while (false)
@@ -72,6 +72,6 @@ inline std::string stringOrDefault(std::string _string, std::string _defaultStri
/// Use it as assertThrow(1 == 1, ExceptionType, "Mathematics is wrong.");
/// The second parameter must be an exception class (rather than an instance).
#define assertThrow(_condition, _exceptionType, _description) \
assertThrowWithDefaultDescription(_condition, _exceptionType, _description, "Assertion failed")
assertThrowWithDefaultDescription((_condition), _exceptionType, (_description), "Assertion failed")
}
+1 -1
View File
@@ -48,7 +48,7 @@ struct Exception: virtual std::exception, virtual boost::exception
#define solThrow(_exceptionType, _description) \
::boost::throw_exception( \
_exceptionType() << \
::solidity::util::errinfo_comment(_description) << \
::solidity::util::errinfo_comment((_description)) << \
::boost::throw_function(ETH_FUNC) << \
::boost::throw_file(__FILE__) << \
::boost::throw_line(__LINE__) \