diff options
author | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-08-12 07:04:30 -0400 |
---|---|---|
committer | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-08-14 13:28:06 -0400 |
commit | 21d281c4a953404c8f13e1cb7ee8d4cf9c25bb4c (patch) | |
tree | 2a4144fca78e6fc84efec7583297f6d8dcea9614 /drivers | |
parent | 9575dbdf788e8a5154b3ec2f66913e731ac02850 (diff) |
Use const reference where favorable
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.h | 2 | ||||
-rw-r--r-- | drivers/unix/tcp_server_posix.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/tcp_server_posix.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 74ceb3946a..3170b121b9 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -127,7 +127,7 @@ int PacketPeerUDPPosix::get_max_packet_size() const { return 512; // uhm maybe not } -Error PacketPeerUDPPosix::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) { +Error PacketPeerUDPPosix::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/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index a52b8b8e95..d8b08818b0 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.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/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index 865e9aa1d6..a8554d07a3 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -69,7 +69,7 @@ void TCPServerPosix::make_default() { TCP_Server::_create = TCPServerPosix::_create; }; -Error TCPServerPosix::listen(uint16_t p_port, const IP_Address p_bind_address) { +Error TCPServerPosix::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/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h index 659b389fe2..947050ab8a 100644 --- a/drivers/unix/tcp_server_posix.h +++ b/drivers/unix/tcp_server_posix.h @@ -41,7 +41,7 @@ class TCPServerPosix : public TCP_Server { static TCP_Server *_create(); public: - virtual Error listen(uint16_t p_port, 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(); |