clang-format

This commit is contained in:
gabime
2021-11-16 23:44:35 +02:00
parent 1756c5d37f
commit dc030ec53c
29 changed files with 184 additions and 167 deletions

View File

@@ -31,7 +31,6 @@ class udp_client
int socket_ = -1;
struct sockaddr_in sockAddr_;
void cleanup_()
{
if (socket_ != -1)
@@ -59,8 +58,9 @@ public:
sockAddr_.sin_family = AF_INET;
sockAddr_.sin_port = htons(port);
if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0) {
if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0)
{
cleanup_();
throw_spdlog_ex("error: Invalid address!");
}
@@ -85,7 +85,7 @@ public:
ssize_t toslen = 0;
socklen_t tolen = sizeof(struct sockaddr);
if ((toslen = ::sendto(socket_, data, n_bytes, 0, (struct sockaddr *)&sockAddr_, tolen)) == -1)
{
{
throw_spdlog_ex("sendto(2) failed", errno);
}
}