Skip to content

Commit

Permalink
Fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanel committed May 1, 2024
1 parent bb7cafc commit 7ef875b
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/api/common/src/binance-common-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#include "cachedresult.hpp"
#include "cct_json.hpp"
#include "cct_log.hpp"
#include "cct_string.hpp"
#include "curlhandle.hpp"
#include "curlpostdata.hpp"
#include "currencycode.hpp"
#include "currencycodeset.hpp"
#include "currencyexchange.hpp"
Expand Down
3 changes: 1 addition & 2 deletions src/api/common/src/exchangeprivateapi.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "exchangeprivateapi.hpp"

#include <algorithm>
#include <chrono>
#include <cstdint>
#include <iterator>
#include <limits>
Expand Down Expand Up @@ -391,7 +390,7 @@ MarketVector GetPossibleMarketsForDustThresholds(const BalancePortfolio &balance
}

private:
int weight(Market mk) const {
[[nodiscard]] int weight(Market mk) const {
// not present is equivalent to a weight of 0
const auto it = _penaltyPerMarketMap.find(mk);
return it == _penaltyPerMarketMap.end() ? 0 : it->second;
Expand Down
7 changes: 3 additions & 4 deletions src/api/exchanges/src/binanceprivateapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "apiquerytypeenum.hpp"
#include "balanceoptions.hpp"
#include "balanceportfolio.hpp"
#include "binance-common-api.hpp"
#include "binancepublicapi.hpp"
#include "cachedresult.hpp"
#include "cct_exception.hpp"
Expand Down Expand Up @@ -357,8 +358,7 @@ void FillOrders(const OrdersConstraints& ordersConstraints, const json& ordersAr
orderVector.emplace_back(std::move(id), matchedVolume, price, placedTime, matchedTime, side);
} else {
// Note: below ugly template lambda can be replaced with 'static_assert(false);' in C++23
[]<bool flag = false>() { static_assert(flag, "no match"); }
();
[]<bool flag = false>() { static_assert(flag, "no match"); }();
}
}
std::ranges::sort(orderVector);
Expand Down Expand Up @@ -820,8 +820,7 @@ ReceivedWithdrawInfo BinancePrivate::queryWithdrawDelivery(const InitiatedWithdr
json& depositEl = depositStatus[closestDepositPos];
const RecentDeposit recentDeposit = recentDepositFromJsonEl(depositEl);

return ReceivedWithdrawInfo(std::move(depositEl["id"].get_ref<string&>()), recentDeposit.amount(),
recentDeposit.timePoint());
return {std::move(depositEl["id"].get_ref<string&>()), recentDeposit.amount(), recentDeposit.timePoint()};
}

} // namespace cct::api
1 change: 0 additions & 1 deletion src/api/exchanges/src/binancepublicapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "market-vector.hpp"
#include "market.hpp"
#include "marketorderbook.hpp"
#include "monetary-amount-vector.hpp"
#include "monetaryamount.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "order-book-line.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/api/exchanges/src/huobiprivateapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "balanceportfolio.hpp"
#include "base64.hpp"
#include "cachedresult.hpp"
#include "cct_cctype.hpp"
#include "cct_exception.hpp"
#include "cct_json.hpp"
#include "cct_log.hpp"
Expand All @@ -38,6 +39,7 @@
#include "orderid.hpp"
#include "ordersconstraints.hpp"
#include "permanentcurloptions.hpp"
#include "query-retry-policy.hpp"
#include "request-retry.hpp"
#include "ssl_sha.hpp"
#include "stringhelpers.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/api/exchanges/src/krakenprivateapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "orderid.hpp"
#include "ordersconstraints.hpp"
#include "permanentcurloptions.hpp"
#include "query-retry-policy.hpp"
#include "request-retry.hpp"
#include "ssl_sha.hpp"
#include "stringhelpers.hpp"
Expand Down
5 changes: 2 additions & 3 deletions src/api/exchanges/src/krakenpublicapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "market.hpp"
#include "marketorderbook.hpp"
#include "monetaryamount.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "order-book-line.hpp"
#include "permanentcurloptions.hpp"
#include "public-trade-vector.hpp"
Expand Down Expand Up @@ -319,9 +318,9 @@ Market GetKrakenMarketOrDefault(const CurrencyExchangeFlatSet& currencies, Marke
const auto krakenBaseIt = currencies.find(mk.base());
const auto krakenQuoteIt = currencies.find(mk.quote());
if (krakenBaseIt != currencies.end() && krakenQuoteIt != currencies.end()) {
return Market(krakenBaseIt->altCode(), krakenQuoteIt->altCode());
return {krakenBaseIt->altCode(), krakenQuoteIt->altCode()};
}
return Market{};
return {};
}
} // namespace

Expand Down
1 change: 1 addition & 0 deletions src/objects/src/exchangeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "cct_string.hpp"
#include "currencycodevector.hpp"
#include "durationstring.hpp"
#include "http-config.hpp"
#include "monetaryamount.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "permanentcurloptions.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/objects/src/marketorderbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cassert>
#include <cmath>
#include <cstdint>
#include <iterator>
#include <limits>
#include <numeric>
#include <optional>
Expand Down
1 change: 1 addition & 0 deletions src/tech/test/stringhelpers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <cstdint>
#include <limits>
#include <string_view>

#include "cct_string.hpp"

Expand Down

0 comments on commit 7ef875b

Please sign in to comment.