summaryrefslogtreecommitdiff
path: root/core/io/packet_peer_udp.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /core/io/packet_peer_udp.cpp
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
Diffstat (limited to 'core/io/packet_peer_udp.cpp')
-rw-r--r--core/io/packet_peer_udp.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index c4a6fd79a8..46accf420a 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -29,40 +29,38 @@
#include "packet_peer_udp.h"
#include "io/ip.h"
-PacketPeerUDP* (*PacketPeerUDP::_create)()=NULL;
+PacketPeerUDP *(*PacketPeerUDP::_create)() = NULL;
String PacketPeerUDP::_get_packet_ip() const {
return get_packet_address();
}
-Error PacketPeerUDP::_set_dest_address(const String& p_address, int p_port) {
+Error PacketPeerUDP::_set_dest_address(const String &p_address, int p_port) {
IP_Address ip;
if (p_address.is_valid_ip_address()) {
- ip=p_address;
+ ip = p_address;
} else {
- ip=IP::get_singleton()->resolve_hostname(p_address);
+ ip = IP::get_singleton()->resolve_hostname(p_address);
if (!ip.is_valid())
return ERR_CANT_RESOLVE;
}
- set_dest_address(ip,p_port);
+ set_dest_address(ip, p_port);
return OK;
}
void PacketPeerUDP::_bind_methods() {
- ClassDB::bind_method(D_METHOD("listen:Error","port", "bind_address", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL("*"),DEFVAL(65536));
- ClassDB::bind_method(D_METHOD("close"),&PacketPeerUDP::close);
- ClassDB::bind_method(D_METHOD("wait:Error"),&PacketPeerUDP::wait);
- ClassDB::bind_method(D_METHOD("is_listening"),&PacketPeerUDP::is_listening);
- ClassDB::bind_method(D_METHOD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip);
+ ClassDB::bind_method(D_METHOD("listen:Error", "port", "bind_address", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL("*"), DEFVAL(65536));
+ ClassDB::bind_method(D_METHOD("close"), &PacketPeerUDP::close);
+ ClassDB::bind_method(D_METHOD("wait:Error"), &PacketPeerUDP::wait);
+ ClassDB::bind_method(D_METHOD("is_listening"), &PacketPeerUDP::is_listening);
+ ClassDB::bind_method(D_METHOD("get_packet_ip"), &PacketPeerUDP::_get_packet_ip);
//ClassDB::bind_method(D_METHOD("get_packet_address"),&PacketPeerUDP::_get_packet_address);
- ClassDB::bind_method(D_METHOD("get_packet_port"),&PacketPeerUDP::get_packet_port);
- ClassDB::bind_method(D_METHOD("set_dest_address","host","port"),&PacketPeerUDP::_set_dest_address);
-
-
+ ClassDB::bind_method(D_METHOD("get_packet_port"), &PacketPeerUDP::get_packet_port);
+ ClassDB::bind_method(D_METHOD("set_dest_address", "host", "port"), &PacketPeerUDP::_set_dest_address);
}
Ref<PacketPeerUDP> PacketPeerUDP::create_ref() {
@@ -72,14 +70,12 @@ Ref<PacketPeerUDP> PacketPeerUDP::create_ref() {
return Ref<PacketPeerUDP>(_create());
}
-PacketPeerUDP* PacketPeerUDP::create() {
+PacketPeerUDP *PacketPeerUDP::create() {
if (!_create)
return NULL;
return _create();
}
-PacketPeerUDP::PacketPeerUDP()
-{
-
+PacketPeerUDP::PacketPeerUDP() {
}