COMPMID-2007: Compilation failures with ndk16b.

Resolves double brace initialization issues.

Change-Id: Ic9319d4abc1d6428cefabc18be1c176bea7607dc
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/729
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/core/NEON/kernels/NEElementwiseOperationKernel.cpp b/src/core/NEON/kernels/NEElementwiseOperationKernel.cpp
index 789ef5c..aa458c2 100644
--- a/src/core/NEON/kernels/NEElementwiseOperationKernel.cpp
+++ b/src/core/NEON/kernels/NEElementwiseOperationKernel.cpp
@@ -79,10 +79,12 @@
 {
     int32x4x4_t out =
     {
-        vcvtq_s32_f32(vmlaq_f32(offset, rf.val[0], invscale)),
-        vcvtq_s32_f32(vmlaq_f32(offset, rf.val[1], invscale)),
-        vcvtq_s32_f32(vmlaq_f32(offset, rf.val[2], invscale)),
-        vcvtq_s32_f32(vmlaq_f32(offset, rf.val[3], invscale)),
+        {
+            vcvtq_s32_f32(vmlaq_f32(offset, rf.val[0], invscale)),
+            vcvtq_s32_f32(vmlaq_f32(offset, rf.val[1], invscale)),
+            vcvtq_s32_f32(vmlaq_f32(offset, rf.val[2], invscale)),
+            vcvtq_s32_f32(vmlaq_f32(offset, rf.val[3], invscale)),
+        }
     };
     store_quantized(output_ptr, out);
 }
@@ -185,10 +187,12 @@
 {
     float32x4x4_t out =
     {
-        elementwise_arithm_op<op>(a.val[0], b.val[0]),
-        elementwise_arithm_op<op>(a.val[1], b.val[1]),
-        elementwise_arithm_op<op>(a.val[2], b.val[2]),
-        elementwise_arithm_op<op>(a.val[3], b.val[3]),
+        {
+            elementwise_arithm_op<op>(a.val[0], b.val[0]),
+            elementwise_arithm_op<op>(a.val[1], b.val[1]),
+            elementwise_arithm_op<op>(a.val[2], b.val[2]),
+            elementwise_arithm_op<op>(a.val[3], b.val[3]),
+        }
     };
     return out;
 }
@@ -275,10 +279,12 @@
 {
     uint32x4x4_t out =
     {
-        elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[0], b.val[0]),
-        elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[1], b.val[1]),
-        elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[2], b.val[2]),
-        elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[3], b.val[3])
+        {
+            elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[0], b.val[0]),
+            elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[1], b.val[1]),
+            elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[2], b.val[2]),
+            elementwise_comp_op<op, float32x4_t, uint32x4_t>(a.val[3], b.val[3])
+        }
     };
     return out;
 }
