From 102c47439731facb50a3c7427a397a253ebb0b98 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 28 Jan 2018 14:13:02 +0100 Subject: [PATCH] :hammer: clean up --- develop/detail/output/binary_writer.hpp | 7 ++++--- src/json.hpp | 7 ++++--- test/src/unit-cbor.cpp | 2 +- test/src/unit-ubjson.cpp | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/develop/detail/output/binary_writer.hpp b/develop/detail/output/binary_writer.hpp index 63b16f3e2..fdf9a2161 100644 --- a/develop/detail/output/binary_writer.hpp +++ b/develop/detail/output/binary_writer.hpp @@ -684,10 +684,11 @@ class binary_writer @tparam NumberType the type of the number @note This function needs to respect the system's endianess, because bytes - in CBOR and MessagePack are stored in network order (big endian) and - therefore need reordering on little endian systems. + in CBOR, MessagePack, and UBJSON are stored in network order (big + endian) and therefore need reordering on little endian systems. */ - template void write_number(NumberType n) + template + void write_number(const NumberType n) { // step 1: write number to array of length NumberType std::array vec; diff --git a/src/json.hpp b/src/json.hpp index deee45042..e51d66c5b 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -6846,10 +6846,11 @@ class binary_writer @tparam NumberType the type of the number @note This function needs to respect the system's endianess, because bytes - in CBOR and MessagePack are stored in network order (big endian) and - therefore need reordering on little endian systems. + in CBOR, MessagePack, and UBJSON are stored in network order (big + endian) and therefore need reordering on little endian systems. */ - template void write_number(NumberType n) + template + void write_number(const NumberType n) { // step 1: write number to array of length NumberType std::array vec; diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index 1e37a9821..43fca0289 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -1703,7 +1703,7 @@ TEST_CASE("CBOR roundtrips", "[hide]") } } -TEST_CASE("all first bytes", "[!throws]") +TEST_CASE("all CBOR first bytes", "[!throws]") { // these bytes will fail immediately with exception parse_error.112 std::set unsupported = diff --git a/test/src/unit-ubjson.cpp b/test/src/unit-ubjson.cpp index 291093c45..2d87e5700 100644 --- a/test/src/unit-ubjson.cpp +++ b/test/src/unit-ubjson.cpp @@ -2071,7 +2071,7 @@ TEST_CASE("Universal Binary JSON Specification Examples 2") */ -TEST_CASE("all first bytes", "[!throws]") +TEST_CASE("all UBJSON first bytes", "[!throws]") { // these bytes will fail immediately with exception parse_error.112 std::set supported =