From a78c65fdbbb048cfafa9c50beef67e5b5b27d99a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 7 Jan 2018 16:20:13 -0800 Subject: [PATCH] Fix MSVC C2220 --- src/position.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/position.cc b/src/position.cc index 861bc603..eb342a4b 100644 --- a/src/position.cc +++ b/src/position.cc @@ -78,17 +78,17 @@ Range::Range(Position start, Position end) : start(start), end(end) {} Range::Range(const char* encoded) { char* p = const_cast(encoded); - start.line = strtol(p, &p, 10); + start.line = int16_t(strtol(p, &p, 10)); assert(*p == ':'); p++; - start.column = strtol(p, &p, 10); + start.column = int16_t(strtol(p, &p, 10)); assert(*p == '-'); p++; - end.line = strtol(p, &p, 10); + end.line = int16_t(strtol(p, &p, 10)); assert(*p == ':'); p++; - end.column = strtol(p, nullptr, 10); + end.column = int16_t(strtol(p, nullptr, 10)); } bool Range::Contains(int line, int column) const {