1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-17 06:42:21 +03:00

Migrate from astyle to clang-format (#8464)

This commit is contained in:
Maxim Prokhorov
2022-02-20 19:23:33 +03:00
committed by Max Prokhorov
parent 46190b61f1
commit 19b7a29720
241 changed files with 15925 additions and 16197 deletions

View File

@@ -33,28 +33,28 @@
#include <poll.h>
#include <map>
std::map<int,UdpContext*> udps;
std::map<int, UdpContext*> udps;
void register_udp (int sock, UdpContext* udp)
void register_udp(int sock, UdpContext* udp)
{
if (udp)
udps[sock] = udp;
else
udps.erase(sock);
if (udp)
udps[sock] = udp;
else
udps.erase(sock);
}
void check_incoming_udp ()
void check_incoming_udp()
{
// check incoming udp
for (auto& udp: udps)
{
pollfd p;
p.fd = udp.first;
p.events = POLLIN;
if (poll(&p, 1, 0) && p.revents == POLLIN)
{
mockverbose("UDP poll(%d) -> cb\r", p.fd);
udp.second->mock_cb();
}
}
// check incoming udp
for (auto& udp : udps)
{
pollfd p;
p.fd = udp.first;
p.events = POLLIN;
if (poll(&p, 1, 0) && p.revents == POLLIN)
{
mockverbose("UDP poll(%d) -> cb\r", p.fd);
udp.second->mock_cb();
}
}
}