diff --git a/src/core/NEON/kernels/NEPermuteKernel.cpp b/src/core/NEON/kernels/NEPermuteKernel.cpp
index e896dd4..1df94ae 100644
--- a/src/core/NEON/kernels/NEPermuteKernel.cpp
+++ b/src/core/NEON/kernels/NEPermuteKernel.cpp
@@ -47,39 +47,43 @@
 {
     static const std::array<PermutationVector, 6> permutations3 =
     {
-        PermutationVector(2U, 0U, 1U),
-        PermutationVector(1U, 2U, 0U),
-        PermutationVector(0U, 1U, 2U),
-        PermutationVector(0U, 2U, 1U),
-        PermutationVector(1U, 0U, 2U),
-        PermutationVector(2U, 1U, 0U),
+        {
+            PermutationVector(2U, 0U, 1U),
+            PermutationVector(1U, 2U, 0U),
+            PermutationVector(0U, 1U, 2U),
+            PermutationVector(0U, 2U, 1U),
+            PermutationVector(1U, 0U, 2U),
+            PermutationVector(2U, 1U, 0U),
+        }
     };
     static const std::array<PermutationVector, 24> permutations4 =
     {
-        PermutationVector(0U, 1U, 2U, 3U),
-        PermutationVector(1U, 0U, 2U, 3U),
-        PermutationVector(2U, 0U, 1U, 3U),
-        PermutationVector(0U, 2U, 1U, 3U),
-        PermutationVector(1U, 2U, 0U, 3U),
-        PermutationVector(2U, 1U, 0U, 3U),
-        PermutationVector(2U, 1U, 3U, 0U),
-        PermutationVector(1U, 2U, 3U, 0U),
-        PermutationVector(3U, 2U, 1U, 0U),
-        PermutationVector(2U, 3U, 1U, 0U),
-        PermutationVector(1U, 3U, 2U, 0U),
-        PermutationVector(3U, 1U, 2U, 0U),
-        PermutationVector(3U, 0U, 2U, 1U),
-        PermutationVector(0U, 3U, 2U, 1U),
-        PermutationVector(2U, 3U, 0U, 1U),
-        PermutationVector(3U, 2U, 0U, 1U),
-        PermutationVector(0U, 2U, 3U, 1U),
-        PermutationVector(2U, 0U, 3U, 1U),
-        PermutationVector(1U, 0U, 3U, 2U),
-        PermutationVector(0U, 1U, 3U, 2U),
-        PermutationVector(3U, 1U, 0U, 2U),
-        PermutationVector(1U, 3U, 0U, 2U),
-        PermutationVector(0U, 3U, 1U, 2U),
-        PermutationVector(3U, 0U, 1U, 2U)
+        {
+            PermutationVector(0U, 1U, 2U, 3U),
+            PermutationVector(1U, 0U, 2U, 3U),
+            PermutationVector(2U, 0U, 1U, 3U),
+            PermutationVector(0U, 2U, 1U, 3U),
+            PermutationVector(1U, 2U, 0U, 3U),
+            PermutationVector(2U, 1U, 0U, 3U),
+            PermutationVector(2U, 1U, 3U, 0U),
+            PermutationVector(1U, 2U, 3U, 0U),
+            PermutationVector(3U, 2U, 1U, 0U),
+            PermutationVector(2U, 3U, 1U, 0U),
+            PermutationVector(1U, 3U, 2U, 0U),
+            PermutationVector(3U, 1U, 2U, 0U),
+            PermutationVector(3U, 0U, 2U, 1U),
+            PermutationVector(0U, 3U, 2U, 1U),
+            PermutationVector(2U, 3U, 0U, 1U),
+            PermutationVector(3U, 2U, 0U, 1U),
+            PermutationVector(0U, 2U, 3U, 1U),
+            PermutationVector(2U, 0U, 3U, 1U),
+            PermutationVector(1U, 0U, 3U, 2U),
+            PermutationVector(0U, 1U, 3U, 2U),
+            PermutationVector(3U, 1U, 0U, 2U),
+            PermutationVector(1U, 3U, 0U, 2U),
+            PermutationVector(0U, 3U, 1U, 2U),
+            PermutationVector(3U, 0U, 1U, 2U)
+        }
     };
 
     return (permutations3.end() != std::find(permutations3.begin(), permutations3.end(), v)) || (permutations4.end() != std::find(permutations4.begin(), permutations4.end(), v));
diff --git a/src/core/NEON/kernels/NEReductionOperationKernel.cpp b/src/core/NEON/kernels/NEReductionOperationKernel.cpp
index 476b3c8..a765535 100644
--- a/src/core/NEON/kernels/NEReductionOperationKernel.cpp
+++ b/src/core/NEON/kernels/NEReductionOperationKernel.cpp
@@ -57,14 +57,14 @@
     {
         vec_idx = wrapper::vdup_n(idx, wrapper::traits::vector_128_tag{});
     }
-    uint32x4x4_t res = { wrapper::vbsl(mask, vec_idx, c.val[0]), 0, 0, 0 };
+    uint32x4x4_t res = { { wrapper::vbsl(mask, vec_idx, c.val[0]), 0, 0, 0 } };
 
     return res;
 }
 
 uint32x4x4_t calculate_index(uint32_t idx, uint8x16_t a, uint8x16_t b, uint32x4x4_t c, ReductionOperation op, int axis)
 {
-    uint32x4x4_t mask{ 0 };
+    uint32x4x4_t mask{ { 0 } };
     uint8x16_t   mask_u8{ 0 };
     if(op == ReductionOperation::ARG_IDX_MIN)
     {
@@ -94,11 +94,15 @@
         vec_idx.val[2] = wrapper::vdup_n(idx, wrapper::traits::vector_128_tag{});
         vec_idx.val[3] = wrapper::vdup_n(idx, wrapper::traits::vector_128_tag{});
     }
-    uint32x4x4_t res = { vbslq_u32(mask.val[0], vec_idx.val[0], c.val[0]),
-                         vbslq_u32(mask.val[1], vec_idx.val[1], c.val[1]),
-                         vbslq_u32(mask.val[2], vec_idx.val[2], c.val[2]),
-                         vbslq_u32(mask.val[3], vec_idx.val[3], c.val[3])
-                       };
+    uint32x4x4_t res =
+    {
+        {
+            vbslq_u32(mask.val[0], vec_idx.val[0], c.val[0]),
+            vbslq_u32(mask.val[1], vec_idx.val[1], c.val[1]),
+            vbslq_u32(mask.val[2], vec_idx.val[2], c.val[2]),
+            vbslq_u32(mask.val[3], vec_idx.val[3], c.val[3])
+        }
+    };
 
     return res;
 }
@@ -133,7 +137,7 @@
 
 uint32_t calculate_vector_index(uint32x4x4_t vec_res_idx, uint8x16_t vec_res_value, ReductionOperation op)
 {
-    uint32x4x4_t res_idx_mask{ 0 };
+    uint32x4x4_t res_idx_mask{ { 0 } };
     uint32x4_t   mask_ones = vdupq_n_u32(0xFFFFFFFF);
     uint8x16_t   mask_u8{ 0 };
     if(op == ReductionOperation::ARG_IDX_MIN)
@@ -367,7 +371,7 @@
             init_res_value = static_cast<T>(1.f);
         }
         auto         vec_res_value = wrapper::vdup_n(init_res_value, ExactTagType{});
