Skip to content

Commit

Permalink
Fix clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Jul 10, 2024
1 parent 15b1418 commit 0decffc
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 29 deletions.
3 changes: 1 addition & 2 deletions include/xrpl/basics/MPTAmount.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ constexpr MPTAmount::MPTAmount(value_type value) : value_(value)
{
}

constexpr MPTAmount&
MPTAmount::operator=(beast::Zero)
constexpr MPTAmount& MPTAmount::operator=(beast::Zero)
{
value_ = 0;
return *this;
Expand Down
1 change: 0 additions & 1 deletion include/xrpl/protocol/SOTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <xrpl/protocol/SField.h>
#include <functional>
#include <initializer_list>
#include <cassert>
#include <memory>
#include <stdexcept>

Expand Down
2 changes: 1 addition & 1 deletion include/xrpl/protocol/STEitherAmount.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ concept ValidAmountType =
// Currency or MPT issuance ID
template <typename T>
concept ValidAssetType =
std::is_same_v<T, Currency> || std::is_same_v<T, uint192>;
std::is_same_v<T, Currency> || std::is_same_v<T, uint192>;

class STEitherAmount : public STBase, public CountedObject<STEitherAmount>
{
Expand Down
3 changes: 1 addition & 2 deletions src/libxrpl/protocol/STMPTAmount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ STMPTAmount::getText() const
return std::to_string(value_);
}

Json::Value
STMPTAmount::getJson(JsonOptions) const
Json::Value STMPTAmount::getJson(JsonOptions) const
{
Json::Value elem;
setJson(elem);
Expand Down
10 changes: 5 additions & 5 deletions src/test/jtx/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ namespace jtx {
// when we have moved to better compilers.
template <typename Input>
auto
make_vector(Input const& input)
requires requires(Input& v) {
std::begin(v);
std::end(v);
}
make_vector(Input const& input) requires requires(Input& v)
{
std::begin(v);
std::end(v);
}
{
return std::vector(std::begin(input), std::end(input));
}
Expand Down
16 changes: 7 additions & 9 deletions src/test/jtx/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct PrettyAmount<STAmount>
return amount_;
}

operator STAmount const&() const
operator STAmount const &() const
{
return amount_;
}
Expand Down Expand Up @@ -195,7 +195,7 @@ struct PrettyAmount<STMPTAmount>
return amount_;
}

operator STMPTAmount const&() const
operator STMPTAmount const &() const
{
return amount_;
}
Expand Down Expand Up @@ -351,8 +351,7 @@ struct XRP_t
/** @} */

/** Returns None-of-XRP */
None
operator()(none_t) const
None operator()(none_t) const
{
return {xrpIssue()};
}
Expand Down Expand Up @@ -475,8 +474,7 @@ class IOU
// STAmount operator()(char const* s) const;

/** Returns None-of-Issue */
None
operator()(none_t) const
None operator()(none_t) const
{
return {issue()};
}
Expand Down Expand Up @@ -528,9 +526,9 @@ class MPT
}

template <class T>
requires(sizeof(T) >= sizeof(int) && std::is_arithmetic_v<T>)
PrettyAmount<STMPTAmount>
operator()(T v) const
requires(sizeof(T) >= sizeof(int) && std::is_arithmetic_v<T>)
PrettyAmount<STMPTAmount>
operator()(T v) const
{
// VFALCO NOTE Should throw if the
// representation of v is not exact.
Expand Down
4 changes: 2 additions & 2 deletions src/test/jtx/impl/AMM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static IOUAmount
initialTokens(STAmount const& asset1, STAmount const& asset2)
{
auto const product = number(asset1) * number(asset2);
return (
IOUAmount)(product.mantissa() >= 0 ? root2(product) : root2(-product));
return (IOUAmount)(
product.mantissa() >= 0 ? root2(product) : root2(-product));
}

AMM::AMM(
Expand Down
3 changes: 1 addition & 2 deletions src/test/jtx/impl/amount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ operator<<(std::ostream&& os,

XRP_t const XRP{};

PrettyAmount<STAmount>
IOU::operator()(epsilon_t) const
PrettyAmount<STAmount> IOU::operator()(epsilon_t) const
{
return {STAmount(issue(), 1, -81), account.name()};
}
Expand Down
9 changes: 4 additions & 5 deletions src/xrpld/app/tx/detail/Payment.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ Payment::preflightHelper(PreflightContext const& ctx)
<< "Bad asset.";
return temBAD_CURRENCY;
}
if (account == uDstAccountID && sameAsset(uSrcCurrency, uDstCurrency) && !bPaths)
if (account == uDstAccountID && sameAsset(uSrcCurrency, uDstCurrency) &&
!bPaths)
{
// You're signing yourself a payment.
// If bPaths is true, you might be trying some arbitrage.
Expand Down Expand Up @@ -403,10 +404,8 @@ Payment::doApplyHelper()

AccountID const uDstAccountID(ctx_.tx.getAccountID(sfDestination));
auto const saDstAmount(get<TDel>(ctx_.tx.getFieldAmount(sfAmount)));
auto const maxSourceAmount = getMaxSourceAmount<TDel, TMax>(
saDstAmount,
sendMax,
account_);
auto const maxSourceAmount =
getMaxSourceAmount<TDel, TMax>(saDstAmount, sendMax, account_);

JLOG(j_.trace()) << "maxSourceAmount=" << maxSourceAmount.getFullText()
<< " saDstAmount=" << saDstAmount.getFullText();
Expand Down

0 comments on commit 0decffc

Please sign in to comment.