Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba3b3f3

Browse files
committed
GCC warning on signed/unsigned comparison fixed
1 parent15ece5a commitba3b3f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎libs/network/example/http/fileserver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include<sys/fcntl.h>
1313
#include<unistd.h>
1414
#include<iostream>
15+
#include<cassert>
1516

1617
namespacehttp= boost::network::http;
1718
namespaceutils= boost::network::utils;
@@ -142,7 +143,8 @@ struct connection_handler : boost::enable_shared_from_this<connection_handler> {
142143
voidhandle_chunk(std::pair<void *, std::size_t> mmaped_region,off_t offset,
143144
server::connection_ptr connection,
144145
boost::system::error_codeconst &ec) {
145-
if (!ec && offset < mmaped_region.second)
146+
assert(offset>=0);
147+
if (!ec &&static_cast<std::size_t>(offset) < mmaped_region.second)
146148
send_file(mmaped_region, offset, connection);
147149
}
148150

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp