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 3A937467D1 for ; Thu, 17 Aug 2023 22:12:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 996FF68C71D; Fri, 18 Aug 2023 01:12:49 +0300 (EEST) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CE8DC68C529 for ; Fri, 18 Aug 2023 01:12:42 +0300 (EEST) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3a7ca8720a0so180752b6e.2 for ; Thu, 17 Aug 2023 15:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692310361; x=1692915161; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wVfwhnDtyjJY8nKP+tW8xZbYWfbPV6Wc5Jzu4k9mAmA=; b=guonuPT2xcBQ9fiTAkw5qdjvT7JtyKrFKjqdkynhrkA8KJcRGjLL+pRrWClIJxoVgG myERpcikJ4TPPdHuXAQc2DbUNeTBAH4/E7t9mJxy625Xklfp51LdgXg4IQzQh2XAb4j3 vsheB8U/vY9SWopQ7lZf7OqzqGQeyzQYmkV14xN7WWOweusHB1gHTnwE8DYe2YbZxM65 BgvGDlzq52ZORr3yIHciBl9w9JzgKiOpvK1Xz3Uk+uwt0uT+Jy7BTLozC+wPZLGEUcuV c2mnlLu6E8eMn9OOI5yXA2ogpS609TN/fjjOnn6440ZheCt4pwfB6SsM9E5sSsKTiEK/ m+/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692310361; x=1692915161; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wVfwhnDtyjJY8nKP+tW8xZbYWfbPV6Wc5Jzu4k9mAmA=; b=dogbqlI/3qxMDHWnjP1xd3Sgb2WlCh0xDaCuCATbt50GLPCFjX793Xs3jilgo7wkwL 6xFmuPEKeMMDMtB++PEOq23u+TiIq9fhQw0QjD3RQWvXESzQvFFGzaSzcVc4/PeeWAwi 1XRgSJUDvaINgbfrgvUo9WM23irzly39x4p82I6phJ863U+0OnRs9LNXznMACukk6J0h HHKJEeyCn7zOl5d0dFl2qYK37oS2d1Ju4RQKdMy94tf/jWR56078rctmXBDP4BOYPU+l fYsiyfoqRfKG3LzPoLu2NGy0Izhsm+83+K2mdNDmPoD1nBm5U0sQ7K/E+q7Ej6kce8pk MgGw== X-Gm-Message-State: AOJu0Yx/m/d0HP5VExfFs2eRKyQ19wAwgettKw+68juElHxJSbSG+5DU DreAHndH49maxfHxaIlea1JKmjDrgec= X-Google-Smtp-Source: AGHT+IEWI5854FBV/IOR4LAtf1j0ZgT5IbJG1s4X21H/Blky5TsIfCqfSpA8Cv5Mu3PTfZBv2Sl0Bg== X-Received: by 2002:a05:6808:14c5:b0:3a7:9acc:4725 with SMTP id f5-20020a05680814c500b003a79acc4725mr1007099oiw.54.1692310360745; Thu, 17 Aug 2023 15:12:40 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id bd41-20020a056808222900b003a4825088ffsm292711oib.51.2023.08.17.15.12.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Aug 2023 15:12:40 -0700 (PDT) Message-ID: Date: Thu, 17 Aug 2023 19:12:43 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v2] avutil/channel_layout: make pre-defined channel layouts C++ friendly 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 8/17/2023 11:27 AM, Zhao Zhili wrote: > From: Zhao Zhili > > C++ doesn't support designated initializers until C++20. We have > a bunch of pre-defined channel layouts, the gains to make them > usable in C++ exceed the losses. > > Bump minor version so C++ project can check before use these defines. > > Also initialize .opaque field explicitly to reduce warning in C++. > --- > v2: > 1. Keep field names in comments. > 2. Bump minor version. > 3. Add comments so it won't be reverted by accident. > > libavutil/channel_layout.h | 5 +++-- > libavutil/version.h | 4 ++-- > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h > index f345415c55..f019b3d7ad 100644 > --- a/libavutil/channel_layout.h > +++ b/libavutil/channel_layout.h > @@ -358,8 +358,9 @@ typedef struct AVChannelLayout { > void *opaque; > } AVChannelLayout; > > +/* Don't use designated initializers since C++ doesn't support it until C++20. */ > #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ > - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} > + { /* .order */ AV_CHANNEL_ORDER_NATIVE, /* .nb_channels */ (nb), /* .u.mask */ { m }, /* .opaque */ NULL } > > /** > * @name Common pre-defined channel layouts > @@ -397,7 +398,7 @@ typedef struct AVChannelLayout { > #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) > #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) > #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ > - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} > + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, /* .nb_channels */ 4, /* .u.mask */ { 0 }, NULL } > /** @} */ > > struct AVBPrint; > diff --git a/libavutil/version.h b/libavutil/version.h > index 5a4d4d3d73..bc43baca9f 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -79,8 +79,8 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 58 > -#define LIBAVUTIL_VERSION_MINOR 16 > -#define LIBAVUTIL_VERSION_MICRO 101 > +#define LIBAVUTIL_VERSION_MINOR 17 > +#define LIBAVUTIL_VERSION_MICRO 100 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > LIBAVUTIL_VERSION_MINOR, \ Will apply with some cosmetic changes. _______________________________________________ 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".