From 370f8f5086069917a75a7ea8f91a86ecb85b88e7 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 30 Dec 2018 20:06:11 -0500 Subject: [PATCH] Tweaking --- include/simdjson/parsedjson.h | 5 ++--- include/simdjson/portability.h | 8 ++++---- src/jsonioutil.cpp | 4 ++-- src/stage34_unified.cpp | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/simdjson/parsedjson.h b/include/simdjson/parsedjson.h index a1605e4fe..15ee69cb2 100644 --- a/include/simdjson/parsedjson.h +++ b/include/simdjson/parsedjson.h @@ -375,10 +375,10 @@ public: } iterator(iterator &&o): - pj(std::move(o.pj)), depth(std::move(o.depth)), location(std::move(o.location)), + pj(o.pj), depth(std::move(o.depth)), location(std::move(o.location)), tape_length(std::move(o.tape_length)), current_type(std::move(o.current_type)), current_val(std::move(o.current_val)), depthindex(std::move(o.depthindex)) { - o.depthindex = NULL;// we take ownship + o.depthindex = NULL;// we take ownership } WARN_UNUSED @@ -728,7 +728,6 @@ private: p.ret_address=NULL; p.string_buf=NULL; p.current_string_buf_loc=NULL; - p.isvalid=NULL; } private : diff --git a/include/simdjson/portability.h b/include/simdjson/portability.h index c6e8056d7..833b09740 100644 --- a/include/simdjson/portability.h +++ b/include/simdjson/portability.h @@ -46,20 +46,20 @@ static inline int hamming(uint64_t input_num) { #include static inline bool add_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { - return __builtin_uaddl_overflow(value1, value2, result); + return __builtin_uaddl_overflow(value1, value2, (unsigned long *)result); } static inline bool mul_overflow(uint64_t value1, uint64_t value2, uint64_t *result) { - return __builtin_umulll_overflow(value1, value2, result); + return __builtin_umulll_overflow(value1, value2, (unsigned long long *)result); } /* result might be undefined when input_num is zero */ static inline int trailingzeroes(uint64_t input_num) { - return __tzcnt_u64(input_num); + return _tzcnt_u64(input_num); } /* result might be undefined when input_num is zero */ static inline int leadingzeroes(uint64_t input_num) { - return __lzcnt_u64(input_num); + return _lzcnt_u64(input_num); } /* result might be undefined when input_num is zero */ diff --git a/src/jsonioutil.cpp b/src/jsonioutil.cpp index 494776ee3..5b74d1080 100644 --- a/src/jsonioutil.cpp +++ b/src/jsonioutil.cpp @@ -1,6 +1,6 @@ #include "simdjson/jsonioutil.h" #include - +#include char * allocate_padded_buffer(size_t length) { // we could do a simple malloc @@ -13,7 +13,7 @@ char * allocate_padded_buffer(size_t length) { #elif defined(__MINGW32__) || defined(__MINGW64__) padded_buffer = __mingw_aligned_malloc(totalpaddedlength, 64); #else - if (posix_memalign(&padded_buffer, 64, totalpaddedlength) != 0) return NULL; + if (posix_memalign((void **)&padded_buffer, 64, totalpaddedlength) != 0) return NULL; #endif return padded_buffer; } diff --git a/src/stage34_unified.cpp b/src/stage34_unified.cpp index 3934214e9..4e6021caf 100644 --- a/src/stage34_unified.cpp +++ b/src/stage34_unified.cpp @@ -369,7 +369,7 @@ scope_end: pj.annotate_previousloc(pj.containing_scope_offset[depth], pj.get_current_loc()); // goto saved_state -#ifdef SIMDJSON_USE_COMPUTED_GOT +#ifdef SIMDJSON_USE_COMPUTED_GOTO goto *pj.ret_address[depth]; #else if(pj.ret_address[depth] == 'a') {