Skip to content

Commit 9d282f9

Browse files
committed
Fixed a few build warnings (size_t vs int).
1 parent 7f33d2f commit 9d282f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

chenclient/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool SendCommand(const std::string& server, int port, const std::string& command
135135
}
136136
else
137137
{
138-
send(sock, command.c_str(), command.length(), 0);
138+
send(sock, command.c_str(), static_cast<int>(command.length()), 0);
139139
send(sock, "\n", 1, 0);
140140

141141
while (true) // keep looping and reading blocks of memory until we find "\n" or hit an error.

chenserver/iftcp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ bool ChessCommandInterface_tcp::ReadLine(std::string& line, bool& keepRunning)
139139
if (StartsWith(line, HTTP_FIRST_LINE_PREFIX) && (http10 || http11))
140140
{
141141
// Decode the URI from the line and keep it.
142-
int offset = HTTP_FIRST_LINE_PREFIX.length();
143-
int extract = line.length() - (HTTP_FIRST_LINE_PREFIX.length() + HTTP_FIRST_LINE_SUFFIX_0.length());
142+
size_t offset = HTTP_FIRST_LINE_PREFIX.length();
143+
size_t extract = line.length() - (HTTP_FIRST_LINE_PREFIX.length() + HTTP_FIRST_LINE_SUFFIX_0.length());
144144
line = UrlDecode(line.substr(offset, extract));
145145
mode = MODE_HTTP; // remember to send an HTTP response back to the client in WriteLine()
146146
httpMinorVersion = http10 ? '0' : '1'; // remember which minor version to use in response

0 commit comments

Comments
 (0)