diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-06-26 15:08:25 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-06-26 15:08:25 +0200 |
commit | 4e5310cc60dc17e5ef09e57115ca8236544679e4 (patch) | |
tree | 894c5070a709198ed994db7c7d0c0e124abbc9e5 /drivers/unix | |
parent | 5c66771e3ebccdfec55bb94ea521d2f24cb6200a (diff) |
Some code changed with Clang-Tidy
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/dir_access_unix.cpp | 5 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 5 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.h | 2 |
3 files changed, 3 insertions, 9 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index e011176806..950979a78e 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -100,10 +100,7 @@ bool DirAccessUnix::dir_exists(String p_dir) { struct stat flags; bool success = (stat(p_dir.utf8().get_data(), &flags) == 0); - if (success && S_ISDIR(flags.st_mode)) - return true; - - return false; + return (success && S_ISDIR(flags.st_mode)); } uint64_t DirAccessUnix::get_modified_time(String p_file) { diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index fcd1c3be4b..a2df61ddaa 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -221,10 +221,7 @@ bool NetSocketPosix::_can_use_ip(const IP_Address p_ip, const bool p_for_bind) c } // Check if socket support this IP type. IP::Type type = p_ip.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; - if (_ip_type != IP::TYPE_ANY && !p_ip.is_wildcard() && _ip_type != type) { - return false; - } - return true; + return !(_ip_type != IP::TYPE_ANY && !p_ip.is_wildcard() && _ip_type != type); } void NetSocketPosix::_set_socket(SOCKET_TYPE p_sock, IP::Type p_ip_type, bool p_is_stream) { diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index b7fb3fdc94..dd7597eb6d 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -76,7 +76,7 @@ public: virtual void close(); virtual Error bind(IP_Address p_addr, uint16_t p_port); virtual Error listen(int p_max_pending); - virtual Error connect_to_host(IP_Address p_addr, uint16_t p_port); + virtual Error connect_to_host(IP_Address p_host, uint16_t p_port); virtual Error poll(PollType p_type, int timeout) const; virtual Error recv(uint8_t *p_buffer, int p_len, int &r_read); virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port); |