diff options
| author | iabdalkader <i.abdalkader@gmail.com> | 2021-09-14 21:21:09 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-09-15 11:29:02 +1000 |
| commit | d9749f90ad6aecbebffe09a9e252a81624750ceb (patch) | |
| tree | 88cd58937fa0459a69f8169c69bd413c8a56c33c /extmod/modnetwork.h | |
| parent | f9d573a4ace66b6b8991f304f4a895906fb4ad61 (diff) | |
extmod/modnetwork: Remove modnetwork socket u_state member.
To simplify the socket state.
The CC3K driver (see drivers/cc3000/inc/socket.h and src/socket.c) has
socket() returning an INT16 so there is now enough room to store it
directly in the fileno member.
Diffstat (limited to 'extmod/modnetwork.h')
| -rw-r--r-- | extmod/modnetwork.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/extmod/modnetwork.h b/extmod/modnetwork.h index 39e4d06d6..bbf80bc47 100644 --- a/extmod/modnetwork.h +++ b/extmod/modnetwork.h @@ -72,15 +72,11 @@ typedef struct _mod_network_socket_obj_t { mp_obj_base_t base; mp_obj_t nic; mod_network_nic_type_t *nic_type; - union { - struct { - uint8_t domain; - uint8_t type; - int8_t fileno; - uint8_t bound; - } u_param; - mp_uint_t u_state; - }; + uint32_t domain : 5; + uint32_t type : 5; + uint32_t proto : 5; + uint32_t bound : 1; + int32_t fileno : 16; #if MICROPY_PY_USOCKET_EXTENDED_STATE // Extended socket state for NICs/ports that need it. int32_t timeout; |
