reinterpret_cast for parseCacheControl to avoid -Wformat warning on all platforms

This commit is contained in:
Dane Springmeyer
2014-11-02 19:37:48 -05:00
parent 80b13ff361
commit 7ea305d021

View File

@@ -9,7 +9,7 @@ int64_t Response::parseCacheControl(const char *value) {
uint64_t seconds = 0;
// TODO: cache-control may contain other information as well:
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
if (std::sscanf(value, "max-age=%llu", static_cast<unsigned long long *>(&seconds)) == 1) {
if (std::sscanf(value, "max-age=%llu", reinterpret_cast<unsigned long long *>(&seconds)) == 1) {
return std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch()).count() +
seconds;