From 85dc6403f2944f790f5220a9e6bc0c7b6320c680 Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Mon, 4 Sep 2023 13:28:52 +0200 Subject: [PATCH 1/5] Fix for shadowed path variable Fixes the warning about declaration shadows a local variable for path parameter. --- include/jsoncons_ext/jsonpath/expression.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/jsoncons_ext/jsonpath/expression.hpp b/include/jsoncons_ext/jsonpath/expression.hpp index 053a72664a..aa6d082820 100644 --- a/include/jsoncons_ext/jsonpath/expression.hpp +++ b/include/jsoncons_ext/jsonpath/expression.hpp @@ -3077,9 +3077,9 @@ namespace detail { if ((options & result_options::path) == result_options::path) { - auto callback = [&result](const json_location_type& path, reference) + auto callback = [&result](const json_location_type& pathp, reference) { - result.emplace_back(path.to_string()); + result.emplace_back(pathp.to_string()); }; evaluate(resources, root, path, instance, callback, options); } From 78fa9b44ffe27c7f8907e2537da077a5ea8e89ec Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Mon, 4 Sep 2023 13:57:40 +0200 Subject: [PATCH 2/5] Fix for shadowed path variable Fixes the warning about declaration shadows a local variable for path parameter. --- include/jsoncons_ext/jsonpath/json_query.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jsoncons_ext/jsonpath/json_query.hpp b/include/jsoncons_ext/jsonpath/json_query.hpp index 8636335c3e..701af94f5a 100644 --- a/include/jsoncons_ext/jsonpath/json_query.hpp +++ b/include/jsoncons_ext/jsonpath/json_query.hpp @@ -127,9 +127,9 @@ namespace jsonpath { jsoncons::jsonpath::detail::dynamic_resources resources; - auto f = [&callback](const json_location_type& path, reference val) + auto f = [&callback](const json_location_type& pathp, reference val) { - callback(path.to_string(), val); + callback(pathp.to_string(), val); }; expr.evaluate_with_replacement(resources, instance, resources.root_path_node(), instance, f); } @@ -154,9 +154,9 @@ namespace jsonpath { jsoncons::jsonpath::detail::dynamic_resources resources{alloc_set.get_allocator()}; - auto f = [&callback](const json_location_type& path, reference val) + auto f = [&callback](const json_location_type& pathp, reference val) { - callback(path.to_string(), val); + callback(pathp.to_string(), val); }; expr.evaluate_with_replacement(resources, instance, resources.root_path_node(), instance, f); } From 192e3e071265ed1fb0290c4f38a8f90f519f5a08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:41:13 +0000 Subject: [PATCH 3/5] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/ubuntu.yml | 12 ++++++------ .github/workflows/windows.yml | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c98a7f22d2..23f5795268 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8958a0fcda..51d04bad5d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 75d858fddb..0aba298a0b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: cmake run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DJSONCONS_BUILD_TESTS=On -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON - name: build diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a56627c1c8..ebe7d7aad5 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install_gcc run: | sudo apt update @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install_gcc run: | sudo apt update @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install_gcc run: | sudo apt update @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install_gcc run: | sudo apt update @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install_gcc run: | sudo apt update @@ -121,7 +121,7 @@ jobs: # runs-on: ubuntu-18.04 # # steps: -# - uses: actions/checkout@v3 +# - uses: actions/checkout@v4 # with: # fetch-depth: 0 # - name: Install diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7b625cae6c..dd25ec2371 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,7 +20,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -45,7 +45,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -70,7 +70,7 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -95,7 +95,7 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive From b865553349dec9fe8dbd5790266a919a37f82cb0 Mon Sep 17 00:00:00 2001 From: MonkeybreadSoftware Date: Mon, 18 Sep 2023 10:24:30 +0200 Subject: [PATCH 4/5] 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 6a1daba634..ddadc99d40 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 5/5] 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 ddadc99d40..75a9de92a4 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('\"');