From 7314faaba488ab148655fb38a8193bdb5ec8d129 Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Fri, 15 Sep 2023 22:03:01 +0300 Subject: [PATCH] nuttx/net/ip: fix nxstyle issues in macro Signed-off-by: Petro Karashchenko --- include/nuttx/net/ip.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/include/nuttx/net/ip.h b/include/nuttx/net/ip.h index b7c7fd1ec3..24c5b48a65 100644 --- a/include/nuttx/net/ip.h +++ b/include/nuttx/net/ip.h @@ -279,10 +279,12 @@ extern "C" ****************************************************************************/ #define net_ipaddr(addr, addr0, addr1, addr2, addr3) \ - do { \ - addr = HTONL((uint32_t)(addr0) << 24 | (uint32_t)(addr1) << 16 | \ - (uint32_t)(addr2) << 8 | (uint32_t)(addr3)); \ - } while (0) + do \ + { \ + addr = HTONL((uint32_t)(addr0) << 24 | (uint32_t)(addr1) << 16 | \ + (uint32_t)(addr2) << 8 | (uint32_t)(addr3)); \ + } \ + while (0) /**************************************************************************** * Macro: net_ip4addr_conv32 @@ -336,16 +338,18 @@ extern "C" ****************************************************************************/ #define ip6_addr(addr,addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) \ - do { \ - ((FAR uint16_t *)(addr))[0] = HTONS((addr0)); \ - ((FAR uint16_t *)(addr))[1] = HTONS((addr1)); \ - ((FAR uint16_t *)(addr))[2] = HTONS((addr2)); \ - ((FAR uint16_t *)(addr))[3] = HTONS((addr3)); \ - ((FAR uint16_t *)(addr))[4] = HTONS((addr4)); \ - ((FAR uint16_t *)(addr))[5] = HTONS((addr5)); \ - ((FAR uint16_t *)(addr))[6] = HTONS((addr6)); \ - ((FAR uint16_t *)(addr))[7] = HTONS((addr7)); \ - } while (0) + do \ + { \ + ((FAR uint16_t *)(addr))[0] = HTONS((addr0)); \ + ((FAR uint16_t *)(addr))[1] = HTONS((addr1)); \ + ((FAR uint16_t *)(addr))[2] = HTONS((addr2)); \ + ((FAR uint16_t *)(addr))[3] = HTONS((addr3)); \ + ((FAR uint16_t *)(addr))[4] = HTONS((addr4)); \ + ((FAR uint16_t *)(addr))[5] = HTONS((addr5)); \ + ((FAR uint16_t *)(addr))[6] = HTONS((addr6)); \ + ((FAR uint16_t *)(addr))[7] = HTONS((addr7)); \ + } \ + while (0) /**************************************************************************** * Macro: ip6_map_ipv4addr