From 2956bce047dfc04328751dbda29dc492e7457e03 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 25 Jun 2020 21:12:26 -0400 Subject: [PATCH] Minor fixes to avoid 32-bit warnings. --- include/simdjson/inline/tape_ref.h | 4 ++-- singleheader/amalgamate_demo.cpp | 2 +- singleheader/simdjson.cpp | 2 +- singleheader/simdjson.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/simdjson/inline/tape_ref.h b/include/simdjson/inline/tape_ref.h index bdd0d57ee..1d7e5efd0 100644 --- a/include/simdjson/inline/tape_ref.h +++ b/include/simdjson/inline/tape_ref.h @@ -83,13 +83,13 @@ really_inline T tape_ref::next_tape_value() const noexcept { really_inline uint32_t internal::tape_ref::get_string_length() const noexcept { uint64_t string_buf_index = size_t(tape_value()); uint32_t len; - memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len)); + memcpy(&len, &doc->string_buf[size_t(string_buf_index)], sizeof(len)); return len; } really_inline const char * internal::tape_ref::get_c_str() const noexcept { uint64_t string_buf_index = size_t(tape_value()); - return reinterpret_cast(&doc->string_buf[string_buf_index + sizeof(uint32_t)]); + return reinterpret_cast(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]); } inline std::string_view internal::tape_ref::get_string_view() const noexcept { diff --git a/singleheader/amalgamate_demo.cpp b/singleheader/amalgamate_demo.cpp index 0207b3912..04b814121 100644 --- a/singleheader/amalgamate_demo.cpp +++ b/singleheader/amalgamate_demo.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */ +/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */ #include #include "simdjson.h" diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index d0c23880b..f9199c2d0 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */ +/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */ /* begin file src/simdjson.cpp */ #include "simdjson.h" diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index e0a5a3d93..930fdee82 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on Thu Jun 25 16:43:19 PDT 2020. Do not edit! */ +/* auto-generated on Fri Jun 26 01:04:15 UTC 2020. Do not edit! */ /* begin file include/simdjson.h */ #ifndef SIMDJSON_H #define SIMDJSON_H @@ -7649,13 +7649,13 @@ really_inline T tape_ref::next_tape_value() const noexcept { really_inline uint32_t internal::tape_ref::get_string_length() const noexcept { uint64_t string_buf_index = size_t(tape_value()); uint32_t len; - memcpy(&len, &doc->string_buf[string_buf_index], sizeof(len)); + memcpy(&len, &doc->string_buf[size_t(string_buf_index)], sizeof(len)); return len; } really_inline const char * internal::tape_ref::get_c_str() const noexcept { uint64_t string_buf_index = size_t(tape_value()); - return reinterpret_cast(&doc->string_buf[string_buf_index + sizeof(uint32_t)]); + return reinterpret_cast(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]); } inline std::string_view internal::tape_ref::get_string_view() const noexcept {