Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/yyjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -4305,9 +4305,11 @@ static_inline u64 diy_fp_to_ieee_raw(diy_fp fp) {
#define F64_POW10_EXP_MAX_EXACT 22

/** Cached pow10 table. */
#if YYJSON_DOUBLE_MATH_CORRECT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a good fix. For better code organization and to prevent potential future warnings about unused macros, consider also moving the definition of F64_POW10_EXP_MAX_EXACT (and its comment) from line 4305 inside this #if block, as it is only used when YYJSON_DOUBLE_MATH_CORRECT is enabled.

static const f64 f64_pow10_table[] = {
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11,
1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
#endif

/**
Read a JSON number.
Expand Down
Loading