[PATCH] treewide: add extra {} to initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Found with clang-tidy's clang-diagnostic-missing-braces

Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
 utils/cec-follower/cec-processing.cpp     | 12 ++++++------
 utils/v4l2-compliance/v4l2-test-debug.cpp |  2 +-
 utils/v4l2-ctl/v4l2-ctl-common.cpp        |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index df1d95c4..58af25a1 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -729,22 +729,22 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me)
 		const struct short_audio_desc supported_formats[] = {
 			{ 2, SAD_FMT_CODE_AC3,
 			  SAD_SAMPLE_FREQ_MASK_32 | SAD_SAMPLE_FREQ_MASK_44_1,
-			  64, 0, 0 },
+			  {64}, 0, 0 },
 			{ 4, SAD_FMT_CODE_AC3,
 			  SAD_SAMPLE_FREQ_MASK_32,
-			  32, 0, 0 },
+			  {32}, 0, 0 },
 			{ 4, SAD_FMT_CODE_ONE_BIT_AUDIO,
 			  SAD_SAMPLE_FREQ_MASK_48 | SAD_SAMPLE_FREQ_MASK_192,
-			  123, 0, 0 },
+			  {123}, 0, 0 },
 			{ 8, SAD_FMT_CODE_EXTENDED,
 			  SAD_SAMPLE_FREQ_MASK_96,
-			  0, 0, SAD_EXT_TYPE_DRA },
+			  {0}, 0, SAD_EXT_TYPE_DRA },
 			{ 2, SAD_FMT_CODE_EXTENDED,
 			  SAD_SAMPLE_FREQ_MASK_176_4,
-			  SAD_FRAME_LENGTH_MASK_960 | SAD_FRAME_LENGTH_MASK_1024, 1, SAD_EXT_TYPE_MPEG4_HE_AAC_SURROUND },
+			  {SAD_FRAME_LENGTH_MASK_960 | SAD_FRAME_LENGTH_MASK_1024}, 1, SAD_EXT_TYPE_MPEG4_HE_AAC_SURROUND },
 			{ 2, SAD_FMT_CODE_EXTENDED,
 			  SAD_SAMPLE_FREQ_MASK_44_1,
-			  SAD_BIT_DEPTH_MASK_16 | SAD_BIT_DEPTH_MASK_24, 0, SAD_EXT_TYPE_LPCM_3D_AUDIO },
+			  {SAD_BIT_DEPTH_MASK_16 | SAD_BIT_DEPTH_MASK_24}, 0, SAD_EXT_TYPE_LPCM_3D_AUDIO },
 		};
 
 		__u8 num_descriptors, audio_format_id[4], audio_format_code[4];
diff --git a/utils/v4l2-compliance/v4l2-test-debug.cpp b/utils/v4l2-compliance/v4l2-test-debug.cpp
index e7f375b6..3f43e661 100644
--- a/utils/v4l2-compliance/v4l2-test-debug.cpp
+++ b/utils/v4l2-compliance/v4l2-test-debug.cpp
@@ -37,7 +37,7 @@
 int testRegister(struct node *node)
 {
 	struct v4l2_dbg_register reg;
-	struct v4l2_dbg_chip_info chip = { 0 };
+	struct v4l2_dbg_chip_info chip = {};
 	int ret;
 	int uid = getuid();
 
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index aee2551b..e3c2602c 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -924,7 +924,7 @@ void common_set(cv4l_fd &_fd)
 			    qc.flags & V4L2_CTRL_FLAG_UPDATE)
 				use_ext_ctrls = true;
 			if (qc.flags & V4L2_CTRL_FLAG_HAS_PAYLOAD) {
-				struct v4l2_ext_controls ctrls = { 0, 1 };
+				struct v4l2_ext_controls ctrls = { {0}, 1 };
 				unsigned divide[V4L2_CTRL_MAX_DIMS] = { 0 };
 				ctrl_subset subset;
 				long long v;
-- 
2.25.2




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux