From c376ac359ec8551823b4ee14c85d85a49f2d3436 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 15 Apr 2012 16:52:09 -0400 Subject: Fix loop index var types, fixing many minor sign comparison warnings foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness. --- src/netbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/netbase.cpp') diff --git a/src/netbase.cpp b/src/netbase.cpp index baf7c412a0..45fdca571f 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -136,7 +136,7 @@ bool Lookup(const char *pszName, std::vector& vAddr, int portDefault, if (!fRet) return false; vAddr.resize(vIP.size()); - for (int i = 0; i < vIP.size(); i++) + for (unsigned int i = 0; i < vIP.size(); i++) vAddr[i] = CService(vIP[i], port); return true; } -- cgit v1.2.3 From 3a78f82a783af22b82646365acc56d297a33e2b5 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 15 Apr 2012 16:58:32 -0400 Subject: Fix sign-compare warnings: netbase's Lookup* max-solutions may be unsigned --- src/netbase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/netbase.cpp') diff --git a/src/netbase.cpp b/src/netbase.cpp index 45fdca571f..8b30ffc140 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -22,7 +22,7 @@ int nConnectTimeout = 5000; static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; -bool static LookupIntern(const char *pszName, std::vector& vIP, int nMaxSolutions, bool fAllowLookup) +bool static LookupIntern(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions, bool fAllowLookup) { vIP.clear(); struct addrinfo aiHint; @@ -77,7 +77,7 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, int nM return (vIP.size() > 0); } -bool LookupHost(const char *pszName, std::vector& vIP, int nMaxSolutions, bool fAllowLookup) +bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions, bool fAllowLookup) { if (pszName[0] == 0) return false; @@ -93,12 +93,12 @@ bool LookupHost(const char *pszName, std::vector& vIP, int nMaxSolutio return LookupIntern(pszHost, vIP, nMaxSolutions, fAllowLookup); } -bool LookupHostNumeric(const char *pszName, std::vector& vIP, int nMaxSolutions) +bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions) { return LookupHost(pszName, vIP, nMaxSolutions, false); } -bool Lookup(const char *pszName, std::vector& vAddr, int portDefault, bool fAllowLookup, int nMaxSolutions) +bool Lookup(const char *pszName, std::vector& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions) { if (pszName[0] == 0) return false; -- cgit v1.2.3