Skip to content

Commit 4f607a5

Browse files
committed
Fix type comparisons
1 parent b274f25 commit 4f607a5

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/http_request.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bool HttpRequest::parse_uri()
2323
BOOST_FOREACH(const std::string & pair_string, pair_strings)
2424
{
2525
std::vector<std::string> pair_data;
26-
const int eq_index = pair_string.find_first_of('=');
26+
const size_t eq_index = pair_string.find_first_of('=');
2727
if (eq_index == std::string::npos)
2828
{
2929
if (pair_string.size() > 0)

src/http_request_handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void HttpRequestHandlerGroup::addHandler(HandlerPredicate predicate, HttpServerR
4545

4646
bool HttpRequestHandlerGroup::operator()(const HttpRequest &request, boost::shared_ptr<HttpConnection> connection, const char* begin, const char* end)
4747
{
48-
for (int i = 0; i < handlers_.size(); ++i)
48+
for (size_t i = 0; i < handlers_.size(); ++i)
4949
{
5050
std::pair<HandlerPredicate, HttpServerRequestHandler> &handler = handlers_[i];
5151
if (handler.first(request))
@@ -87,7 +87,7 @@ class BodyCollectingConnection : public boost::enable_shared_from_this<BodyColle
8787
std::string chunk(begin, end-begin);
8888
body_stream_ << chunk;
8989
received_length_ += chunk.length();
90-
if(received_length_ >= length_) {
90+
if(received_length_ >= size_t(length_)) {
9191
handler_(request_, connection_, body_stream_.str().substr(0, length_));
9292
}
9393
else {

src/websocket_message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ boost::tribool WebsocketFrameParser::consume(WebsocketFrame& frame, char input)
194194
//unmask the frame
195195
if (frame.header.mask)
196196
{
197-
for (int i = 0; i < frame.length; ++i)
197+
for (uint64_t i = 0; i < frame.length; ++i)
198198
{
199199
frame.content[i] = frame.content[i] ^ frame.mask[i % 4];
200200
}

0 commit comments

Comments
 (0)