From patchwork Mon Oct 18 21:32:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31151 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3750440ioa; Mon, 18 Oct 2021 14:32:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyECbiBNQukU1qqJ5MarFufNvFE/efKvN7+JuOq4IgPO07fb6WxJuxfeasVeaEx6AoIK5D3 X-Received: by 2002:a17:906:4fc7:: with SMTP id i7mr34967696ejw.14.1634592774746; Mon, 18 Oct 2021 14:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592774; cv=none; d=google.com; s=arc-20160816; b=rMDHIgOL1DgM5IeV6NMHzjNPy/j84wTaGm5ksB8G+I4CB0FMYB49aO3wVtWLFlOo35 oPUQXRbqShNwPuuXV1AePMHc+eTiHaoIj7511lX3d6TxVYoNc6/GKkkswmyjFuS/6fUS XMfi2cSBB6Ap7Fes638gW5kIOc72EhAAgAgiQg61ffD4mDsOST6PNcGjgATMpZRoGlHa TXtfLg0cR+TjLjcj1QU0C8qBgoUAj4BH4ea8kRUjx3ivRYD6WFNUZIroKkfQgWyI7txl c71yCQHBjkR+VH/sfO/NVTUfN2bVoqOt/LNpGY8dIYeNaCYx9jaSbk5tOOgYB+EFzKX6 daGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=lJVgbXg0KW+EWDZHtG8U7mkXetvEAaUJAXZTr71za8s=; b=mEY21k1yEEL2pRd2oJhduMITbrGytpB4F9osQqAS8Oq9+oS+gESY+4uTMux5HPPAYX SvJsR15lMtWqxkXGmdS4wgBJYDU4kN8uyuGbiKAJeyzWEVA8vUUH/JBOhPjLojibOHo4 Zl8c8UW1iC7/M0J0bTMtPcS5eDdFWYmyKAS+dSXfkRKs5GqcKfJooWl9c/8womWkdFe6 pYrGS4aKYIuBXifg1lnIITI4k1RKPyf5hZ57CwktYowsaHixBdkyXmKOwnmZBwrWdlts GYefQga19W7W8tzVs2Ot06tz/S7E7qXe3id1wdkDOZw4o6Uiqwm8WxtoVfZdhkpgPs9R tM0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=T+7ArTlU; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o8si20343985edi.429.2021.10.18.14.32.54; Mon, 18 Oct 2021 14:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=T+7ArTlU; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8EBB68A77B; Tue, 19 Oct 2021 00:32:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9FC0868A10A for ; Tue, 19 Oct 2021 00:32:40 +0300 (EEST) Received: by mail-pj1-f44.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso407328pjb.4 for ; Mon, 18 Oct 2021 14:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=T+7ArTlUfO1+d7ZxEI/Et4Xdg7jpaZrmXQwecIeaAKKspVh+u9ijapOqH5DN+vm2rP fyxElwFta/Sf1ZywODRosfsOiaLo1UF9vOLWv1S64BwboXbV36BjtNA8BolN+e21j8Wx 0cmrO8/Kn7Hdu7cav83HpJPRyR0RvqzHkJ8zqVy6ktao0SjHLGp/Mpc4RaFhGOQJITGc x+iAdIGUtXGPnVSGWHyPWiJ9arSFbJEeQoE/JyDMQZR7dz/z2gHNf7Loa+7THtYo/4d3 AvxhwVLmGNPraMF6zODcRd+uEESzDmbCR1dGL8bBHip8Etvg4fT+dyUgUfkEFJu3rPAD HgJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=6/5CBvtGcxc8adndUuoitKrAZicEq4eLYJuCXuvAT2InJGPB1uRWDQTNwivjQBC2zc GsEFMdZnddC5m/j6ZOafWJJFWCsxLyPXqxHmUIuaaC3UQpOHkhUz4qFA8jLBZJFo9t/B P47zA1q+rNUapl/0uGGL6KChN3M8QiLaCLg4D5qPQh6+Tky3uzjy2XWLe3B9LZX17X7W fnj3Sk3H7etx+XRMezlqvwFh0aCprmMYU6aWtBMDkxqsQjwLkviutdSxfPLyEyMMLw4C IUH9uYKvAt7sVhxcnTwcuZSx6I01L4L8BLLx2dcwSDCn3DEl8TxYH4BUNycC1Uvx4zRB JwHw== X-Gm-Message-State: AOAM531q851UgLnX2JVkr8Gv2VB2WlyS95THwziJ4r6GZiEO6/5oaBOq yx77oO8erumRsD8KzbbG+3+qUGruJF6DwbWoTgI= X-Received: by 2002:a17:902:d4d1:b0:13f:af7:9068 with SMTP id o17-20020a170902d4d100b0013f0af79068mr29515844plg.20.1634592758834; Mon, 18 Oct 2021 14:32:38 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id y8sm13892834pfe.217.2021.10.18.14.32.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:32:38 -0700 (PDT) Message-ID: Date: Mon, 18 Oct 2021 14:32:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 6/6] libavutil/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3WN/MBq4tC/p Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavutil/hwcontext_qsv.c | 2 +- libavutil/hwcontext_vulkan.c | 6 +++--- libavutil/opt.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c18747f7eb..23023c005d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1451,7 +1451,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device, enum AVHWDeviceType child_device_type; AVHWDeviceContext *child_device; AVDictionary *child_device_opts; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; mfxIMPL impl; int ret; diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2c3216857a..259fa12cba 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -545,7 +545,7 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts, int optional_exts_num; uint32_t sup_ext_count; char *user_exts_str = NULL; - AVDictionaryEntry *user_exts; + const AVDictionaryEntry *user_exts; VkExtensionProperties *sup_ext; const VulkanOptExtension *optional_exts; @@ -671,7 +671,7 @@ static int create_instance(AVHWDeviceContext *ctx, AVDictionary *opts) VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; - AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); + const AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); const int debug_mode = debug_opt && strtol(debug_opt->value, NULL, 10); VkApplicationInfo application_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, @@ -1246,7 +1246,7 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, { int err = 0; VkResult ret; - AVDictionaryEntry *opt_d; + const AVDictionaryEntry *opt_d; VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; diff --git a/libavutil/opt.c b/libavutil/opt.c index c7001dbcd3..51b9157c2e 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1633,7 +1633,7 @@ void av_opt_free(void *obj) int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVDictionary *tmp = NULL; int ret; @@ -2005,8 +2005,8 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o) case AV_OPT_TYPE_DICT: { AVDictionary *dict1 = NULL; AVDictionary *dict2 = *(AVDictionary **)dst; - AVDictionaryEntry *en1 = NULL; - AVDictionaryEntry *en2 = NULL; + const AVDictionaryEntry *en1 = NULL; + const AVDictionaryEntry *en2 = NULL; ret = av_dict_parse_string(&dict1, o->default_val.str, "=", ":", 0); if (ret < 0) { av_dict_free(&dict1);