From b865553349dec9fe8dbd5790266a919a37f82cb0 Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Mon, 18 Sep 2023 10:24:30 +0200 Subject: [PATCH 1/2] Update json_encoder.hpp Output semantic_tag::bigdec as number --- include/jsoncons/json_encoder.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/jsoncons/json_encoder.hpp b/include/jsoncons/json_encoder.hpp index 6a1daba63..ddadc99d4 100644 --- a/include/jsoncons/json_encoder.hpp +++ b/include/jsoncons/json_encoder.hpp @@ -673,6 +673,15 @@ namespace detail { case semantic_tag::bigint: write_bigint_value(sv); break; + case semantic_tag::bigdec: + { + // output lossless number + if (options_.bigint_format() == bigint_chars_format::number) + { + write_bigint_value(sv); + break; + } + } // fall through default: { sink_.push_back('\"'); @@ -1324,6 +1333,15 @@ namespace detail { case semantic_tag::bigint: write_bigint_value(sv); break; + case semantic_tag::bigdec: + { + // output lossless number + if (options_.bigint_format() == bigint_chars_format::number) + { + write_bigint_value(sv); + break; + } + } // fall through default: { sink_.push_back('\"'); From d62a61407a917f5bdf020a1b35defc616e201562 Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Thu, 21 Sep 2023 07:10:33 +0200 Subject: [PATCH 2/2] Update json_encoder.hpp added JSONCONS_FALLTHROUGH --- include/jsoncons/json_encoder.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/jsoncons/json_encoder.hpp b/include/jsoncons/json_encoder.hpp index ddadc99d4..75a9de92a 100644 --- a/include/jsoncons/json_encoder.hpp +++ b/include/jsoncons/json_encoder.hpp @@ -679,9 +679,10 @@ namespace detail { if (options_.bigint_format() == bigint_chars_format::number) { write_bigint_value(sv); - break; - } - } // fall through + break; + } + JSONCONS_FALLTHROUGH; + } default: { sink_.push_back('\"'); @@ -1340,8 +1341,9 @@ namespace detail { { write_bigint_value(sv); break; - } - } // fall through + } + JSONCONS_FALLTHROUGH; + } default: { sink_.push_back('\"');