quiets -Wunreachable-code-loop-increment, present since:
e57f388bc vpx_codec_enc_config_default: disable 'usage'
as g_usage was never supported for vp8/9 this was always a single
iteration. if additional usages are added in the future similar to av1
this can be restored.
Bug: b/
150166387
Change-Id: Ic6f0985829e87694de8b5e0340cffa6c451ed1c2
check_add_cflags -Wmissing-declarations
check_add_cflags -Wmissing-prototypes
check_add_cflags -Wuninitialized
+ check_add_cflags -Wunreachable-code-loop-increment
check_add_cflags -Wunused
check_add_cflags -Wextra
# check_add_cflags also adds to cxxflags. gtest does not do well with
vpx_codec_enc_cfg_t *cfg,
unsigned int usage) {
vpx_codec_err_t res;
- vpx_codec_enc_cfg_map_t *map;
- int i;
if (!iface || !cfg || usage != 0)
res = VPX_CODEC_INVALID_PARAM;
else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else {
- res = VPX_CODEC_INVALID_PARAM;
-
- for (i = 0; i < iface->enc.cfg_map_count; ++i) {
- map = iface->enc.cfg_maps + i;
- *cfg = map->cfg;
- res = VPX_CODEC_OK;
- break;
- }
+ assert(iface->enc.cfg_map_count == 1);
+ *cfg = iface->enc.cfg_maps->cfg;
+ res = VPX_CODEC_OK;
}
return res;