diff --git a/include/fmt/core.h b/include/fmt/core.h index 34aac1c9..231c0e98 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -188,7 +188,7 @@ #endif #ifndef FMT_ASSERT -# define FMT_ASSERT(condition, message) assert((condition) && message) +# define FMT_ASSERT(condition, message) assert((condition) && (message)) #endif // libc++ supports string_view in pre-c++17. diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 44e070cb..0904fa40 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -280,9 +280,9 @@ template const char basic_data::hex_digits[] = "0123456789abcdef"; #define FMT_POWERS_OF_10(factor) \ - factor * 10, factor * 100, factor * 1000, factor * 10000, factor * 100000, \ - factor * 1000000, factor * 10000000, factor * 100000000, \ - factor * 1000000000 + factor * 10, (factor) * 100, (factor) * 1000, (factor) * 10000, (factor) * 100000, \ + (factor) * 1000000, (factor) * 10000000, (factor) * 100000000, \ + (factor) * 1000000000 template const uint64_t basic_data::powers_of_10_64[] = { diff --git a/include/fmt/posix.h b/include/fmt/posix.h index 2512b7d1..5c306d30 100644 --- a/include/fmt/posix.h +++ b/include/fmt/posix.h @@ -54,8 +54,8 @@ #ifndef _WIN32 # define FMT_RETRY_VAL(result, expression, error_result) \ do { \ - result = (expression); \ - } while (result == error_result && errno == EINTR) + (result) = (expression); \ + } while ((result) == (error_result) && errno == EINTR) #else # define FMT_RETRY_VAL(result, expression, error_result) result = (expression) #endif