diff mbox series

[FFmpeg-devel] avfilter/vf_pseudocolor: Add missing braces

Message ID 24c695f9-19a4-7a0d-0172-dd76ba5ddbe5@jkqxz.net
State New
Headers show
Series [FFmpeg-devel] avfilter/vf_pseudocolor: Add missing braces
Related show

Checks

Context Check Description
andriy/configure warning Failed to apply patch
andriy/configure warning Failed to apply patch

Commit Message

Mark Thompson Feb. 2, 2021, 9:50 p.m. UTC
The array inside a structure needs two levels of braces.
---
The previous format was unambiguous, but it provoked a lot of warning spam.  gcc 10:

CC      libavfilter/vf_pseudocolor.o
src/libavfilter/vf_pseudocolor.c:107:35: warning: missing braces around initializer [-Wmissing-braces]
   107 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }
src/libavfilter/vf_pseudocolor.c:107:35: warning: missing braces around initializer [-Wmissing-braces]
   107 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {               }
src/libavfilter/vf_pseudocolor.c:107:35: warning: missing braces around initializer [-Wmissing-braces]
   107 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {               }   {            }
src/libavfilter/vf_pseudocolor.c:107:35: warning: missing braces around initializer [-Wmissing-braces]
   107 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {               }   {            }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {            }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {            }   {               }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {            }   {               }   {            }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {            }   {               }   {            }   {            }
src/libavfilter/vf_pseudocolor.c:108:35: warning: missing braces around initializer [-Wmissing-braces]
   108 | static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
       |                                   ^
       |                                     {             }   {            }   {               }   {            }   {            }

  libavfilter/vf_pseudocolor.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Feb. 6, 2021, 10:04 p.m. UTC | #1
Trivial, thus lgtm.
Mark Thompson Feb. 17, 2021, 11:11 p.m. UTC | #2
On 06/02/2021 22:04, Paul B Mahol wrote:
> Trivial, thus lgtm.

Rebased and applied, apologies for the delay.

Thanks,

- Mark
diff mbox series

Patch

diff --git a/libavfilter/vf_pseudocolor.c b/libavfilter/vf_pseudocolor.c
index 192839342b..3416ab19a9 100644
--- a/libavfilter/vf_pseudocolor.c
+++ b/libavfilter/vf_pseudocolor.c
@@ -104,8 +104,8 @@  static const Range full_range   = {0, 256};
  static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}};
  static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {236, 256}};

-static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
-static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
+static const Fill spec1_fills[] = {{{0.5f, 0.f, .5f}}, {{-1.f, -1.f, -1.f}}, {{1.f, 0.f, 0.f}}};
+static const Fill spec2_fills[] = {{{0.5f, 0.f, .5f}}, {{0.f, 1.f, 1.f}}, {{-1.f, -1.f, -1.f}}, {{1.f, 1.f, 0.f}}, {{1.f, 0.f, 0.f}}};

  static const Curve curves[] =
  {