Skip to content

Commit

Permalink
Fix header warnings (Part 1)
Browse files Browse the repository at this point in the history
Armory has a *lot* of warnings in its C++ code (not including third-party code, which is typically not touched). Start the process of fixing the warnings, starting with header files (more annoying as they can occur over & over). Warnings fixed include but are not limited to: -Wreorder, -Wunused-parameter, -Wformat-nonliteral, and -Wsign-compare
  • Loading branch information
droark committed Jul 2, 2019
1 parent e7c3e5a commit 65a1187
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 130 deletions.
19 changes: 10 additions & 9 deletions cppForSwig/AsyncClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class ClientMessageError : public std::runtime_error
};

///////////////////////////////////////////////////////////////////////////////
template<class U> class ReturnMessage
template<class U>
class ReturnMessage
{
private:
U value_;
Expand Down Expand Up @@ -167,9 +168,9 @@ namespace AsyncClient
class LedgerDelegate
{
private:
std::shared_ptr<SocketPrototype> sock_;
std::string delegateID_;
std::string bdvID_;
std::shared_ptr<SocketPrototype> sock_;

public:
LedgerDelegate(void) {}
Expand All @@ -190,17 +191,17 @@ namespace AsyncClient
friend class ::WalletContainer;

private:
const std::shared_ptr<SocketPrototype> sock_;
const std::string bdvID_;
const std::string walletID_;
const BinaryData scrAddr_;
const int index_;
BinaryData addrHash_;
const std::shared_ptr<SocketPrototype> sock_;

const uint64_t fullBalance_;
const uint64_t spendableBalance_;
const uint64_t unconfirmedBalance_;
const uint32_t count_;
const int index_;

std::string comment_;

Expand Down Expand Up @@ -241,9 +242,9 @@ namespace AsyncClient
friend class ScrAddrObj;

protected:
const std::shared_ptr<SocketPrototype> sock_;
const std::string walletID_;
const std::string bdvID_;
const std::shared_ptr<SocketPrototype> sock_;

public:
BtcWallet(const BlockDataViewer&, const std::string&);
Expand Down Expand Up @@ -488,9 +489,9 @@ struct CallbackReturn_String : public CallbackReturn_WebSocket
struct CallbackReturn_LedgerDelegate : public CallbackReturn_WebSocket
{
private:
std::function<void(ReturnMessage<AsyncClient::LedgerDelegate>)> userCallbackLambda_;
std::shared_ptr<SocketPrototype> sockPtr_;
const std::string& bdvID_;
std::function<void(ReturnMessage<AsyncClient::LedgerDelegate>)> userCallbackLambda_;

public:
CallbackReturn_LedgerDelegate(
Expand All @@ -507,9 +508,9 @@ struct CallbackReturn_LedgerDelegate : public CallbackReturn_WebSocket
struct CallbackReturn_Tx : public CallbackReturn_WebSocket
{
private:
std::function<void(ReturnMessage<Tx>)> userCallbackLambda_;
std::shared_ptr<ClientCache> cache_;
BinaryData txHash_;
function<void(ReturnMessage<Tx>)> userCallbackLambda_;

public:
CallbackReturn_Tx(std::shared_ptr<ClientCache> cache,
Expand All @@ -525,10 +526,10 @@ struct CallbackReturn_Tx : public CallbackReturn_WebSocket
struct CallbackReturn_RawHeader : public CallbackReturn_WebSocket
{
private:
std::function<void(ReturnMessage<BinaryData>)> userCallbackLambda_;
std::shared_ptr<ClientCache> cache_;
BinaryData txHash_;
unsigned height_;
function<void(ReturnMessage<BinaryData>)> userCallbackLambda_;

public:
CallbackReturn_RawHeader(
Expand Down Expand Up @@ -744,8 +745,8 @@ struct CallbackReturn_Bool : public CallbackReturn_WebSocket
struct CallbackReturn_BlockHeader : public CallbackReturn_WebSocket
{
private:
std::function<void(ReturnMessage<ClientClasses::BlockHeader>)> userCallbackLambda_;
const unsigned height_;
std::function<void(ReturnMessage<ClientClasses::BlockHeader>)> userCallbackLambda_;

public:
CallbackReturn_BlockHeader(unsigned height,
Expand Down
6 changes: 3 additions & 3 deletions cppForSwig/BinaryData.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ class BinaryReader


/////////////////////////////////////////////////////////////////////////////
uint8_t get_uint8_t(ENDIAN e=LE)
uint8_t get_uint8_t()
{
uint8_t outVal = bdStr_[pos_];
pos_ += 1;
Expand Down Expand Up @@ -1134,7 +1134,7 @@ class BinaryRefReader


/////////////////////////////////////////////////////////////////////////////
uint8_t get_uint8_t(ENDIAN e=LE)
uint8_t get_uint8_t()
{
if (getSizeRemaining() < 1)
{
Expand Down Expand Up @@ -1443,7 +1443,7 @@ class BinaryWriter

/////////////////////////////////////////////////////////////////////////////
// These write data properly regardless of the architecture
void put_uint8_t (const uint8_t& val, ENDIAN e=LE) { theString_.append( val ); }
void put_uint8_t (const uint8_t& val) { theString_.append( val ); }

/////
void put_uint16_t(const uint16_t& val, ENDIAN e=LE)
Expand Down
Loading

0 comments on commit 65a1187

Please sign in to comment.