Skip to content

Commit

Permalink
Fix error with g++-5 -m32 -fPIC #85
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Jun 17, 2022
1 parent 1e9fae0 commit 8969d6d
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/yyjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -3402,23 +3402,16 @@ static_inline bool read_number(u8 **ptr,

/*
Read integral part, same as the following code.
For more explanation, see the comments under label `skip_ascii_begin`.
for (int i = 1; i <= 18; i++) {
num = cur[i] - '0';
if (num <= 9) sig = num + sig * 10;
else goto digi_sepr_i;
}
*/
#if YYJSON_IS_REAL_GCC
#define expr_intg(i) \
if (likely((num = (u64)(cur[i] - (u8)'0')) <= 9)) sig = num + sig * 10; \
else { __asm volatile("":"=m"(cur[i])::); goto digi_sepr_##i; }
#else
#define expr_intg(i) \
if (likely((num = (u64)(cur[i] - (u8)'0')) <= 9)) sig = num + sig * 10; \
else { goto digi_sepr_##i; }
#endif
repeat_in_1_18(expr_intg);
#undef expr_intg

Expand Down Expand Up @@ -3446,19 +3439,11 @@ static_inline bool read_number(u8 **ptr,


/* read fraction part */
#if YYJSON_IS_REAL_GCC
#define expr_frac(i) \
digi_frac_##i: \
if (likely((num = (u64)(cur[i + 1] - (u8)'0')) <= 9)) \
sig = num + sig * 10; \
else { __asm volatile("":"=m"(cur[i + 1])::); goto digi_stop_##i; }
#else
#define expr_frac(i) \
digi_frac_##i: \
if (likely((num = (u64)(cur[i + 1] - (u8)'0')) <= 9)) \
sig = num + sig * 10; \
else { goto digi_stop_##i; }
#endif
repeat_in_1_18(expr_frac)
#undef expr_frac

Expand Down

0 comments on commit 8969d6d

Please sign in to comment.