Skip to content

Commit

Permalink
[Code refactoring] - Clean-up clang tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanel committed Apr 22, 2024
1 parent 634b7db commit b184a6d
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Checks: "-*,\
-misc-const-correctness,\
modernize-*,\
-modernize-avoid-c-arrays,\
-modernize-use-designated-initializers,\
-modernize-use-trailing-return-type,\
performance-*,\
portability-*,\
Expand Down
1 change: 1 addition & 0 deletions src/api-objects/src/recentdeposit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <algorithm>
#include <chrono>
#include <memory>
#include <utility>

#include "cct_log.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/api/common/include/commonapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "currencycodevector.hpp"
#include "exchangebase.hpp"
#include "monetaryamount.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "timedef.hpp"
#include "withdrawalfees-crawler.hpp"

Expand Down
8 changes: 8 additions & 0 deletions src/api/common/src/binance-common-api.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#include "binance-common-api.hpp"

#include <algorithm>
#include <iterator>
#include <mutex>
#include <string_view>
#include <utility>

#include "abstractmetricgateway.hpp"
#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"
#include "currencyexchangeflatset.hpp"
#include "httprequesttype.hpp"
#include "monetary-amount-vector.hpp"
#include "monetaryamount.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "permanentcurloptions.hpp"
#include "request-retry.hpp"
#include "runmodes.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/api/common/src/commonapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <cstdint>
#include <mutex>
#include <optional>
#include <string_view>
#include <utility>

Expand All @@ -13,8 +14,10 @@
#include "curloptions.hpp"
#include "currencycode.hpp"
#include "currencycodeset.hpp"
#include "currencycodevector.hpp"
#include "file.hpp"
#include "httprequesttype.hpp"
#include "monetaryamountbycurrencyset.hpp"
#include "permanentcurloptions.hpp"
#include "timedef.hpp"
#include "withdrawalfees-crawler.hpp"
Expand Down
4 changes: 3 additions & 1 deletion src/api/common/src/exchangeprivateapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <iterator>
#include <limits>
#include <map>
#include <optional>
Expand Down Expand Up @@ -43,6 +44,7 @@
#include "tradeoptions.hpp"
#include "tradeside.hpp"
#include "unreachable.hpp"
#include "wallet.hpp"
#include "withdraw.hpp"
#include "withdrawinfo.hpp"
#include "withdrawoptions.hpp"
Expand Down Expand Up @@ -609,7 +611,7 @@ ReceivedWithdrawInfo ExchangePrivate::queryWithdrawDelivery(
return {};
}
const Deposit &deposit = deposits[closestDepositPos];
return ReceivedWithdrawInfo(string(deposit.id()), deposit.amount(), deposit.time());
return {string(deposit.id()), deposit.amount(), deposit.time()};
}

SentWithdrawInfo ExchangePrivate::isWithdrawSuccessfullySent(const InitiatedWithdrawInfo &initiatedWithdrawInfo) {
Expand Down
2 changes: 2 additions & 0 deletions src/api/common/src/ssl_sha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <openssl/sha.h>

#include <algorithm>
#include <array>
#include <cstddef>
#include <memory>
#include <span>
#include <string_view>
Expand Down
1 change: 0 additions & 1 deletion src/engine/src/exchangesorchestrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "cct_smallvector.hpp"
#include "cct_string.hpp"
#include "cct_type_traits.hpp"
#include "commonapi.hpp"
#include "currencycode.hpp"
#include "currencycodeset.hpp"
#include "currencyexchangeflatset.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/http-request/src/besturlpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <cstdint>
#include <limits>
#include <numeric>
#include <span>
#include <string_view>

#include "cct_log.hpp"
#include "mathhelpers.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/objects/src/monetaryamount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ inline auto AmountIntegralFromStr(std::string_view amountStr, bool heuristicRoun
integerPart = 0;
} else {
integerPart =
FromString<MonetaryAmount::AmountType>(std::string_view(amountStr.data(), amountStr.data() + dotPos));
FromString<MonetaryAmount::AmountType>(std::string_view(amountStr.begin(), amountStr.begin() + dotPos));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/tech/test/cachedresult_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <chrono>
#include <thread>
#include <tuple>

#include "cachedresultvault.hpp"
#include "timedef.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/tech/test/url-encode_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <gtest/gtest.h>

#include <string_view>

#include "cct_cctype.hpp"

namespace cct {
Expand Down

0 comments on commit b184a6d

Please sign in to comment.