Skip to content

Commit

Permalink
Silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardHinnant committed Sep 15, 2022
1 parent d2d1e87 commit f099878
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/ripple/basics/Number.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <ripple/basics/XRPAmount.h>
#include <cstdint>
#include <limits>
#include <ostream>
#include <string>

Expand Down
8 changes: 5 additions & 3 deletions src/ripple/basics/impl/Number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Number::Guard::round() noexcept
auto mode = Number::getround();
switch (mode)
{
// round to nearest if mode is not one of the predefined values
default:
case to_nearest:
if (digits_ > 0x5000'0000'0000'0000)
return 1;
Expand Down Expand Up @@ -506,8 +508,8 @@ to_string(Number const& amount)

assert(exponent + 43 > 0);

size_t const pad_prefix = 27;
size_t const pad_suffix = 23;
ptrdiff_t const pad_prefix = 27;
ptrdiff_t const pad_suffix = 23;

std::string const raw_value(std::to_string(mantissa));
std::string val;
Expand All @@ -517,7 +519,7 @@ to_string(Number const& amount)
val.append(raw_value);
val.append(pad_suffix, '0');

size_t const offset(exponent + 43);
ptrdiff_t const offset(exponent + 43);

auto pre_from(val.begin());
auto const pre_to(val.begin() + offset);
Expand Down

0 comments on commit f099878

Please sign in to comment.