From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5F1CE40244 for ; Wed, 20 Jul 2022 04:35:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B3B668B7CD; Wed, 20 Jul 2022 07:35:03 +0300 (EEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6AA1E68B687 for ; Wed, 20 Jul 2022 07:34:56 +0300 (EEST) Received: by mail-ej1-f47.google.com with SMTP id mf4so30925425ejc.3 for ; Tue, 19 Jul 2022 21:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version; bh=ajS+eLNg9c5LQebn/6qWRL5HQBYHNSh5W2oU8iBs7Ik=; b=OGnyfmsZX+VRn76PLcW+cikCAa1nG080bF5Bb+LUerrql1GEnweHzpPWfHpER5no4H YvnSTws4YiiyTIbGBarCYK2M3ovlhSF9slxzfai4z8+7naJbzwFfmqZaPI2EaBVgqGgj 3+Q2p3B9ENNbYKOme19SIYOR6II3zzoUvtTOb2TPjxzw0Q30e+XgswANSk4OyJsB8ly5 T7tHNbSZEg4+i6V2BzSWRdZe5XqDbvBj8yyCfzio60Bb47DAAWwEzyssDD7+GjFbfWPu a6EFBQ+KKTL5EsNgVHLej8Md5DSzHGvnnH5hWFJoq6uDq81aY5FN0NNnNbhAZ0RwslCb uBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version; bh=ajS+eLNg9c5LQebn/6qWRL5HQBYHNSh5W2oU8iBs7Ik=; b=L9zUCdOA0cYs3f2ZdqpwCjjSNziI45jFzdLqJz/UIAsKtTMhbEQx0ByHy12CquWlbb x5SIyDyIxMYl2r2ggtlUpaYsJZS2b/2b8xKHNLVkjO45cKbcRg8WPFSt/FXqzFxd8IKL w1NTLRlJO+ULAt4KSBQVvRdYEmPBGjr6JOSPwdbSsljMY54L/MVqCLYoHdMB3qeUS8pg Om8SWW5zrRKxc+knlUlUCAjEVC9tRxVBCtczs4f82v3gu98HQzHEkTPr/yaQZsAFKI8j D8/dJQxOB4qB/o85c50odtw/YOcC+dER3ALqh0gk3jOHkQ2tey9j/1O+RJYDd+JgyuEn TX8w== X-Gm-Message-State: AJIora/9AuksAbcUjVOXVL3t7s38ZgO+R2Qi8sfVq+6XuvCpevJK0DgG OEjCoAh3WZf1lyza9UN8IrccYstJqb8= X-Google-Smtp-Source: AGRyM1t6XOcg9k8+VIkz76zzKK1mrPQYVb6Ml1qRz2I1KcVNdSeDkYpjZBsT8HSl7aAjBit7ifel1Q== X-Received: by 2002:a17:907:16ab:b0:72c:7533:7262 with SMTP id hc43-20020a17090716ab00b0072c75337262mr31988244ejc.288.1658291695783; Tue, 19 Jul 2022 21:34:55 -0700 (PDT) Received: from [192.168.64.1] (84-112-104-25.cable.dynamic.surfer.at. [84.112.104.25]) by smtp.gmail.com with ESMTPSA id q7-20020a170906388700b0072aac7446easm7332807ejd.47.2022.07.19.21.34.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 21:34:55 -0700 (PDT) From: Marvin Scholz To: FFmpeg development discussions and patches Date: Wed, 20 Jul 2022 06:34:54 +0200 X-Mailer: MailMate (1.14r5898) Message-ID: <19DC904D-6C8C-4BDC-9D11-0B24D2A2B861@gmail.com> In-Reply-To: References: <20220709035723.2035064-1-amirmazz@google.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] Remove unsafe bitwise OR on FFVulkanExtensions enum 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 19 Jul 2022, at 20:31, Amir Mazzarella wrote: > Ping > > On Fri, Jul 8, 2022 at 8:57 PM Amir Mazzarella wrote: > >> FFVulkanExtensions enum does not have a value for 0 defined, and bitwise >> OR on enums is not safe. The function returns uint64_t, so it makes more >> sense and is safer to do arithmetic in terms of uint64_t I am curious, can you elaborate why it would not be safe to do the bitwise OR on an enum? >> >> Signed-off-by: Amir Mazzarella >> --- >> libavutil/vulkan_loader.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h >> index 3f1ee6aa46..0b2de4ab94 100644 >> --- a/libavutil/vulkan_loader.h >> +++ b/libavutil/vulkan_loader.h >> @@ -50,12 +50,12 @@ static inline uint64_t ff_vk_extensions_to_mask(const >> char * const *extensions, >> #endif >> }; >> >> - FFVulkanExtensions mask = 0x0; >> + uint64_t mask = 0x0; >> >> for (int i = 0; i < nb_extensions; i++) { >> for (int j = 0; j < FF_ARRAY_ELEMS(extension_map); j++) { >> if (!strcmp(extensions[i], extension_map[j].name)) { >> - mask |= extension_map[j].flag; >> + mask |= (uint64_t) extension_map[j].flag; >> continue; >> } >> } >> -- >> 2.37.0.rc0.161.g10f37bed90-goog >> >> > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".