Skip to content

Commit 1a179e8

Browse files
committed
Fixed some warnings from code
1 parent 3f5a075 commit 1a179e8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/SocketAdapterTls.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace HttpServer
5555

5656
while (total < length)
5757
{
58-
::gnutls_record_set_timeout(this->session, timeout.count() );
58+
::gnutls_record_set_timeout(this->session, static_cast<unsigned int>(timeout.count() ) );
5959

6060
if (record_size > length - total)
6161
{
@@ -92,7 +92,7 @@ namespace HttpServer
9292

9393
long SocketAdapterTls::nonblock_recv(std::vector<std::string::value_type> &buf, const std::chrono::milliseconds &timeout) const
9494
{
95-
::gnutls_record_set_timeout(this->session, timeout.count() );
95+
::gnutls_record_set_timeout(this->session, static_cast<unsigned int>(timeout.count() ) );
9696
return ::gnutls_record_recv(this->session, buf.data(), buf.size() );
9797
}
9898

src/System.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#ifdef WIN32
44
#include <WS2tcpip.h>
55
#include <Windows.h>
6+
#undef min
7+
#undef max
8+
69
::TCHAR myWndClassName[];
710

811
#ifdef SIGTERM

src/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ namespace Utils
280280

281281
// Parse RFC 822
282282
#ifdef WIN32
283-
if (~0 != ::sscanf_s(strTime.c_str(), "%*s %d %3s %d %d:%d:%d", &tc.tm_mday, s_mon.data(), s_mon.size(), &tc.tm_year, &tc.tm_hour, &tc.tm_min, &tc.tm_sec) )
283+
if (~0 != ::sscanf_s(strTime.c_str(), "%*s %d %3s %d %d:%d:%d", &tc.tm_mday, s_mon.data(), static_cast<unsigned int>(s_mon.size() ), &tc.tm_year, &tc.tm_hour, &tc.tm_min, &tc.tm_sec) )
284284
#else
285285
if (~0 != ::sscanf(strTime.c_str(), "%*s %d %3s %d %d:%d:%d", &tc.tm_mday, s_mon.data(), &tc.tm_year, &tc.tm_hour, &tc.tm_min, &tc.tm_sec) )
286286
#endif

0 commit comments

Comments
 (0)