aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-04-28 20:53:15 +0200
committersfan5 <sfan5@live.de>2022-04-30 16:49:41 +0200
commita89afe1229e327da3c397a3912b2d43d2196ea2b (patch)
tree037748c56e51da62b884d7b83dec9ccf5958e06c /src/network
parentfaecff570c48350c599bcf043a7004a52ddf1b39 (diff)
downloadminetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.tar.gz
minetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.tar.bz2
minetest-a89afe1229e327da3c397a3912b2d43d2196ea2b.zip
Deal with compiler warnings
Diffstat (limited to 'src/network')
-rw-r--r--src/network/connection.h2
-rw-r--r--src/network/socket.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/connection.h b/src/network/connection.h
index 88e323bb1..b5ae24882 100644
--- a/src/network/connection.h
+++ b/src/network/connection.h
@@ -194,7 +194,7 @@ struct BufferedPacket {
u16 getSeqnum() const;
- inline const size_t size() const { return m_data.size(); }
+ inline size_t size() const { return m_data.size(); }
u8 *data; // Direct memory access
float time = 0.0f; // Seconds from buffering the packet or re-sending
diff --git a/src/network/socket.cpp b/src/network/socket.cpp
index 0bb7ea234..97a5f19f7 100644
--- a/src/network/socket.cpp
+++ b/src/network/socket.cpp
@@ -231,7 +231,7 @@ void UDPSocket::Send(const Address &destination, const void *data, int size)
int sent;
if (m_addr_family == AF_INET6) {
- struct sockaddr_in6 address = {0};
+ struct sockaddr_in6 address = {};
address.sin6_family = AF_INET6;
address.sin6_addr = destination.getAddress6();
address.sin6_port = htons(destination.getPort());
@@ -239,7 +239,7 @@ void UDPSocket::Send(const Address &destination, const void *data, int size)
sent = sendto(m_handle, (const char *)data, size, 0,
(struct sockaddr *)&address, sizeof(struct sockaddr_in6));
} else {
- struct sockaddr_in address = {0};
+ struct sockaddr_in address = {};
address.sin_family = AF_INET;
address.sin_addr = destination.getAddress();
address.sin_port = htons(destination.getPort());