spa: Add default: statements

This allows to use the library in projects that use `-Wswitch-default`
without any

 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wswitch-default"
 #pragma GCC diagnostic pop

This is useful as as the header is being pulled in via
pipewire/wireplumber headers into projects that might have this warning
enabled and would otherwise fail to build with -Werror.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther 2025-05-05 12:44:20 +02:00 committed by Wim Taymans
parent 5d741a2b3c
commit 2d4af3ced5

View file

@ -268,6 +268,8 @@ SPA_API_JSON int spa_json_next(struct spa_json * iter, const char **value)
if (--utf8_remain == 0)
iter->state = __STRING | flag;
continue;
default:
break;
}
_SPA_ERROR(CHARACTERS_NOT_ALLOWED);
case __ESC:
@ -276,12 +278,17 @@ SPA_API_JSON int spa_json_next(struct spa_json * iter, const char **value)
case 'n': case 'r': case 't': case 'u':
iter->state = __STRING | flag;
continue;
default:
break;
}
_SPA_ERROR(INVALID_ESCAPE);
case __COMMENT:
switch (cur) {
case '\n': case '\r':
iter->state = __STRUCT | flag;
break;
default:
break;
}
break;
default:
@ -299,6 +306,8 @@ SPA_API_JSON int spa_json_next(struct spa_json * iter, const char **value)
case __COMMENT:
/* trailing comment */
return 0;
default:
break;
}
if ((iter->state & __SUB_FLAG) && (iter->state & __KEY_FLAG)) {