diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc index 2ee040a1..b22d9126 100644 --- a/src/HttpConnection.cc +++ b/src/HttpConnection.cc @@ -130,7 +130,7 @@ int HttpConnection::receiveResponse(HttpHeader& headers) { } // OK, i got all headers. logger->info(MSG_RECEIVE_RESPONSE, cuid, header.c_str()); - unsigned int p, np; + string::size_type p, np; p = np = 0; np = header.find("\r\n", p); if(np == string::npos) { diff --git a/src/Request.cc b/src/Request.cc index 51f454a6..b87cab1d 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -63,7 +63,7 @@ bool Request::parseUrl(string url) { if(url.find_first_not_of(SAFE_CHARS) != string::npos) { return false; } - unsigned int hp = url.find("://"); + string::size_type hp = url.find("://"); if(hp == string::npos) return false; protocol = url.substr(0, hp); int defPort; @@ -72,7 +72,7 @@ bool Request::parseUrl(string url) { } hp += 3; if(url.size() <= hp) return false; - unsigned int hep = url.find("/", hp); + string::size_type hep = url.find("/", hp); if(hep == string::npos) { hep = url.size(); } @@ -90,7 +90,7 @@ bool Request::parseUrl(string url) { // If port is not specified, then we leave it 0. port = defPort; } - unsigned int direp = url.find_last_of("/"); + string::size_type direp = url.find_last_of("/"); if(direp == string::npos || direp <= hep) { dir = "/"; direp = hep; diff --git a/src/Util.cc b/src/Util.cc index ace7d2d4..13258e41 100644 --- a/src/Util.cc +++ b/src/Util.cc @@ -54,8 +54,8 @@ string Util::llitos(long long int value, bool comma) } string Util::trim(string src) { - unsigned int sp = src.find_first_not_of(" "); - unsigned int ep = src.find_last_not_of(" "); + string::size_type sp = src.find_first_not_of(" "); + string::size_type ep = src.find_last_not_of(" "); if(sp == string::npos || ep == string::npos) { return ""; } else { @@ -66,7 +66,7 @@ string Util::trim(string src) { void Util::split(pair& hp, string src, char delim) { hp.first = ""; hp.second = ""; - unsigned int p = src.find(delim); + string::size_type p = src.find(delim); if(p == string::npos) { hp.first = src; hp.second = ""; @@ -93,9 +93,9 @@ long long int Util::difftv(struct timeval tv1, struct timeval tv2) { } void Util::slice(vector& result, string src, char delim) { - int p = 0; + string::size_type p = 0; while(1) { - unsigned int np = src.find(delim, p); + string::size_type np = src.find(delim, p); if(np == string::npos) { string term = trim(src.substr(p)); if(term.size() > 0) {