1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-09-28 19:05:49 +08:00

Fix 64-bit compilation (at least on MSVC 2017, 15.3)

Otherwise warning is issued (assignment loses precision)
This commit is contained in:
Jano Svitok 2017-11-10 07:53:19 +01:00
parent 4b7e6c52dc
commit 2e6227b425

View File

@ -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;
}