From 7ef1a551439e414d8b2eff826f570447dfcc4572 Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Thu, 2 May 2019 16:37:34 -0700 Subject: [PATCH] tz.cpp: Cast conversions to/from size_t These cause warnings with -Wsign-conversion. --- src/tz.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tz.cpp b/src/tz.cpp index 4528e7d..e451e6b 100644 --- a/src/tz.cpp +++ b/src/tz.cpp @@ -1930,7 +1930,7 @@ load_leaps(std::istream& inf, std::int32_t tzh_leapcnt) // Read tzh_leapcnt pairs using namespace std::chrono; std::vector leap_seconds; - leap_seconds.reserve(tzh_leapcnt); + leap_seconds.reserve(static_cast(tzh_leapcnt)); for (std::int32_t i = 0; i < tzh_leapcnt; ++i) { TimeType t0; @@ -1952,7 +1952,8 @@ load_leap_data(std::istream& inf, std::int32_t tzh_leapcnt, std::int32_t tzh_timecnt, std::int32_t tzh_typecnt, std::int32_t tzh_charcnt) { - inf.ignore(tzh_timecnt*sizeof(TimeType) + tzh_timecnt + tzh_typecnt*6 + tzh_charcnt); + inf.ignore(tzh_timecnt*static_cast(sizeof(TimeType)) + tzh_timecnt + + tzh_typecnt*6 + tzh_charcnt); return load_leaps(inf, tzh_leapcnt); }