diff --git a/examples/example008_bernoulli_tgamma.cpp b/examples/example008_bernoulli_tgamma.cpp index f24a679..4e48611 100644 --- a/examples/example008_bernoulli_tgamma.cpp +++ b/examples/example008_bernoulli_tgamma.cpp @@ -382,43 +382,40 @@ auto ::math::wide_decimal::example008_bernoulli_tgamma() -> bool // Enable this if you would like to activate this main() as a standalone example. #if defined(WIDE_DECIMAL_STANDALONE_EXAMPLE008_BERNOULLI_TGAMMA) -constexpr auto app_benchmark_standalone_foodcafe = static_cast(UINT32_C(0xF00DCAFE)); +constexpr auto example_standalone_foodcafe = static_cast(UINT32_C(0xF00DCAFE)); extern "C" { - extern volatile std::uint32_t app_benchmark_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) + extern volatile std::uint32_t example_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) - auto app_benchmark_run_standalone (void) -> bool; - auto app_benchmark_get_standalone_result(void) -> bool; + auto example_run_standalone() -> bool; + auto example_get_standalone_result() noexcept -> bool; - auto app_benchmark_run_standalone(void) -> bool + auto example_run_standalone() -> bool { const auto result_is_ok = ::math::wide_decimal::example008_bernoulli_tgamma(); - app_benchmark_standalone_result = + example_standalone_result = static_cast ( - result_is_ok ? app_benchmark_standalone_foodcafe : static_cast(UINT32_C(0xFFFFFFFF)) + result_is_ok ? example_standalone_foodcafe : static_cast(UINT32_C(0xFFFFFFFF)) ); return result_is_ok; } - auto app_benchmark_get_standalone_result(void) -> bool + auto example_get_standalone_result() noexcept -> bool { - volatile auto result_is_ok = - (app_benchmark_standalone_result == static_cast(UINT32_C(0xF00DCAFE))); - - return result_is_ok; + return { example_standalone_result == static_cast(UINT32_C(0xF00DCAFE)) }; } } auto main() -> int { - auto result_is_ok = true; + bool result_is_ok { true }; - result_is_ok = (::app_benchmark_run_standalone () && result_is_ok); - result_is_ok = (::app_benchmark_get_standalone_result() && result_is_ok); + result_is_ok = (::example_run_standalone () && result_is_ok); + result_is_ok = (::example_get_standalone_result() && result_is_ok); #if !defined(WIDE_DECIMAL_DISABLE_IOSTREAM) std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl; @@ -429,7 +426,7 @@ auto main() -> int extern "C" { - volatile std::uint32_t app_benchmark_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) + volatile std::uint32_t example_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) } #endif