From 399929d381345aaa1887925d072ebe85d83484e7 Mon Sep 17 00:00:00 2001 From: Jonathan DeCarlo Date: Mon, 20 Nov 2017 22:39:57 -0500 Subject: [PATCH] Fix for two compiler warnings: (1) implicit assignment of signed to unsigned with possible loss of data (explicit cast to 'US' type fixes that warning by showing intent), and (2) implicit conversion from 'size_t' to 'int' with possible loss of data (again, explicit cast to 'int' fixes that warning by showing intent). --- include/cxxopts.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 3117e9d..bc764a0 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -566,7 +566,7 @@ namespace cxxopts throw argument_incorrect_type(text); } - result = result * base + digit; + result = static_cast(result * base + digit); } detail::check_signed_range(negative, result, text); @@ -1091,7 +1091,7 @@ namespace cxxopts auto riter = m_results.find(iter->second); - return riter->second.count(); + return static_cast(riter->second.count()); } const OptionValue&