mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-14 09:47:57 +08:00
Fix -Wshadow for gcc and clang.
This commit is contained in:
parent
3daf8c1ffe
commit
1fd0806757
4
tz.cpp
4
tz.cpp
@ -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
14
tz.h
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user