@@ -128,7 +128,7 @@ static inline uint32_t parse_eight_digits_unrolled(const char *chars) {
128128 const __m128i mul_1_100 = _mm_setr_epi16 (100 , 1 , 100 , 1 , 100 , 1 , 100 , 1 );
129129 const __m128i mul_1_10000 =
130130 _mm_setr_epi16 (10000 , 1 , 10000 , 1 , 10000 , 1 , 10000 , 1 );
131- const __m128i input = _mm_sub_epi8 (_mm_loadu_si128 ((__m128i * )chars ), ascii0 );
131+ const __m128i input = _mm_sub_epi8 (_mm_loadu_si128 ((const __m128i * )chars ), ascii0 );
132132 const __m128i t1 = _mm_maddubs_epi16 (input , mul_1_10 );
133133 const __m128i t2 = _mm_madd_epi16 (t1 , mul_1_100 );
134134 const __m128i t3 = _mm_packus_epi32 (t2 , t2 );
@@ -149,7 +149,7 @@ static inline uint32_t parse_eight_digits_unrolled(const char *chars) {
149149//
150150static never_inline bool
151151parse_highprecision_float (const u8 * const buf , UNUSED size_t len ,
152- ParsedJson & pj , const u32 depth , const u32 offset ,
152+ ParsedJson & pj , UNUSED const u32 depth , const u32 offset ,
153153 UNUSED bool found_zero , bool found_minus ) {
154154 const char * p = (const char * )(buf + offset );
155155
@@ -193,7 +193,6 @@ parse_highprecision_float(const u8 *const buf, UNUSED size_t len,
193193 }
194194 exponent = firstafterperiod - p ;
195195 }
196- int64_t expnumber = 0 ; // exponential part
197196 if (('e' == * p ) || ('E' == * p )) {
198197 ++ p ;
199198 bool negexp = false;
@@ -210,7 +209,7 @@ parse_highprecision_float(const u8 *const buf, UNUSED size_t len,
210209 return false;
211210 }
212211 unsigned char digit = * p - '0' ;
213- expnumber = digit ;
212+ int64_t expnumber = digit ; // exponential part
214213 p ++ ;
215214 if (is_integer (* p )) {
216215 digit = * p - '0' ;
@@ -270,7 +269,7 @@ parse_highprecision_float(const u8 *const buf, UNUSED size_t len,
270269//
271270static never_inline bool parse_large_integer (const u8 * const buf ,
272271 UNUSED size_t len , ParsedJson & pj ,
273- const u32 depth , const u32 offset ,
272+ UNUSED const u32 depth , const u32 offset ,
274273 UNUSED bool found_zero ,
275274 bool found_minus ) {
276275 const char * p = (const char * )(buf + offset );
@@ -340,10 +339,12 @@ static never_inline bool parse_large_integer(const u8 *const buf,
340339#define unlikely (x ) __builtin_expect(!!(x), 0)
341340#endif
342341
342+
343+
343344// parse the number at buf + offset
344345// define JSON_TEST_NUMBERS for unit testing
345346static really_inline bool parse_number (const u8 * const buf , UNUSED size_t len ,
346- ParsedJson & pj , const u32 depth ,
347+ ParsedJson & pj , UNUSED const u32 depth ,
347348 const u32 offset , UNUSED bool found_zero ,
348349 bool found_minus ) {
349350 const char * p = (const char * )(buf + offset );
0 commit comments