diff mbox series

[FFmpeg-devel] avcodec/jpegxl_parser: fix a compile error

Message ID 20230828071411.1695-1-tong1.wu@intel.com
State Accepted
Commit a25a60d763061da695c3c563dcafbf392aea5579
Headers show
Series [FFmpeg-devel] avcodec/jpegxl_parser: fix a compile error | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Wu, Tong1 Aug. 28, 2023, 7:14 a.m. UTC
Compiler: MSVC 14.35.32215
Error type: error C2099: initializer is not a constant
Related commit: 0c0dd23 avcodec/jpegxl_parser: add JPEG XL parser

Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
 libavcodec/jpegxl_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zhao Zhili Aug. 29, 2023, 1:44 p.m. UTC | #1
> On Aug 28, 2023, at 15:14, Tong Wu <tong1.wu-at-intel.com@ffmpeg.org> wrote:
> 
> Compiler: MSVC 14.35.32215
> Error type: error C2099: initializer is not a constant
> Related commit: 0c0dd23 avcodec/jpegxl_parser: add JPEG XL parser
> 
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
> libavcodec/jpegxl_parser.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c
> index 66e64b1074..20c8a41a89 100644
> --- a/libavcodec/jpegxl_parser.c
> +++ b/libavcodec/jpegxl_parser.c
> @@ -49,7 +49,7 @@
> #define clog1p(x) (ff_log2(x) + !!(x))
> #define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2)
> #define div_ceil(x, y) (((x) - 1) / (y) + 1)
> -#define vlm(a,b) (VLCElem){.sym = (a), .len = (b)}
> +#define vlm(a,b) {.sym = (a), .len = (b)}

LGTM. GCC complains the same with -pedantic.

> 
> typedef struct JXLHybridUintConf {
>     int split_exponent;
> -- 
> 2.41.0.windows.1
> 
> _______________________________________________
> 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".
James Almer Aug. 29, 2023, 1:46 p.m. UTC | #2
On 8/28/2023 4:14 AM, Tong Wu wrote:
> Compiler: MSVC 14.35.32215
> Error type: error C2099: initializer is not a constant
> Related commit: 0c0dd23 avcodec/jpegxl_parser: add JPEG XL parser
> 
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>   libavcodec/jpegxl_parser.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c
> index 66e64b1074..20c8a41a89 100644
> --- a/libavcodec/jpegxl_parser.c
> +++ b/libavcodec/jpegxl_parser.c
> @@ -49,7 +49,7 @@
>   #define clog1p(x) (ff_log2(x) + !!(x))
>   #define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2)
>   #define div_ceil(x, y) (((x) - 1) / (y) + 1)
> -#define vlm(a,b) (VLCElem){.sym = (a), .len = (b)}
> +#define vlm(a,b) {.sym = (a), .len = (b)}
>   
>   typedef struct JXLHybridUintConf {
>       int split_exponent;

Applied (last night, but forgot to reply). Thanks.
diff mbox series

Patch

diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c
index 66e64b1074..20c8a41a89 100644
--- a/libavcodec/jpegxl_parser.c
+++ b/libavcodec/jpegxl_parser.c
@@ -49,7 +49,7 @@ 
 #define clog1p(x) (ff_log2(x) + !!(x))
 #define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2)
 #define div_ceil(x, y) (((x) - 1) / (y) + 1)
-#define vlm(a,b) (VLCElem){.sym = (a), .len = (b)}
+#define vlm(a,b) {.sym = (a), .len = (b)}
 
 typedef struct JXLHybridUintConf {
     int split_exponent;