ARRAY_LEN()

This commit is contained in:
Devaev Maxim
2019-03-02 11:30:10 +03:00
parent 667e3610b2
commit 56a95c7f17
3 changed files with 6 additions and 6 deletions

View File

@@ -120,7 +120,7 @@ void encoder_destroy(struct encoder_t *encoder) {
}
enum encoder_type_t encoder_parse_type(const char *const str) {
for (unsigned index = 0; index < sizeof(_ENCODER_TYPES) / sizeof(_ENCODER_TYPES[0]); ++index) {
for (unsigned index = 0; index < ARRAY_LEN(_ENCODER_TYPES); ++index) {
if (!strcasecmp(str, _ENCODER_TYPES[index].name)) {
return _ENCODER_TYPES[index].type;
}