Skip to content

Commit 4fd2de2

Browse files
committed
Fix build error
Signed-off-by: JCW <[email protected]>
1 parent 37efb02 commit 4fd2de2

File tree

1 file changed

+16
-27
lines changed

1 file changed

+16
-27
lines changed

include/xrpl/beast/utility/Journal.h

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@ class SimpleJsonWriter
128128
buffer_.append("\","sv);
129129
}
130130
std::string_view
131-
writeInt(std::int8_t val) const
132-
{
133-
return pushNumber(val, buffer_);
134-
}
135-
std::string_view
136-
writeInt(std::int16_t val) const
137-
{
138-
return pushNumber(val, buffer_);
139-
}
140-
std::string_view
141131
writeInt(std::int32_t val) const
142132
{
143133
return pushNumber(val, buffer_);
@@ -148,21 +138,6 @@ class SimpleJsonWriter
148138
return pushNumber(val, buffer_);
149139
}
150140
std::string_view
151-
writeUInt(std::size_t val) const
152-
{
153-
return pushNumber(val, buffer_);
154-
}
155-
std::string_view
156-
writeUInt(std::uint8_t val) const
157-
{
158-
return pushNumber(val, buffer_);
159-
}
160-
std::string_view
161-
writeUInt(std::uint16_t val) const
162-
{
163-
return pushNumber(val, buffer_);
164-
}
165-
std::string_view
166141
writeUInt(std::uint32_t val) const
167142
{
168143
return pushNumber(val, buffer_);
@@ -919,11 +894,25 @@ setJsonValue(
919894
std::string_view sv;
920895
if constexpr (std::is_signed_v<ValueType>)
921896
{
922-
sv = writer.writeInt(value);
897+
if constexpr (sizeof(ValueType) > 4)
898+
{
899+
sv = writer.writeInt(static_cast<std::int64_t>(value));
900+
}
901+
else
902+
{
903+
sv = writer.writeInt(static_cast<std::int32_t>(value));
904+
}
923905
}
924906
else
925907
{
926-
sv = writer.writeUInt(value);
908+
if constexpr (sizeof(ValueType) > 4)
909+
{
910+
sv = writer.writeUInt(static_cast<std::uint64_t>(value));
911+
}
912+
else
913+
{
914+
sv = writer.writeUInt(static_cast<std::uint32_t>(value));
915+
}
927916
}
928917
if (outStream)
929918
{

0 commit comments

Comments
 (0)