Fix typos (#4748)
* ✏️ fix typos Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ✏️ address review comments Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ✏️ address review comments Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
0a8b48ac6a
commit
9110918cf8
42 files changed
+329
-325
No files matched your search
@@ -1552,7 +1552,7 @@ class binary_writer
|
||||
{
|
||||
return 'L';
|
||||
}
|
||||
// anything else is treated as high-precision number
|
||||
// anything else is treated as a high-precision number
|
||||
return 'H'; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
@@ -1590,7 +1590,7 @@ class binary_writer
|
||||
{
|
||||
return 'M';
|
||||
}
|
||||
// anything else is treated as high-precision number
|
||||
// anything else is treated as a high-precision number
|
||||
return 'H'; // LCOV_EXCL_LINE
|
||||
}
|
||||
|
||||
@@ -1756,11 +1756,11 @@ class binary_writer
|
||||
template<typename NumberType>
|
||||
void write_number(const NumberType n, const bool OutputIsLittleEndian = false)
|
||||
{
|
||||
// step 1: write number to array of length NumberType
|
||||
// step 1: write the number to an array of length NumberType
|
||||
std::array<CharType, sizeof(NumberType)> vec{};
|
||||
std::memcpy(vec.data(), &n, sizeof(NumberType));
|
||||
|
||||
// step 2: write array to output (with possible reordering)
|
||||
// step 2: write the array to output (with possible reordering)
|
||||
if (is_little_endian != OutputIsLittleEndian)
|
||||
{
|
||||
// reverse byte order prior to conversion if necessary
|
||||
|
||||
@@ -75,7 +75,7 @@ class serializer
|
||||
, error_handler(error_handler_)
|
||||
{}
|
||||
|
||||
// delete because of pointer members
|
||||
// deleted because of pointer members
|
||||
serializer(const serializer&) = delete;
|
||||
serializer& operator=(const serializer&) = delete;
|
||||
serializer(serializer&&) = delete;
|
||||
@@ -573,7 +573,7 @@ class serializer
|
||||
break;
|
||||
}
|
||||
|
||||
default: // decode found yet incomplete multi-byte code point
|
||||
default: // decode found yet incomplete multibyte code point
|
||||
{
|
||||
if (!ensure_ascii)
|
||||
{
|
||||
@@ -827,7 +827,7 @@ class serializer
|
||||
|
||||
void dump_float(number_float_t x, std::false_type /*is_ieee_single_or_double*/)
|
||||
{
|
||||
// get number of digits for a float -> text -> float round-trip
|
||||
// get the number of digits for a float -> text -> float round-trip
|
||||
static constexpr auto d = std::numeric_limits<number_float_t>::max_digits10;
|
||||
|
||||
// the actual conversion
|
||||
@@ -836,10 +836,10 @@ class serializer
|
||||
|
||||
// negative value indicates an error
|
||||
JSON_ASSERT(len > 0);
|
||||
// check if buffer was large enough
|
||||
// check if the buffer was large enough
|
||||
JSON_ASSERT(static_cast<std::size_t>(len) < number_buffer.size());
|
||||
|
||||
// erase thousands separator
|
||||
// erase thousands separators
|
||||
if (thousands_sep != '\0')
|
||||
{
|
||||
// NOLINTNEXTLINE(readability-qualified-auto,llvm-qualified-auto): std::remove returns an iterator, see https://github.com/nlohmann/json/issues/3081
|
||||
@@ -947,8 +947,8 @@ class serializer
|
||||
* Helper function for dump_integer
|
||||
*
|
||||
* This function takes a negative signed integer and returns its absolute
|
||||
* value as unsigned integer. The plus/minus shuffling is necessary as we can
|
||||
* not directly remove the sign of an arbitrary signed integer as the
|
||||
* value as an unsigned integer. The plus/minus shuffling is necessary as we
|
||||
* cannot directly remove the sign of an arbitrary signed integer as the
|
||||
* absolute values of INT_MIN and INT_MAX are usually not the same. See
|
||||
* #1708 for details.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user