Put anonymous namespace in front of everything

This commit is contained in:
John Keiser
2020-07-24 07:32:12 -07:00
parent 2f92a34bb7
commit 65148b123b
55 changed files with 188 additions and 41 deletions
@@ -8,6 +8,7 @@
namespace simdjson {
namespace SIMDJSON_IMPLEMENTATION {
namespace {
using namespace simd;
@@ -69,6 +70,7 @@ really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, c
return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
}
} // namespace {
} // namespace SIMDJSON_IMPLEMENTATION
} // namespace simdjson
@@ -89,6 +91,7 @@ really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, c
namespace simdjson {
namespace SIMDJSON_IMPLEMENTATION {
namespace {
namespace stage1 {
really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
@@ -97,6 +100,7 @@ really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
}
} // namespace stage1
} // namespace {
WARN_UNUSED error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept {
return westmere::stage1::json_minifier::minify<64>(buf, len, dst, dst_len);
@@ -112,6 +116,23 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
return simdjson::westmere::stage1::generic_validate_utf8(buf,len);
}
WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
error_code result = stage2::parse_structurals<false>(*this, _doc);
if (result) { return result; }
// If we didn't make it to the end, it's an error
if ( next_structural_index != n_structural_indexes ) {
logger::log_string("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
return error = TAPE_ERROR;
}
return SUCCESS;
}
WARN_UNUSED error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept {
return stage2::parse_structurals<true>(*this, _doc);
}
WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
error_code err = stage1(_buf, _len, false);
if (err) { return err; }