| 7 | #include <valstr.h> |
| 8 | |
| 9 | const char *val2str_default(uint32_t val, const struct valstr *vs, |
| 10 | const char *def_str) |
| 11 | { |
| 12 | int i; |
| 13 | |
| 14 | for (i = 0; vs[i].str; i++) { |
| 15 | if (vs[i].val == val) |
| 16 | return vs[i].str; |
| 17 | } |
| 18 | |
| 19 | return def_str; |
| 20 | } |
| 21 | |
| 22 | const char *val2str(uint32_t val, const struct valstr *vs) |
| 23 | { |
no outgoing calls
no test coverage detected