mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 09:27:47 +00:00
[spinel] simplify functions spinel_*_to_cstr() (#6199)
spinel.c provides functions to convert spinel values to printable strings. These functions are written using huge switch case statements. This patch replaces these statements with simple loops over arrays containing the strings. Thus, the new code takes 3 time less code than the previous. In add, the value and the string are no more repeated so the new is less error prone. Note: I have used the following commands for the conversion: sed -nre 's/case SPINEL_CMD_(.*):/SPINEL_COMMAND_CSTR(\1),/p' spinel.c sed -nre 's/case SPINEL_PROP_(.*):/SPINEL_PROP_CSTR(\1),/p' spinel.c ...
This commit is contained in:
+448
-1655
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user