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 /platform | |
parent | 9575dbdf788e8a5154b3ec2f66913e731ac02850 (diff) |
Use const reference where favorable
Diffstat (limited to 'platform')
-rw-r--r-- | platform/uwp/export/export.cpp | 4 | ||||
-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 |
5 files changed, 6 insertions, 6 deletions
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a1aa58a5e7..39717196aa 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -171,7 +171,7 @@ class AppxPackager { } Vector<uint8_t> make_file_header(FileMeta p_file_meta); - void store_central_dir_header(const FileMeta p_file, bool p_do_hash = true); + void store_central_dir_header(const FileMeta &p_file, bool p_do_hash = true); Vector<uint8_t> make_end_of_central_record(); String content_type(String p_extension); @@ -329,7 +329,7 @@ Vector<uint8_t> AppxPackager::make_file_header(FileMeta p_file_meta) { return buf; } -void AppxPackager::store_central_dir_header(const FileMeta p_file, bool p_do_hash) { +void AppxPackager::store_central_dir_header(const FileMeta &p_file, bool p_do_hash) { Vector<uint8_t> &buf = central_dir_data; int offs = buf.size(); 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(); |