Skip to content

Commit b6997a5

Browse files
committed
Patching things up and adding tests.
1 parent 74178fd commit b6997a5

File tree

6 files changed

+57
-9
lines changed

6 files changed

+57
-9
lines changed

.drone.yml

+42
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,46 @@
11
kind: pipeline
2+
name: i386-gcc # we do not support 32-bit systems, but we run tests
3+
platform: { os: linux, arch: amd64 }
4+
steps:
5+
- name: Build and Test
6+
image: i386/ubuntu
7+
environment:
8+
CC: gcc
9+
CXX: g++
10+
BUILD_FLAGS: -- -j
11+
CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=ON
12+
CTEST_FLAGS: -j4 --output-on-failure -E checkperf -E numberparsingcheck # A ULP marging 1 is detected on 32-bit GCC
13+
commands:
14+
- apt-get update -qq
15+
- apt-get install -y g++ cmake gcc
16+
- mkdir build
17+
- cd build
18+
- cmake $CMAKE_FLAGS ..
19+
- cmake --build . $BUILD_FLAGS
20+
- ctest $CTEST_FLAGS
21+
---
22+
kind: pipeline
23+
name: i386-clang # we do not support 32-bit systems, but we run tests
24+
platform: { os: linux, arch: amd64 }
25+
steps:
26+
- name: Build and Test
27+
image: i386/ubuntu
28+
environment:
29+
CC: clang-6.0
30+
CXX: clang++-6.0
31+
BUILD_FLAGS: -- -j
32+
CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=ON
33+
CTEST_FLAGS: -j4 --output-on-failure -E checkperf
34+
commands:
35+
- apt-get update -qq
36+
- apt-get install -y clang++-6.0 cmake
37+
- mkdir build
38+
- cd build
39+
- cmake $CMAKE_FLAGS ..
40+
- cmake --build . $BUILD_FLAGS
41+
- ctest $CTEST_FLAGS
42+
---
43+
kind: pipeline
244
name: gcc9
345
platform: { os: linux, arch: amd64 }
446
steps:

include/simdjson/inline/tape_ref.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ really_inline T tape_ref::next_tape_value() const noexcept {
8181
}
8282

8383
really_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
84-
uint64_t string_buf_index = size_t(tape_value());
84+
size_t string_buf_index = size_t(tape_value());
8585
uint32_t len;
8686
memcpy(&len, &doc->string_buf[size_t(string_buf_index)], sizeof(len));
8787
return len;
8888
}
8989

9090
really_inline const char * internal::tape_ref::get_c_str() const noexcept {
91-
uint64_t string_buf_index = size_t(tape_value());
92-
return reinterpret_cast<const char *>(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]);
91+
size_t string_buf_index = size_t(tape_value());
92+
return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
9393
}
9494

9595
inline std::string_view internal::tape_ref::get_string_view() const noexcept {

singleheader/amalgamate_demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 15:35:58 UTC 2020. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

singleheader/simdjson.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 15:35:58 UTC 2020. Do not edit! */
22
/* begin file src/simdjson.cpp */
33
#include "simdjson.h"
44

singleheader/simdjson.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 15:35:58 UTC 2020. Do not edit! */
22
/* begin file include/simdjson.h */
33
#ifndef SIMDJSON_H
44
#define SIMDJSON_H
@@ -7647,15 +7647,15 @@ really_inline T tape_ref::next_tape_value() const noexcept {
76477647
}
76487648

76497649
really_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
7650-
uint64_t string_buf_index = size_t(tape_value());
7650+
size_t string_buf_index = size_t(tape_value());
76517651
uint32_t len;
76527652
memcpy(&len, &doc->string_buf[size_t(string_buf_index)], sizeof(len));
76537653
return len;
76547654
}
76557655

76567656
really_inline const char * internal::tape_ref::get_c_str() const noexcept {
7657-
uint64_t string_buf_index = size_t(tape_value());
7658-
return reinterpret_cast<const char *>(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]);
7657+
size_t string_buf_index = size_t(tape_value());
7658+
return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
76597659
}
76607660

76617661
inline std::string_view internal::tape_ref::get_string_view() const noexcept {

src/simdprune_tables.h

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#ifndef SIMDJSON_SIMDPRUNE_TABLES_H
22
#define SIMDJSON_SIMDPRUNE_TABLES_H
3+
4+
5+
#if SIMDJSON_IMPLEMENTATION_ARM64 || SIMDJSON_IMPLEMENTATION_HASWELL || SIMDJSON_IMPLEMENTATION_WESTMERE
6+
37
#include <cstdint>
48

59
namespace simdjson { // table modified and copied from
@@ -127,4 +131,6 @@ static const uint64_t thintable_epi8[256] = {
127131

128132
} // namespace simdjson
129133

134+
135+
#endif // SIMDJSON_IMPLEMENTATION_ARM64 || SIMDJSON_IMPLEMENTATION_HASWELL || SIMDJSON_IMPLEMENTATION_WESTMERE
130136
#endif // SIMDJSON_SIMDPRUNE_TABLES_H

0 commit comments

Comments
 (0)