Apply the formatting specified in .clang-format file.

$ clang-format --version
  clang-format version 7.0.0 (tags/google/stable/2018-01-11)
  $ clang-format -i --style=file $(find . -name '*.cpp' -o -name '*.h')
This commit is contained in:
Billy Donahue
2018-05-20 16:55:27 -04:00
parent abd39e791b
commit b5e1fe89aa
16 changed files with 1176 additions and 1285 deletions

View File

@@ -89,8 +89,7 @@ static inline void uintToString(LargestUInt value, char*& current) {
* We had a sophisticated way, but it did not work in WinCE.
* @see https://github.com/open-source-parsers/jsoncpp/pull/9
*/
template <typename Iter>
Iter fixNumericLocale(Iter begin, Iter end) {
template <typename Iter> Iter fixNumericLocale(Iter begin, Iter end) {
for (; begin != end; ++begin) {
if (*begin == ',') {
*begin = '.';
@@ -99,8 +98,7 @@ Iter fixNumericLocale(Iter begin, Iter end) {
return begin;
}
template <typename Iter>
void fixNumericLocaleInput(Iter begin, Iter end) {
template <typename Iter> void fixNumericLocaleInput(Iter begin, Iter end) {
char decimalPoint = getDecimalPoint();
if (decimalPoint == '\0' || decimalPoint == '.') {
return;
@@ -116,14 +114,13 @@ void fixNumericLocaleInput(Iter begin, Iter end) {
* Return iterator that would be the new end of the range [begin,end), if we
* were to delete zeros in the end of string, but not the last zero before '.'.
*/
template <typename Iter>
Iter fixZerosInTheEnd(Iter begin, Iter end) {
template <typename Iter> Iter fixZerosInTheEnd(Iter begin, Iter end) {
for (; begin != end; --end) {
if (*(end-1) != '0') {
if (*(end - 1) != '0') {
return end;
}
// Don't delete the last zero before the decimal point.
if (begin != (end-1) && *(end-2) == '.') {
if (begin != (end - 1) && *(end - 2) == '.') {
return end;
}
}