-
Notifications
You must be signed in to change notification settings - Fork 245
Description
Is your feature request related to a problem? Please describe.
Duplicate switch cases that could be consolidated:
osal/src/os/portable/os-impl-bsd-sockets.c
Lines 102 to 113 in ead5723
| switch (stream->socket_type) | |
| { | |
| case OS_SocketType_DATAGRAM: | |
| os_type = SOCK_DGRAM; | |
| break; | |
| case OS_SocketType_STREAM: | |
| os_type = SOCK_STREAM; | |
| break; | |
| default: | |
| return OS_ERR_NOT_IMPLEMENTED; | |
| } |
osal/src/os/portable/os-impl-bsd-sockets.c
Lines 129 to 138 in ead5723
| /* Only AF_INET* at this point, can add cases if support is expanded */ | |
| switch (stream->socket_type) | |
| { | |
| case OS_SocketType_DATAGRAM: | |
| os_proto = IPPROTO_UDP; | |
| break; | |
| case OS_SocketType_STREAM: | |
| os_proto = IPPROTO_TCP; | |
| break; | |
| } |
Describe the solution you'd like
Consolidate
Describe alternatives you've considered
Was separate if future domains were added... but is currently awkward looking.
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC, OSAL code review