Fix misc. minor sign-comparison warnings
authorJeff Garzik <jeff@garzik.org>
Sun, 15 Apr 2012 21:00:20 +0000 (17:00 -0400)
committerLuke Dashjr <luke-jr+git@utopios.org>
Tue, 17 Apr 2012 19:08:18 +0000 (15:08 -0400)
src/base58.h
src/crypter.cpp
src/key.h

index 592756f..fe19272 100644 (file)
@@ -255,7 +255,7 @@ public:
 
     bool IsValid() const
     {
-        int nExpectedSize = 20;
+        unsigned int nExpectedSize = 20;
         bool fExpectTestNet = false;
         switch(nVersion)
         {
index 5b7bfec..e821b08 100644 (file)
@@ -31,7 +31,7 @@ bool CCrypter::SetKeyFromPassphrase(const std::string& strKeyData, const std::ve
         i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0],
                           (unsigned char *)&strKeyData[0], strKeyData.size(), nRounds, chKey, chIV);
 
-    if (i != WALLET_CRYPTO_KEY_SIZE)
+    if (i != (int)WALLET_CRYPTO_KEY_SIZE)
     {
         memset(&chKey, 0, sizeof chKey);
         memset(&chIV, 0, sizeof chIV);
index 477f550..6bf7508 100644 (file)
--- a/src/key.h
+++ b/src/key.h
@@ -181,7 +181,7 @@ public:
 
     CPrivKey GetPrivKey() const
     {
-        unsigned int nSize = i2d_ECPrivateKey(pkey, NULL);
+        int nSize = i2d_ECPrivateKey(pkey, NULL);
         if (!nSize)
             throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey failed");
         CPrivKey vchPrivKey(nSize, 0);
@@ -202,7 +202,7 @@ public:
 
     std::vector<unsigned char> GetPubKey() const
     {
-        unsigned int nSize = i2o_ECPublicKey(pkey, NULL);
+        int nSize = i2o_ECPublicKey(pkey, NULL);
         if (!nSize)
             throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed");
         std::vector<unsigned char> vchPubKey(nSize, 0);