From 1c69dcbd12c359d5708f4af9d627da97e59d8f0e Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 20 Oct 2025 09:08:07 +0200 Subject: json: Avoid ambigous calls to value() int == int32_t on this platform, and a uint32_t fits in both int64_t and uint64_t so be specific. --- src/json.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/json.cc') diff --git a/src/json.cc b/src/json.cc index cb9f0b8..46ea513 100644 --- a/src/json.cc +++ b/src/json.cc @@ -289,9 +289,10 @@ class StringWriter : public BaseWriter { void Writer::value(char const* value) { this->value(std::string_view(value)); } -void Writer::value(int value) { - static_assert(sizeof(int) <= sizeof(int64_t)); - this->value(static_cast(value)); +void Writer::value(int32_t value) { this->value(static_cast(value)); } + +void Writer::value(uint32_t value) { + this->value(static_cast(value)); } std::unique_ptr writer(std::string& out) { -- cgit v1.2.3-70-g09d2