core: use maybe_unused instead of `(void)' cast

This commit is contained in:
Peter D. Barnes, Jr
2022-11-17 13:44:28 -08:00
committed by Tommaso Pecorella
parent 4e3a97e1fa
commit fec6a2c1d7
3 changed files with 5 additions and 7 deletions

View File

@@ -1183,9 +1183,8 @@ macro(process_options)
if(${NS3_INT64X64} MATCHES "INT128")
check_cxx_source_compiles(
"#include <stdint.h>
int main(int argc, char **argv)
int main()
{
(void)argc; (void)argv;
if ((uint128_t *) 0) return 0;
if (sizeof (uint128_t)) return 0;
return 1;
@@ -1194,9 +1193,8 @@ macro(process_options)
)
check_cxx_source_compiles(
"#include <stdint.h>
int main(int argc, char **argv)
int main()
{
(void)argc; (void)argv;
if ((__uint128_t *) 0) return 0;
if (sizeof (__uint128_t)) return 0;
return 1;

View File

@@ -98,13 +98,13 @@
#define NS_ASSERT(condition) \
do \
{ \
(void)sizeof(condition); \
sizeof(condition); \
} while (false)
#define NS_ASSERT_MSG(condition, message) \
do \
{ \
(void)sizeof(condition); \
sizeof(condition); \
} while (false)
#endif /* NS3_ASSERT_ENABLE */

View File

@@ -54,7 +54,7 @@ TestDoubleIsEqual(const double x1, const double x2, const double epsilon)
//
{
double max = (std::fabs(x1) > std::fabs(x2)) ? x1 : x2;
(void)std::frexp(max, &exponent);
std::frexp(max, &exponent);
}
//