code issues found by Clang with
CFLAGS="-Os -Wall -Wextra -Werror=unused-const-variable -Wno-error=unused-parameter"
enabled
The details as follows:
- variable initialization issue, modified them as Clang suggested
- data type mismatch when comparing, fix them either by casting or changing
the data type of index of iterator
- get_sockaddr() in netutils may return -1 thus changed returning type from
size_t to ssize_t, which makes Clang happier
- recvfrom() in udprelay is identical, fix this by creating local variable
for comparison and assign back to buf->len when returning value is acceptable
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
Notes:
- Test cipher CFB support just in case (i.e. OpenWrt disabled it)
- Added some inline notes, please feel free to modify or remove them.
- Sorry for my bad English
- If you want to compile for OpenWrt, please make sure this hunk[1] not exists.
- Only tested on ARM mamba (Linksys WRT1900AC v1), it works.
[1] https://github.com/openwrt-mirror/openwrt/blob/master/package/libs/mbedtls/patches/200-config.patch#L12-L20
Have fun!
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>