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,
void* userp) -> std::size_t
{
auto& str = *static_cast<std::string*>(userp);
auto& userstr = *static_cast<std::string*>(userp);
auto realsize = size * nmemb;
str.append(contents, realsize);
userstr.append(contents, realsize);
return realsize;
};
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_cb);

14
tz.h
View File

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