Minor fixes to avoid 32-bit warnings.

This commit is contained in:
Daniel Lemire 2020-06-25 21:12:26 -04:00
parent 41f33ecbb9
commit 2956bce047
4 changed files with 7 additions and 7 deletions

View File

@ -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<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
return reinterpret_cast<const char *>(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]);
}
inline std::string_view internal::tape_ref::get_string_view() const noexcept {

View File

@ -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 <iostream>
#include "simdjson.h"

View File

@ -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"

View File

@ -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<const char *>(&doc->string_buf[string_buf_index + sizeof(uint32_t)]);
return reinterpret_cast<const char *>(&doc->string_buf[size_t(string_buf_index) + sizeof(uint32_t)]);
}
inline std::string_view internal::tape_ref::get_string_view() const noexcept {