From 911a75114be6023538991f7f73bae1cdc9879ada Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 4 Jun 2018 21:00:28 +0200 Subject: [PATCH] Fix nvcc warnings (#752) --- include/fmt/core.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 96bbf27c..094d1b6f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -787,8 +787,9 @@ class arg_map { ~arg_map() { delete [] map_; } basic_format_arg find(basic_string_view name) const { + auto end = map_ + size_; // Define end outside of loop to make nvcc happy. // The list is unsorted, so just return the first matching name. - for (auto it = map_, end = map_ + size_; it != end; ++it) { + for (auto it = map_; it != end; ++it) { if (it->name == name) return it->arg; } @@ -973,16 +974,17 @@ class format_arg_store { friend class basic_format_args; - static FMT_CONSTEXPR uint64_t get_types() { - return IS_PACKED ? internal::get_types() - : -static_cast(NUM_ARGS); + static FMT_CONSTEXPR int64_t get_types() { + return IS_PACKED ? + static_cast(internal::get_types()) : + -static_cast(NUM_ARGS); } public: #if FMT_USE_CONSTEXPR - static constexpr uint64_t TYPES = get_types(); + static constexpr int64_t TYPES = get_types(); #else - static const uint64_t TYPES; + static const int64_t TYPES; #endif #if FMT_GCC_VERSION && FMT_GCC_VERSION <= 405 @@ -998,7 +1000,7 @@ class format_arg_store { #if !FMT_USE_CONSTEXPR template -const uint64_t format_arg_store::TYPES = get_types(); +const int64_t format_arg_store::TYPES = get_types(); #endif /**