diff --git a/include/simdjson/numberparsing.h b/include/simdjson/numberparsing.h index 68fa28b37..23c82f067 100644 --- a/include/simdjson/numberparsing.h +++ b/include/simdjson/numberparsing.h @@ -331,7 +331,7 @@ static never_inline bool parse_large_integer(const uint8_t *const buf, return false; // overflow } } - int64_t signed_answer = negative ? -i : i; + int64_t signed_answer = negative ? -static_cast(i) : static_cast(i); pj.write_tape_s64(signed_answer); #ifdef JSON_TEST_NUMBERS // for unit testing foundInteger(signed_answer, buf + offset); diff --git a/include/simdjson/parsedjson.h b/include/simdjson/parsedjson.h index 1b39c3a79..bca9784bf 100644 --- a/include/simdjson/parsedjson.h +++ b/include/simdjson/parsedjson.h @@ -30,7 +30,7 @@ public: ParsedJson(ParsedJson && p); // if needed, allocate memory so that the object is able to process JSON - // documents having up to len butes and maxdepth "depth" + // documents having up to len bytes and maxdepth "depth" WARN_UNUSED bool allocateCapacity(size_t len, size_t maxdepth = DEFAULTMAXDEPTH); diff --git a/singleheader/amalgamation_demo.cpp b/singleheader/amalgamation_demo.cpp index e19718f92..1f4241f91 100644 --- a/singleheader/amalgamation_demo.cpp +++ b/singleheader/amalgamation_demo.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Wed 6 Mar 11:05:32 AEDT 2019. Do not edit! */ +/* auto-generated on Fri Mar 8 19:04:53 PST 2019. Do not edit! */ #include #include "simdjson.h" diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index 6c62c8e54..07cc9bb19 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Wed 6 Mar 11:05:32 AEDT 2019. Do not edit! */ +/* auto-generated on Fri Mar 8 19:04:53 PST 2019. Do not edit! */ #include "simdjson.h" /* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */ @@ -1626,31 +1626,30 @@ uint8_t ParsedJson::iterator::get_scope_type() const { } bool ParsedJson::iterator::move_forward() { - if(location + 1 >= tape_length) { - return false; // we are at the end! - } - // we are entering a new scope - if ((current_type == '[') || (current_type == '{')){ - depth++; - depthindex[depth].start_of_scope = location; - depthindex[depth].scope_type = current_type; - } - location = location + 1; - current_val = pj.tape[location]; - current_type = (current_val >> 56); - // if we encounter a scope closure, we need to move up - while ((current_type == ']') || (current_type == '}')) { if(location + 1 >= tape_length) { return false; // we are at the end! } - depth--; - if(depth == 0) { - return false; // should not be necessary + + if ((current_type == '[') || (current_type == '{')){ + // We are entering a new scope + depth++; + depthindex[depth].start_of_scope = location; + depthindex[depth].scope_type = current_type; + } else if ((current_type == ']') || (current_type == '}')) { + // Leaving a scope. + depth--; + if(depth == 0) { + // Should not be necessary + return false; + } + } else if ((current_type == 'd') || (current_type == 'l')) { + // d and l types use 2 locations on the tape, not just one. + location += 1; } - location = location + 1; + + location += 1; current_val = pj.tape[location]; current_type = (current_val >> 56); - } return true; } diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index 4d604abfa..9e8f8a6e0 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on Wed 6 Mar 11:05:32 AEDT 2019. Do not edit! */ +/* auto-generated on Fri Mar 8 19:04:53 PST 2019. Do not edit! */ /* begin file include/simdjson/simdjson_version.h */ // /include/simdjson/simdjson_version.h automatically generated by release.py, do not change by hand #ifndef SIMDJSON_INCLUDE_SIMDJSON_VERSION @@ -36571,7 +36571,7 @@ static never_inline bool parse_large_integer(const uint8_t *const buf, return false; // overflow } } - int64_t signed_answer = negative ? -i : i; + int64_t signed_answer = negative ? -static_cast(i) : static_cast(i); pj.write_tape_s64(signed_answer); #ifdef JSON_TEST_NUMBERS // for unit testing foundInteger(signed_answer, buf + offset);