Skip to content

Commit 06368da

Browse files
committed
Remove unnamed namespace from ondemand
1 parent 0b68077 commit 06368da

File tree

90 files changed

+1601
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1601
-187
lines changed

benchmark/kostya/iter.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "kostya.h"
77

88
namespace kostya {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -54,10 +53,8 @@ simdjson_really_inline bool Iter::Run(const padded_string &json) {
5453

5554
BENCHMARK_TEMPLATE(Kostya, Iter);
5655

57-
} // unnamed namespace
5856

5957
namespace sum {
60-
namespace {
6158

6259
class Iter {
6360
public:
@@ -95,7 +92,6 @@ simdjson_really_inline bool Iter::Run(const padded_string &json) {
9592

9693
BENCHMARK_TEMPLATE(KostyaSum, Iter);
9794

98-
} // unnamed namespace
9995
} // namespace sum
10096
} // namespace kostya
10197

benchmark/kostya/ondemand.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "kostya.h"
77

88
namespace kostya {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -40,10 +39,8 @@ simdjson_really_inline bool OnDemand::Run(const padded_string &json) {
4039

4140
BENCHMARK_TEMPLATE(Kostya, OnDemand);
4241

43-
} // unnamed namespace
4442

4543
namespace sum {
46-
namespace {
4744

4845
class OnDemand {
4946
public:
@@ -75,7 +72,6 @@ simdjson_really_inline bool OnDemand::Run(const padded_string &json) {
7572

7673
BENCHMARK_TEMPLATE(KostyaSum, OnDemand);
7774

78-
} // unnamed namespace
7975
} // namespace sum
8076
} // namespace kostya
8177

benchmark/largerandom/iter.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "largerandom.h"
77

88
namespace largerandom {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -51,10 +50,8 @@ simdjson_really_inline bool Iter::Run(const padded_string &json) {
5150

5251
BENCHMARK_TEMPLATE(LargeRandom, Iter);
5352

54-
} // unnamed namespace
5553

5654
namespace sum {
57-
namespace {
5855

5956
class Iter {
6057
public:
@@ -91,7 +88,6 @@ simdjson_really_inline bool Iter::Run(const padded_string &json) {
9188

9289
BENCHMARK_TEMPLATE(LargeRandomSum, Iter);
9390

94-
} // unnamed namespace
9591
} // namespace sum
9692
} // namespace largerandom
9793

benchmark/largerandom/ondemand.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "largerandom.h"
77

88
namespace largerandom {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -37,10 +36,8 @@ simdjson_really_inline bool OnDemand::Run(const padded_string &json) {
3736

3837
BENCHMARK_TEMPLATE(LargeRandom, OnDemand);
3938

40-
} // unnamed namespace
4139

4240
namespace sum {
43-
namespace {
4441

4542
class OnDemand {
4643
public:
@@ -72,7 +69,6 @@ simdjson_really_inline bool OnDemand::Run(const padded_string &json) {
7269

7370
BENCHMARK_TEMPLATE(LargeRandomSum, OnDemand);
7471

75-
} // unnamed namespace
7672
} // namespace sum
7773
} // namespace largerandom
7874

benchmark/largerandom/sax.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "largerandom.h"
77

88
namespace largerandom {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -121,7 +120,6 @@ error_code Sax::Allocate(size_t new_capacity) {
121120

122121
BENCHMARK_TEMPLATE(LargeRandom, Sax);
123122

124-
}
125123
} // namespace largerandom
126124

127125
#endif // SIMDJSON_EXCEPTIONS

benchmark/partial_tweets/iter.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "partial_tweets.h"
77

88
namespace partial_tweets {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -91,7 +90,6 @@ simdjson_really_inline bool Iter::Run(const padded_string &json) {
9190

9291
BENCHMARK_TEMPLATE(PartialTweets, Iter);
9392

94-
}
9593
} // namespace partial_tweets
9694

9795
#endif // SIMDJSON_EXCEPTIONS

benchmark/partial_tweets/ondemand.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "partial_tweets.h"
77

88
namespace partial_tweets {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -56,7 +55,6 @@ simdjson_really_inline bool OnDemand::Run(const padded_string &json) {
5655

5756
BENCHMARK_TEMPLATE(PartialTweets, OnDemand);
5857

59-
}
6058
} // namespace partial_tweets
6159

6260
#endif // SIMDJSON_EXCEPTIONS

benchmark/partial_tweets/sax.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "sax_tweet_reader_visitor.h"
77

88
namespace partial_tweets {
9-
namespace {
109

1110
using namespace simdjson;
1211
using namespace SIMDJSON_IMPLEMENTATION;
@@ -67,7 +66,6 @@ error_code Sax::Allocate(size_t new_capacity) {
6766

6867
BENCHMARK_TEMPLATE(PartialTweets, Sax);
6968

70-
}
7169
} // namespace partial_tweets
7270

7371
#endif // SIMDJSON_IMPLEMENTATION

src/arm64/bitmanipulation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef SIMDJSON_ARM64_BITMANIPULATION_H
22
#define SIMDJSON_ARM64_BITMANIPULATION_H
33

4+
namespace SIMDJSON_IMPLEMENTATION {
45
namespace {
5-
namespace arm64 {
66

77
// We sometimes call trailing_zero on inputs that are zero,
88
// but the algorithms do not end up using the returned value.
@@ -55,7 +55,7 @@ simdjson_really_inline bool add_overflow(uint64_t value1, uint64_t value2, uint6
5555
#endif
5656
}
5757

58-
} // namespace arm64
5958
} // unnamed namespace
59+
} // namespace SIMDJSON_IMPLEMENTATION
6060

6161
#endif // SIMDJSON_ARM64_BITMANIPULATION_H

src/arm64/bitmask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef SIMDJSON_ARM64_BITMASK_H
22
#define SIMDJSON_ARM64_BITMASK_H
33

4+
namespace SIMDJSON_IMPLEMENTATION {
45
namespace {
5-
namespace arm64 {
66

77
//
88
// Perform a "cumulative bitwise xor," flipping bits each time a 1 is encountered.

src/arm64/dom_parser_implementation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//
66
// Stage 1
77
//
8-
namespace {
98
namespace SIMDJSON_IMPLEMENTATION {
9+
namespace {
1010

1111
using namespace simd;
1212

@@ -98,8 +98,8 @@ simdjson_really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t>
9898
return is_third_byte ^ is_fourth_byte;
9999
}
100100

101-
} // namespace SIMDJSON_IMPLEMENTATION
102101
} // unnamed namespace
102+
} // namespace SIMDJSON_IMPLEMENTATION
103103

104104
#include "generic/stage1/utf8_lookup4_algorithm.h"
105105
#include "generic/stage1/json_structural_indexer.h"
@@ -116,8 +116,8 @@ simdjson_really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t>
116116
//
117117
// Implementation-specific overrides
118118
//
119-
namespace {
120119
namespace SIMDJSON_IMPLEMENTATION {
120+
namespace {
121121
namespace stage1 {
122122

123123
simdjson_really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
@@ -128,6 +128,7 @@ simdjson_really_inline uint64_t json_string_scanner::find_escaped(uint64_t backs
128128
}
129129

130130
} // namespace stage1
131+
} // unnamed namespace
131132

132133
SIMDJSON_WARN_UNUSED error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept {
133134
return arm64::stage1::json_minifier::minify<64>(buf, len, dst, dst_len);
@@ -158,6 +159,5 @@ SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *
158159
}
159160

160161
} // namespace SIMDJSON_IMPLEMENTATION
161-
} // unnamed namespace
162162

163163
#include "arm64/end_implementation.h"

src/arm64/implementation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "arm64/begin_implementation.h"
22
#include "arm64/dom_parser_implementation.h"
33

4-
namespace {
54
namespace SIMDJSON_IMPLEMENTATION {
65

76
SIMDJSON_WARN_UNUSED error_code implementation::create_dom_parser_implementation(
@@ -17,6 +16,5 @@ SIMDJSON_WARN_UNUSED error_code implementation::create_dom_parser_implementation
1716
}
1817

1918
} // namespace SIMDJSON_IMPLEMENTATION
20-
} // unnamed namespace
2119

2220
#include "arm64/end_implementation.h"

src/arm64/implementation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "simdjson.h"
55
#include "isadetection.h"
66

7-
namespace {
87
namespace arm64 {
98

109
using namespace simdjson;
@@ -23,6 +22,5 @@ class implementation final : public simdjson::implementation {
2322
};
2423

2524
} // namespace arm64
26-
} // unnamed namespace
2725

2826
#endif // SIMDJSON_ARM64_IMPLEMENTATION_H

src/arm64/numberparsing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef SIMDJSON_ARM64_NUMBERPARSING_H
22
#define SIMDJSON_ARM64_NUMBERPARSING_H
33

4+
namespace SIMDJSON_IMPLEMENTATION {
45
namespace {
5-
namespace arm64 {
66

77
// we don't have SSE, so let us use a scalar function
88
// credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/
@@ -14,8 +14,8 @@ static simdjson_really_inline uint32_t parse_eight_digits_unrolled(const uint8_t
1414
return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32);
1515
}
1616

17-
} // namespace arm64
1817
} // unnamed namespace
18+
} // namespace SIMDJSON_IMPLEMENTATION
1919

2020
#define SWAR_NUMBER_PARSING
2121

src/arm64/simd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <type_traits>
88

99

10+
namespace SIMDJSON_IMPLEMENTATION {
1011
namespace {
11-
namespace arm64 {
1212
namespace simd {
1313

1414
#ifdef SIMDJSON_REGULAR_VISUAL_STUDIO
@@ -484,7 +484,7 @@ simdjson_really_inline int8x16_t make_int8x16_t(int8_t x1, int8_t x2, int8_t x
484484
}; // struct simd8x64<T>
485485

486486
} // namespace simd
487-
} // namespace arm64
488487
} // unnamed namespace
488+
} // namespace SIMDJSON_IMPLEMENTATION
489489

490490
#endif // SIMDJSON_ARM64_SIMD_H

src/arm64/stringparsing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include "arm64/simd.h"
66
#include "arm64/bitmanipulation.h"
77

8+
namespace SIMDJSON_IMPLEMENTATION {
89
namespace {
9-
namespace arm64 {
1010

1111
using namespace simd;
1212

@@ -43,8 +43,8 @@ simdjson_really_inline backslash_and_quote backslash_and_quote::copy_and_find(co
4343
};
4444
}
4545

46-
} // namespace arm64
4746
} // unnamed namespace
47+
} // namespace SIMDJSON_IMPLEMENTATION
4848

4949
#include "generic/stage2/stringparsing.h"
5050

src/fallback/bitmanipulation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "simdjson.h"
55
#include <limits>
66

7+
namespace SIMDJSON_IMPLEMENTATION {
78
namespace {
8-
namespace fallback {
99

1010
#if defined(_MSC_VER) && !defined(_M_ARM64) && !defined(_M_X64)
1111
static inline unsigned char _BitScanForward64(unsigned long* ret, uint64_t x) {
@@ -39,7 +39,7 @@ simdjson_really_inline int leading_zeroes(uint64_t input_num) {
3939
#endif// _MSC_VER
4040
}
4141

42-
} // namespace fallback
4342
} // unnamed namespace
43+
} // namespace SIMDJSON_IMPLEMENTATION
4444

4545
#endif // SIMDJSON_FALLBACK_BITMANIPULATION_H

src/fallback/dom_parser_implementation.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
#include "generic/stage1/find_next_document_index.h"
99

10-
namespace {
1110
namespace SIMDJSON_IMPLEMENTATION {
11+
namespace {
1212
namespace stage1 {
1313

1414
class structural_scanner {
@@ -179,6 +179,7 @@ simdjson_really_inline error_code scan() {
179179
}; // structural_scanner
180180

181181
} // namespace stage1
182+
} // unnamed namespace
182183

183184
SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::stage1(const uint8_t *_buf, size_t _len, bool partial) noexcept {
184185
this->buf = _buf;
@@ -308,7 +309,6 @@ SIMDJSON_WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t
308309
}
309310

310311
} // namespace SIMDJSON_IMPLEMENTATION
311-
} // unnamed namespace
312312

313313
//
314314
// Stage 2
@@ -317,7 +317,6 @@ SIMDJSON_WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t
317317
#include "fallback/numberparsing.h"
318318
#include "generic/stage2/tape_builder.h"
319319

320-
namespace {
321320
namespace SIMDJSON_IMPLEMENTATION {
322321

323322
SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
@@ -335,6 +334,5 @@ SIMDJSON_WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *
335334
}
336335

337336
} // namespace SIMDJSON_IMPLEMENTATION
338-
} // unnamed namespace
339337

340338
#include "fallback/end_implementation.h"

0 commit comments

Comments
 (0)