From 2e6227b4251fe7b8c01b0512fc71ba1fe5f0fda7 Mon Sep 17 00:00:00 2001 From: Jano Svitok Date: Fri, 10 Nov 2017 07:53:19 +0100 Subject: [PATCH] Fix 64-bit compilation (at least on MSVC 2017, 15.3) Otherwise warning is issued (assignment loses precision) --- src/base/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/util.h b/src/base/util.h index 2d9f1db..f9f1a69 100644 --- a/src/base/util.h +++ b/src/base/util.h @@ -181,10 +181,10 @@ inline int atoi32(const char* s) { } inline void StripWhiteSpace(std::string* str) { - int str_length = str->length(); + size_t str_length = str->length(); // Strip off leading whitespace. - int first = 0; + size_t first = 0; while (first < str_length && isspace(str->at(first))) { ++first; } @@ -199,7 +199,7 @@ inline void StripWhiteSpace(std::string* str) { } // Strip off trailing whitespace. - int last = str_length - 1; + size_t last = str_length - 1; while (last >= 0 && isspace(str->at(last))) { --last; }