From f8db8a3faa30b71dca33ced38be16d3f93f43e8a Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Sun, 19 Mar 2017 00:36:26 +0100 Subject: Bring that Whole New World to the Old Continent too Applies the clang-format style to the 2.1 branch as done for master in 5dbf1809c6e3e905b94b8764e99491e608122261. --- drivers/unix/tcp_server_posix.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'drivers/unix/tcp_server_posix.cpp') diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index 0178f08b8..cdd451062 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -33,32 +33,32 @@ #include +#include +#include #include #include -#include -#include #include -#include #include +#include #ifndef NO_FCNTL - #ifdef __HAIKU__ - #include - #else - #include - #endif +#ifdef __HAIKU__ +#include +#else +#include +#endif #else #include #endif #ifdef JAVASCRIPT_ENABLED #include #endif +#include #include #include -#include #include "drivers/unix/socket_helpers.h" -TCP_Server* TCPServerPosix::_create() { +TCP_Server *TCPServerPosix::_create() { return memnew(TCPServerPosix); }; @@ -68,7 +68,7 @@ void TCPServerPosix::make_default() { TCP_Server::_create = TCPServerPosix::_create; }; -Error TCPServerPosix::listen(uint16_t p_port,const List *p_accepted_hosts) { +Error TCPServerPosix::listen(uint16_t p_port, const List *p_accepted_hosts) { int sockfd; sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); @@ -82,8 +82,8 @@ Error TCPServerPosix::listen(uint16_t p_port,const List *p_accepted_host ioctl(sockfd, FIONBIO, &bval); #endif - int reuse=1; - if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0) { + int reuse = 1; + if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0) { WARN_PRINT("REUSEADDR failed!") } @@ -99,8 +99,7 @@ Error TCPServerPosix::listen(uint16_t p_port,const List *p_accepted_host close(sockfd); ERR_FAIL_V(FAILED); }; - } - else { + } else { return ERR_ALREADY_IN_USE; }; @@ -166,13 +165,12 @@ void TCPServerPosix::stop() { if (listen_sockfd != -1) { int ret = close(listen_sockfd); - ERR_FAIL_COND(ret!=0); + ERR_FAIL_COND(ret != 0); }; listen_sockfd = -1; }; - TCPServerPosix::TCPServerPosix() { listen_sockfd = -1; -- cgit v1.2.3-70-g09d2