From: James Zern Date: Sat, 14 Mar 2020 03:29:09 +0000 (-0700) Subject: vpx_codec_enc_config_default: rm unnecessary loop X-Git-Tag: v1.9.0-rc1~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=223645aa83091fd88473ad2ddf20f80682b60a47;p=platform%2Fupstream%2Flibvpx.git vpx_codec_enc_config_default: rm unnecessary loop 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 --- diff --git a/configure b/configure index 181e27b..f470cbe 100755 --- a/configure +++ b/configure @@ -627,6 +627,7 @@ process_toolchain() { 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 diff --git a/vpx/src/vpx_encoder.c b/vpx/src/vpx_encoder.c index 6272502..f636b54 100644 --- a/vpx/src/vpx_encoder.c +++ b/vpx/src/vpx_encoder.c @@ -152,22 +152,15 @@ vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, 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;