From patchwork Mon Oct 18 22:27: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: 31155 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3792035ioa; Mon, 18 Oct 2021 15:28:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxltm0T5Oy0dbRZXOwhjcvsyBzmHjLdw+d1AqCsxrfC2cX5WbaLhsyyeHwtMDCmiUHkwvD X-Received: by 2002:a05:6402:5252:: with SMTP id t18mr46770350edd.129.1634596096673; Mon, 18 Oct 2021 15:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596096; cv=none; d=google.com; s=arc-20160816; b=FbgWqWsf2ZwlqsqrUX46WHmqXnCl3abKOSfSlVGh6+PVaYl07Pom3bx4Drb+zU4dQv Xfnqsqi8U2EULaDH1JQmcVBpsMlojUECE0h5B+wyTYf1q9sNw6OCfybzsrffukg9RrxU dK0iKIEFup0OlgmhdCJnTe0s5pOBFvzSMzymCsJ+skcd9uKISD5AU98pibDGoYzM3V9w ot/mUUcSPrS5x7Z5ED/j7tF65MHPcXMzoj3gKaYjspPpq/W+Vi2DJIocvNloTqnh7LES 8qwjkYWn66XQXQWZIOUEVNf4O0O5KnYTCmIfaEnmYQNBdoa1kbDO3sMDbmH2YePZLSJd 7HoA== 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=qByuiJmIL0OKcEaRIUuql/HbUg4+UcoHrwB/7Fa+74HwKnzxSOyrTJO3036Xnw6xHG gxdgw/mt9Uv891psQoCAQgtunOgG2VGSMpmomof9tUMvCkTS7Da/nEqNlwSnSN+Fiijr yOc/LK1bOkIZfQ1VS5hedLSSWU4njIhT6KuhlTdkZimn6VrPbJoVU++OGntLLQJwPuWh EKolifcLafKSD7DM1Z7UtmJucGEoMoXY7g/hIAxAV58DBAmpi7PUoB+/HzW8uGV/TOAI fpB1MSyaArqdwg4EOOXM9KKPjBBWv+vstMBmif43/apktMuda3bHTkBLuHUbpIDi0Jox GsdA== 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=jN3Oj5Us; 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 f17si21648486ejb.60.2021.10.18.15.28.16; Mon, 18 Oct 2021 15:28:16 -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=jN3Oj5Us; 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 93E4468A89E; Tue, 19 Oct 2021 01:27:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 09E9D68A576 for ; Tue, 19 Oct 2021 01:27:41 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id k26so15891230pfi.5 for ; Mon, 18 Oct 2021 15:27: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=jN3Oj5UsIlYfORhHisjj6dYkQgZ+AnSN/QcYgvsd96qWXiXF/blZGW1k2WoIJ4m2/M To38lwZA0VuRRmdrfxVt6sN3seERqajdrU6IhzPy+6ZN96iVakFzkG1JOnyPiddgIbfQ IWQot4xTum3CNSpzh1Gmb+lbkhcJN47/2VkXMoWXcxsQoFPYKJcOKb/9zRipRpT0rUTy kr6E7/mXrj2dgpRKpEeeYYHspMe0tZn7/pWLbgOxzN8xjelznK35NX4e7kxVNyUxJKiI EpIEgFTqPrwTJWJ4439PCctGSLUWPwEz3W3R2wsO4/n43hJHDt2Q46XI8/o/bH1Wxgtu o+pw== 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=SPBNOcbbZ8w5u6JFlVItvTkAYVyRxQm7jigJ2EOtlUgaNwFt8s2i/6xoJYyIQA/KAn vgk6WIi+fgl6rKPfX6tN4KlFdlUFgTW9/WN8irvTAutVM9rsca61FFJpHTd4jEEO28DC IBAkkP2KhdZs9v5i5eeze40HWXOej/ceC4QSqeSBCAoutlS1/ABGrwny5Itw+1zxE12v Fkvu3EUb7pj4LF29qRWkwVpgzvpx1ZD5WNoul8I3LiK/u09rl1fWVAOqBRNUb+FBQf1/ KlKZVqb9lPJ8UaAMioq/0SSOpENJnHA6KJeJ7CyDxplN+o1WKPypY2zg+lBK+Fc9FoaE K5+g== X-Gm-Message-State: AOAM5332EGCE0MQ7161TXTKWMDt63i7NKWhsYQ09D4aNXUyh2nNhup7c YP7vtBmrnIaZi7sRs72/JaL+m9Y/9RnpPEwDUms= X-Received: by 2002:a63:b34a:: with SMTP id x10mr25731337pgt.473.1634596059127; Mon, 18 Oct 2021 15:27:39 -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 x7sm14096663pfj.164.2021.10.18.15.27.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:38 -0700 (PDT) Message-ID: <5d8852f8-9b98-82e3-5cad-f4023cdae770@triularity.org> Date: Mon, 18 Oct 2021 15:27: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: erUG5/ZU/3yt 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);