/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
auto readInt = [&] {
- auto const b = p;
+ auto const c = p;
do {
++p;
} while (p != end && *p >= '0' && *p <= '9');
- return to<int>(StringPiece(b, p));
+ return to<int>(StringPiece(c, p));
};
if (*p == '*') {
}
if (*p == '.') {
- auto b = ++p;
+ auto d = ++p;
while (p != end && *p >= '0' && *p <= '9') {
++p;
}
- if (p != b) {
- precision = to<int>(StringPiece(b, p));
+ if (p != d) {
+ precision = to<int>(StringPiece(d, p));
if (p != end && *p == '.') {
trailingDot = true;
++p;
namespace detail {
void insertThousandsGroupingUnsafe(char* start_buffer, char** end_buffer) {
- uint32_t remaining_digits = *end_buffer - start_buffer;
+ uint32_t remaining_digits = uint32_t(*end_buffer - start_buffer);
uint32_t separator_size = (remaining_digits - 1) / 3;
uint32_t result_size = remaining_digits + separator_size;
*end_buffer = *end_buffer + separator_size;