From fa4f03525e78a64308c3963586b6d3b56148ca2a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 22 Nov 2014 00:37:37 +0900 Subject: [PATCH] nghttp: Fix compile error and warning with libc++ --- src/nghttp.cc | 1 + src/util.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index b31d4429..ff7a781f 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -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 (req_stat.on_request_time - stat.on_started_time); auto wait_delta = std::chrono::duration_cast diff --git a/src/util.cc b/src/util.cc index 124c3102..f58c18ab 100644 --- a/src/util.cc +++ b/src/util.cc @@ -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(t.count() % 1000)); return buf; }