8000 extmod/modlwip: Codestyle: no need for () when taking address of prim… · micropython/micropython@858ed6d · GitHub
[go: up one dir, main page]

Skip to content

Commit 858ed6d

Browse files
author
Paul Sokolovsky
committed
extmod/modlwip: Codestyle: no need for () when taking address of primary expr.
Like foo.bar or foo->bar.
1 parent fa87e90 commit 858ed6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extmod/modlwip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ STATIC mp_obj_t lwip_slip_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t
116116
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "not a valid remote IP"));
117117
}
118118

119-
struct netif *n = &(lwip_slip_obj.lwip_netif);
119+
struct netif *n = &lwip_slip_obj.lwip_netif;
120120
if (netif_add(n, &iplocal, IP_ADDR_BROADCAST, &ipremote, NULL, slipif_init, ip_input) == NULL) {
121121
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "out of memory"));
122122
}
@@ -214,7 +214,7 @@ STATIC void _lwip_udp_incoming(void *arg, struct udp_pcb *upcb, struct pbuf *p,
214214
} else {
215215
socket->incoming = (void*)p;
216216
socket->peer_port = (mp_uint_t)port;
217-
memcpy(&(socket->peer), addr, 4);
217+
memcpy(&socket->peer, addr, 4);
218218
}
219219
}
220220

@@ -339,7 +339,7 @@ STATIC mp_uint_t lwip_udp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
339339
}
340340

341341
if (ip != NULL) {
342-
memcpy(ip, &(socket->peer), 4);
342+
memcpy(ip, &socket->peer, 4);
343343
*port = socket->peer_port;
344344
}
345345

@@ -815,7 +815,7 @@ STATIC mp_obj_t lwip_socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) {
815815
mp_uint_t ret = 0;
816816
switch (socket->type) {
817817
case MOD_NETWORK_SOCK_STREAM: {
818-
memcpy(ip, &(socket->peer), 4);
818+
memcpy(ip, &socket->peer, 4);
819819
port = (mp_uint_t) socket->peer_port;
820820
ret = lwip_tcp_receive(socket, (byte*)vstr.buf, len, &_errno);
821821
break;

0 commit comments

Comments
 (0)
0