Fix -Wshadow for gcc and clang.

This commit is contained in:
Jan Kratochvil
2017-04-02 22:19:00 +02:00
committed by Howard Hinnant
parent 3daf8c1ffe
commit 1fd0806757
2 changed files with 9 additions and 9 deletions

4
tz.cpp
View File

@@ -2280,9 +2280,9 @@ download_to_string(const std::string& url, std::string& str)
curl_write_callback write_cb = [](char* contents, std::size_t size, std::size_t nmemb, curl_write_callback write_cb = [](char* contents, std::size_t size, std::size_t nmemb,
void* userp) -> std::size_t void* userp) -> std::size_t
{ {
auto& str = *static_cast<std::string*>(userp); auto& userstr = *static_cast<std::string*>(userp);
auto realsize = size * nmemb; auto realsize = size * nmemb;
str.append(contents, realsize); userstr.append(contents, realsize);
return realsize; return realsize;
}; };
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_cb);

14
tz.h
View File

@@ -141,25 +141,25 @@ private:
template <class Duration> template <class Duration>
inline inline
nonexistent_local_time::nonexistent_local_time(local_time<Duration> tp, nonexistent_local_time::nonexistent_local_time(local_time<Duration> tp,
local_seconds first, local_seconds begin,
const std::string& first_abbrev, const std::string& first_abbrev,
local_seconds last, local_seconds end,
const std::string& last_abbrev, const std::string& last_abbrev,
sys_seconds time_sys) sys_seconds time_sys)
: std::runtime_error(make_msg(tp, first, first_abbrev, last, last_abbrev, time_sys)) : std::runtime_error(make_msg(tp, begin, first_abbrev, end, last_abbrev, time_sys))
{} {}
template <class Duration> template <class Duration>
std::string std::string
nonexistent_local_time::make_msg(local_time<Duration> tp, local_seconds first, nonexistent_local_time::make_msg(local_time<Duration> tp, local_seconds begin,
const std::string& first_abbrev, local_seconds last, const std::string& first_abbrev, local_seconds end,
const std::string& last_abbrev, sys_seconds time_sys) const std::string& last_abbrev, sys_seconds time_sys)
{ {
using namespace date; using namespace date;
std::ostringstream os; std::ostringstream os;
os << tp << " is in a gap between\n" os << tp << " is in a gap between\n"
<< first << ' ' << first_abbrev << " and\n" << begin << ' ' << first_abbrev << " and\n"
<< last << ' ' << last_abbrev << end << ' ' << last_abbrev
<< " which are both equivalent to\n" << " which are both equivalent to\n"
<< time_sys << " UTC"; << time_sys << " UTC";
return os.str(); return os.str();