summaryrefslogtreecommitdiff
path: root/toxcore/TCP_client.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-11-02 14:34:33 +0000
committeriphydf <iphydf@users.noreply.github.com>2016-11-02 18:50:41 +0000
commit96c672aef59ac785f3d351698311bb358820cc3c (patch)
treef862797a5a7f161a5ec727ca1d7df322a6d58c05 /toxcore/TCP_client.c
parente2d63e04979b59698b7e541f2aebb3c74495a2d3 (diff)
Compile as C++ for windows builds.
Compiling as C++ changes nothing semantically, but ensures that we don't break C++ compatibility while also retaining C compatibility. C++ compatibility is useful for tooling and additional diagnostics and analyses.
Diffstat (limited to 'toxcore/TCP_client.c')
-rw-r--r--toxcore/TCP_client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c
index ba8aeabe..caa1b73d 100644
--- a/toxcore/TCP_client.c
+++ b/toxcore/TCP_client.c
@@ -272,7 +272,7 @@ static int send_pending_data_nonpriority(TCP_Client_Connection *con)
272 } 272 }
273 273
274 uint16_t left = con->last_packet_length - con->last_packet_sent; 274 uint16_t left = con->last_packet_length - con->last_packet_sent;
275 int len = send(con->sock, con->last_packet + con->last_packet_sent, left, MSG_NOSIGNAL); 275 int len = send(con->sock, (const char *)(con->last_packet + con->last_packet_sent), left, MSG_NOSIGNAL);
276 276
277 if (len <= 0) { 277 if (len <= 0) {
278 return -1; 278 return -1;
@@ -302,7 +302,7 @@ static int send_pending_data(TCP_Client_Connection *con)
302 302
303 while (p) { 303 while (p) {
304 uint16_t left = p->size - p->sent; 304 uint16_t left = p->size - p->sent;
305 int len = send(con->sock, p->data + p->sent, left, MSG_NOSIGNAL); 305 int len = send(con->sock, (const char *)(p->data + p->sent), left, MSG_NOSIGNAL);
306 306
307 if (len != left) { 307 if (len != left) {
308 if (len > 0) { 308 if (len > 0) {
@@ -397,7 +397,7 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const
397 } 397 }
398 398
399 if (priority) { 399 if (priority) {
400 len = sendpriority ? send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL) : 0; 400 len = sendpriority ? send(con->sock, (const char *)packet, sizeof(packet), MSG_NOSIGNAL) : 0;
401 401
402 if (len <= 0) { 402 if (len <= 0) {
403 len = 0; 403 len = 0;
@@ -412,7 +412,7 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const
412 return add_priority(con, packet, sizeof(packet), len); 412 return add_priority(con, packet, sizeof(packet), len);
413 } 413 }
414 414
415 len = send(con->sock, packet, sizeof(packet), MSG_NOSIGNAL); 415 len = send(con->sock, (const char *)packet, sizeof(packet), MSG_NOSIGNAL);
416 416
417 if (len <= 0) { 417 if (len <= 0) {
418 return 0; 418 return 0;