nghttp: Fix compile error and warning with libc++

This commit is contained in:
Tatsuhiro Tsujikawa 2014-11-22 00:37:37 +09:00
parent 4ee89e62fc
commit fa4f03525e
2 changed files with 3 additions and 1 deletions

View File

@ -1057,6 +1057,7 @@ struct HttpClient {
auto& req_stat = req->stat;
auto request_time = (i == 0) ? stat.started_system_time :
stat.started_system_time +
std::chrono::duration_cast<std::chrono::system_clock::duration>
(req_stat.on_request_time - stat.on_started_time);
auto wait_delta = std::chrono::duration_cast

View File

@ -729,7 +729,8 @@ std::string format_iso8601(const std::chrono::system_clock::time_point& tp)
char buf[128];
auto nwrite = strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", &tms);
snprintf(&buf[nwrite], sizeof(buf) - nwrite, ".%03ldZ", t.count() % 1000);
snprintf(&buf[nwrite], sizeof(buf) - nwrite, ".%03dZ",
static_cast<int>(t.count() % 1000));
return buf;
}