summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2016-12-29 15:59:06 -0700
committerKarl Schultz <karl@lunarg.com>2017-01-04 08:11:32 -0700
commit3fd7b56f581e8ff20eec82b776d11aa365ccf803 (patch)
tree5adbb7841911b9f270d2a3cc0ccbfd089432bd44
parent0f3b6b868dde8bebc6ffb7646db21c122e44c46b (diff)
build: Cleanup warnings when compiling with clang
Travis-CI is building this repo with gcc and clang. This commit fixes warnings reported by clang but not by gcc. All the fixes involved adding an extra set of braces in initializers. Change-Id: I88e7841d9ab13afe2e45362b8f85261863d5b7fa
-rw-r--r--demos/cube.cpp2
-rw-r--r--demos/smoke/Meshes.cpp90
-rw-r--r--demos/smoke/Simulation.cpp4
-rw-r--r--demos/smoke/Smoke.cpp6
-rw-r--r--libs/vkjson/vkjson_unittest.cc4
5 files changed, 53 insertions, 53 deletions
diff --git a/demos/cube.cpp b/demos/cube.cpp
index b28476a5..ffbb30c9 100644
--- a/demos/cube.cpp
+++ b/demos/cube.cpp
@@ -525,7 +525,7 @@ struct Demo {
vk::CommandBufferUsageFlagBits::eSimultaneousUse);
vk::ClearValue const clearValues[2] = {
- vk::ClearColorValue(std::array<float, 4>({0.2f, 0.2f, 0.2f, 0.2f})),
+ vk::ClearColorValue(std::array<float, 4>({{0.2f, 0.2f, 0.2f, 0.2f}})),
vk::ClearDepthStencilValue(1.0f, 0u)};
auto const passInfo =
diff --git a/demos/smoke/Meshes.cpp b/demos/smoke/Meshes.cpp
index ef6e37bb..dcdb6422 100644
--- a/demos/smoke/Meshes.cpp
+++ b/demos/smoke/Meshes.cpp
@@ -166,20 +166,20 @@ public:
{
const std::vector<std::array<float, 6>> vertices = {
// position normal
- { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f },
- { -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f },
- { 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f },
- { 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f },
- { -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f },
+ {{ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }},
+ {{ -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f }},
+ {{ 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f }},
+ {{ 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f }},
+ {{ -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f }},
};
const std::vector<std::array<int, 3>> faces = {
- { 0, 1, 2 },
- { 0, 2, 3 },
- { 0, 3, 4 },
- { 0, 4, 1 },
- { 1, 4, 3 },
- { 1, 3, 2 },
+ {{ 0, 1, 2 }},
+ {{ 0, 2, 3 }},
+ {{ 0, 3, 4 }},
+ {{ 0, 4, 1 }},
+ {{ 1, 4, 3 }},
+ {{ 1, 3, 2 }},
};
mesh.build(vertices, faces);
@@ -206,46 +206,46 @@ private:
// vertices are from three golden rectangles
const std::vector<std::array<float, 6>> icosahedron_vertices = {
// position normal
- { -l1, -l2, 0.0f, -l1, -l2, 0.0f, },
- { l1, -l2, 0.0f, l1, -l2, 0.0f, },
- { l1, l2, 0.0f, l1, l2, 0.0f, },
- { -l1, l2, 0.0f, -l1, l2, 0.0f, },
-
- { -l2, 0.0f, -l1, -l2, 0.0f, -l1, },
- { l2, 0.0f, -l1, l2, 0.0f, -l1, },
- { l2, 0.0f, l1, l2, 0.0f, l1, },
- { -l2, 0.0f, l1, -l2, 0.0f, l1, },
-
- { 0.0f, -l1, -l2, 0.0f, -l1, -l2, },
- { 0.0f, l1, -l2, 0.0f, l1, -l2, },
- { 0.0f, l1, l2, 0.0f, l1, l2, },
- { 0.0f, -l1, l2, 0.0f, -l1, l2, },
+ {{ -l1, -l2, 0.0f, -l1, -l2, 0.0f, }},
+ {{ l1, -l2, 0.0f, l1, -l2, 0.0f, }},
+ {{ l1, l2, 0.0f, l1, l2, 0.0f, }},
+ {{ -l1, l2, 0.0f, -l1, l2, 0.0f, }},
+
+ {{ -l2, 0.0f, -l1, -l2, 0.0f, -l1, }},
+ {{ l2, 0.0f, -l1, l2, 0.0f, -l1, }},
+ {{ l2, 0.0f, l1, l2, 0.0f, l1, }},
+ {{ -l2, 0.0f, l1, -l2, 0.0f, l1, }},
+
+ {{ 0.0f, -l1, -l2, 0.0f, -l1, -l2, }},
+ {{ 0.0f, l1, -l2, 0.0f, l1, -l2, }},
+ {{ 0.0f, l1, l2, 0.0f, l1, l2, }},
+ {{ 0.0f, -l1, l2, 0.0f, -l1, l2, }},
};
const std::vector<std::array<int, 3>> icosahedron_faces = {
// triangles sharing vertex 0
- { 0, 1, 11 },
- { 0, 11, 7 },
- { 0, 7, 4 },
- { 0, 4, 8 },
- { 0, 8, 1 },
+ {{ 0, 1, 11 }},
+ {{ 0, 11, 7 }},
+ {{ 0, 7, 4 }},
+ {{ 0, 4, 8 }},
+ {{ 0, 8, 1 }},
// adjacent triangles
- { 11, 1, 6 },
- { 7, 11, 10 },
- { 4, 7, 3 },
- { 8, 4, 9 },
- { 1, 8, 5 },
+ {{ 11, 1, 6 }},
+ {{ 7, 11, 10 }},
+ {{ 4, 7, 3 }},
+ {{ 8, 4, 9 }},
+ {{ 1, 8, 5 }},
// triangles sharing vertex 2
- { 2, 3, 10 },
- { 2, 10, 6 },
- { 2, 6, 5 },
- { 2, 5, 9 },
- { 2, 9, 3 },
+ {{ 2, 3, 10 }},
+ {{ 2, 10, 6 }},
+ {{ 2, 6, 5 }},
+ {{ 2, 5, 9 }},
+ {{ 2, 9, 3 }},
// adjacent triangles
- { 10, 3, 7 },
- { 6, 10, 11 },
- { 5, 6, 1 },
- { 9, 5, 8 },
- { 3, 9, 4 },
+ {{ 10, 3, 7 }},
+ {{ 6, 10, 11 }},
+ {{ 5, 6, 1 }},
+ {{ 9, 5, 8 }},
+ {{ 3, 9, 4 }},
};
mesh_.build(icosahedron_vertices, icosahedron_faces);
diff --git a/demos/smoke/Simulation.cpp b/demos/smoke/Simulation.cpp
index 67cccfb7..36e3f5b6 100644
--- a/demos/smoke/Simulation.cpp
+++ b/demos/smoke/Simulation.cpp
@@ -25,7 +25,7 @@ namespace {
class MeshPicker {
public:
MeshPicker() :
- pattern_({
+ pattern_({{
Meshes::MESH_PYRAMID,
Meshes::MESH_ICOSPHERE,
Meshes::MESH_TEAPOT,
@@ -36,7 +36,7 @@ public:
Meshes::MESH_PYRAMID,
Meshes::MESH_PYRAMID,
Meshes::MESH_PYRAMID,
- }), cur_(-1)
+ }}), cur_(-1)
{
}
diff --git a/demos/smoke/Smoke.cpp b/demos/smoke/Smoke.cpp
index c52cd7ce..f3086b9d 100644
--- a/demos/smoke/Smoke.cpp
+++ b/demos/smoke/Smoke.cpp
@@ -40,7 +40,7 @@ struct ShaderParamBlock {
Smoke::Smoke(const std::vector<std::string> &args)
: Game("Smoke", args), multithread_(true), use_push_constants_(false),
sim_paused_(false), sim_(5000), camera_(2.5f), frame_data_(),
- render_pass_clear_value_({{ 0.0f, 0.1f, 0.2f, 1.0f }}),
+ render_pass_clear_value_({{{ 0.0f, 0.1f, 0.2f, 1.0f }}}),
render_pass_begin_info_(),
primary_cmd_begin_info_(), primary_cmd_submit_info_()
{
@@ -335,8 +335,8 @@ void Smoke::create_pipeline()
blend_info.pAttachments = &blend_attachment;
std::array<VkDynamicState, 2> dynamic_states = {
- VK_DYNAMIC_STATE_VIEWPORT,
- VK_DYNAMIC_STATE_SCISSOR
+ {VK_DYNAMIC_STATE_VIEWPORT,
+ VK_DYNAMIC_STATE_SCISSOR}
};
struct VkPipelineDynamicStateCreateInfo dynamic_info = {};
dynamic_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
diff --git a/libs/vkjson/vkjson_unittest.cc b/libs/vkjson/vkjson_unittest.cc
index 5c6839a2..de765cdd 100644
--- a/libs/vkjson/vkjson_unittest.cc
+++ b/libs/vkjson/vkjson_unittest.cc
@@ -81,9 +81,9 @@ int main(int argc, char* argv[]) {
EXPECT(!memcmp(&kv.second, &it->second, sizeof(kv.second)));
}
- VkImageFormatProperties props = {0};
+ VkImageFormatProperties props = {};
json = VkJsonImageFormatPropertiesToJson(props);
- VkImageFormatProperties props2 = {0};
+ VkImageFormatProperties props2 = {};
result = VkJsonImageFormatPropertiesFromJson(json, &props2, &errors);
EXPECT(result);
if (!result)