Skip to content

Commit 2956bce

Browse files
committed
Minor fixes to avoid 32-bit warnings.
1 parent 41f33ec commit 2956bce

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

include/simdjson/inline/tape_ref.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ really_inline T tape_ref::next_tape_value() const noexcept {
8383
really_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
8484
uint64_t string_buf_index = size_t(tape_value());
8585
uint32_t len;
86-
memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len));
86+
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 {
9191
uint64_t string_buf_index = size_t(tape_value());
92-
return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
92+
return reinterpret_cast<const char *>(&doc->string_buf[size_t(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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
22

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

singleheader/simdjson.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
22
/* begin file src/simdjson.cpp */
33
#include "simdjson.h"
44

singleheader/simdjson.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */
1+
/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */
22
/* begin file include/simdjson.h */
33
#ifndef SIMDJSON_H
44
#define SIMDJSON_H
@@ -7649,13 +7649,13 @@ really_inline T tape_ref::next_tape_value() const noexcept {
76497649
really_inline uint32_t internal::tape_ref::get_string_length() const noexcept {
76507650
uint64_t string_buf_index = size_t(tape_value());
76517651
uint32_t len;
7652-
memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len));
7652+
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 {
76577657
uint64_t string_buf_index = size_t(tape_value());
7658-
return reinterpret_cast<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
7658+
return reinterpret_cast<const char *>(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]);
76597659
}
76607660

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

0 commit comments

Comments
 (0)