-        uint32x4x4_t vec_res_idx{ 0 };
+        uint32x4x4_t vec_res_idx{ { 0 } };
 
         execute_window_loop(in_slice, [&](const Coordinates & id)
         {
@@ -473,7 +477,7 @@
             vec_res_value = wrapper::vdup_n(*input.ptr(), wrapper::traits::vector_128_tag{});
         }
 
-        uint32x4x4_t vec_res_idx{ 0 };
+        uint32x4x4_t vec_res_idx{ { 0 } };
         execute_window_loop(in_slice, [&](const Coordinates & id)
         {
             const auto vec_elements = wrapper::vloadq(input.ptr());
@@ -612,7 +616,7 @@
             {
                 vec_res_value = wrapper::vdup_n(static_cast<T>(0.f), ExactTagType{});
             }
-            uint32x4x4_t vec_res_idx{ 0 };
+            uint32x4x4_t vec_res_idx{ { 0 } };
 
             for(unsigned int dim = 0; dim < in_info.dimension(axis); ++dim)
             {
@@ -691,7 +695,7 @@
 
         execute_window_loop(in_slice, [&](const Coordinates & id)
         {
-            uint32x4x4_t vec_res_idx{ 0 };
+            uint32x4x4_t vec_res_idx{ { 0 } };
             auto         vec_res_value1 = vdupq_n_u32(0);
             auto         vec_res_value2 = vdupq_n_u32(0);
             auto         vec_res_value3 = vdupq_n_u32(0);
diff --git a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
index 34a7294..79e619c 100644
--- a/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
+++ b/src/runtime/CPP/functions/CPPDetectionOutputLayer.cpp
@@ -173,14 +173,18 @@
 {
     for(int i = 0; i < num_priors; ++i)
     {
-        all_prior_bboxes[i] = { *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4))),
-                                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 1))),
-                                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 2))),
-                                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 3)))
-                              };
+        all_prior_bboxes[i] =
+        {
+            {
+                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4))),
+                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 1))),
+                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 2))),
+                *reinterpret_cast<float *>(input_priorbox->ptr_to_element(Coordinates(i * 4 + 3)))
+            }
+        };
     }
 
-    std::array<float, 4> var({ 0, 0, 0, 0 });
+    std::array<float, 4> var({ { 0, 0, 0, 0 } });
     for(int i = 0; i < num_priors; ++i)
     {
         for(int j = 0; j < 4; ++j)
@@ -325,16 +329,20 @@
             if(keep)
             {
                 // Compute the jaccard (intersection over union IoU) overlap between two bboxes.
-                NormalizedBBox intersect_bbox = std::array<float, 4>({ 0, 0, 0, 0 });
+                NormalizedBBox intersect_bbox = std::array<float, 4>({ { 0, 0, 0, 0 } });
                 if(bboxes[kept_idx][0] > bboxes[idx][2] || bboxes[kept_idx][2] < bboxes[idx][0] || bboxes[kept_idx][1] > bboxes[idx][3] || bboxes[kept_idx][3] < bboxes[idx][1])
                 {
-                    intersect_bbox = std::array<float, 4>({ 0, 0, 0, 0 });
+                    intersect_bbox = std::array<float, 4>({ { 0, 0, 0, 0 } });
                 }
                 else
                 {
-                    intersect_bbox = std::array<float, 4>({ std::max(bboxes[idx][0], bboxes[kept_idx][0]), std::max(bboxes[idx][1], bboxes[kept_idx][1]), std::min(bboxes[idx][2], bboxes[kept_idx][2]), std::min(bboxes[idx][3],
-                                                            bboxes[kept_idx][3])
-                                                          });
+                    intersect_bbox = std::array<float, 4>({ {
+                            std::max(bboxes[idx][0], bboxes[kept_idx][0]),
+                            std::max(bboxes[idx][1], bboxes[kept_idx][1]),
+                            std::min(bboxes[idx][2], bboxes[kept_idx][2]),
+                            std::min(bboxes[idx][3], bboxes[kept_idx][3])
+                        }
+                    });
                 }
 
                 float intersect_width  = intersect_bbox[2] - intersect_bbox[0];
@@ -434,7 +442,7 @@
     auto     f = [&bboxes_vector, &input](const Coordinates &)
     {
         const auto input_ptr = reinterpret_cast<const float *>(input.ptr());
-        bboxes_vector.push_back(NormalizedBBox({ *input_ptr, *(input_ptr + 1), *(2 + input_ptr), *(3 + input_ptr) }));
+        bboxes_vector.push_back(NormalizedBBox({ { *input_ptr, *(input_ptr + 1), *(2 + input_ptr), *(3 + input_ptr) } }));
     };
     execute_window_loop(input_win, f, input);
 }