diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-16 16:41:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-16 16:41:35 +0200 |
commit | a8207b2dc7bebafd266f95371cc9707425110eba (patch) | |
tree | 79f52c0f21e8b1300165361c86055cc359f6b0e4 /platform/windows | |
parent | 970cbb460899ec68df7596f06b64bb5be81cea1c (diff) | |
parent | 21d281c4a953404c8f13e1cb7ee8d4cf9c25bb4c (diff) |
Merge pull request #10264 from Rubonnek/use-const-reference
Use const reference where favorable
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/packet_peer_udp_winsock.cpp | 2 | ||||
-rw-r--r-- | platform/windows/packet_peer_udp_winsock.h | 2 | ||||
-rw-r--r-- | platform/windows/tcp_server_winsock.cpp | 2 | ||||
-rw-r--r-- | platform/windows/tcp_server_winsock.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index f3b91c1b56..3991a90423 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -118,7 +118,7 @@ void PacketPeerUDPWinsock::_set_sock_blocking(bool p_blocking) { }; } -Error PacketPeerUDPWinsock::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) { +Error PacketPeerUDPWinsock::listen(int p_port, const IP_Address &p_bind_address, int p_recv_buffer_size) { ERR_FAIL_COND_V(sockfd != -1, ERR_ALREADY_IN_USE); ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(), ERR_INVALID_PARAMETER); diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index ceb6df71aa..01f2e5113f 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -67,7 +67,7 @@ public: virtual int get_max_packet_size() const; - virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536); + virtual Error listen(int p_port, const IP_Address &p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp index 3292813d4e..cc17c8a631 100644 --- a/platform/windows/tcp_server_winsock.cpp +++ b/platform/windows/tcp_server_winsock.cpp @@ -63,7 +63,7 @@ void TCPServerWinsock::cleanup() { }; }; -Error TCPServerWinsock::listen(uint16_t p_port, const IP_Address p_bind_address) { +Error TCPServerWinsock::listen(uint16_t p_port, const IP_Address &p_bind_address) { ERR_FAIL_COND_V(listen_sockfd != -1, ERR_ALREADY_IN_USE); ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(), ERR_INVALID_PARAMETER); diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h index 7e5d1e750e..077acb94d7 100644 --- a/platform/windows/tcp_server_winsock.h +++ b/platform/windows/tcp_server_winsock.h @@ -40,7 +40,7 @@ class TCPServerWinsock : public TCP_Server { static TCP_Server *_create(); public: - virtual Error listen(uint16_t p_port, const IP_Address p_bind_address = IP_Address("*")); + virtual Error listen(uint16_t p_port, const IP_Address &p_bind_address = IP_Address("*")); virtual bool is_connection_available() const; virtual Ref<StreamPeerTCP> take_connection(); |