Skip to content

Commit fc4b444

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean
Reviewed By: dtolnay Differential Revision: D79334788 fbshipit-source-id: 0c30bf8cd982ea8b7fdd721aafc4c7046882a76e
1 parent 0398d53 commit fc4b444

23 files changed

Lines changed: 210 additions & 106 deletions

impl/ocean/platform/wxwidgets/ImageList.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ ImageList::ImageList(const Frame& frame, const double scaleFactor)
3131
const unsigned int imageSize = (unsigned int)bitmap.GetHeight();
3232

3333
ocean_assert(imageSize * images == (unsigned int)bitmap.GetWidth());
34-
if(imageSize * images != (unsigned int)bitmap.GetWidth())
34+
if(imageSize * images != (unsigned int)bitmap.GetWidth()) {
3535
return;
36+
}
3637

3738
Create(int(imageSize), int(imageSize), frame.hasAlphaChannel(), int(images));
3839

impl/ocean/platform/wxwidgets/Screen.mm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
ocean_assert(screenBoundingBox.isValid() && resultBoundingBox.isValid());
4242

4343
// ensure that at least 50% of the window is visible inside the bounding box of the virtual screen
44-
if ((screenBoundingBox && resultBoundingBox).size() >= resultBoundingBox.size() / 2u)
44+
if ((screenBoundingBox && resultBoundingBox).size() >= resultBoundingBox.size() / 2u) {
4545
return resultBoundingBox.topLeft();
46+
}
4647

4748
// we try again to adjust the position due to the parent window
4849
if (parent)
@@ -82,8 +83,9 @@
8283
}
8384

8485
// ensure that at least 50% of the window is visible inside the bounding box of the virtual screen
85-
if ((screenBoundingBox && resultBoundingBox).size() >= resultBoundingBox.size() / 2u)
86+
if ((screenBoundingBox && resultBoundingBox).size() >= resultBoundingBox.size() / 2u) {
8687
return resultBoundingBox.topLeft();
88+
}
8789

8890
return CV::PixelPositionI(screenBoundingBox.left() + int(screenBoundingBox.width() / 2u) - int(windowWidth / 2u), screenBoundingBox.top() + int(screenBoundingBox.height() / 2u) - int(windowHeight / 2u));
8991
}
@@ -92,9 +94,9 @@
9294
{
9395
double factor = 1.0;
9496

95-
if (window)
97+
if (window) {
9698
factor = window->GetContentScaleFactor();
97-
else
99+
} else
98100
{
99101
NSScreen* mainScreen = [NSScreen mainScreen];
100102
ocean_assert(mainScreen);

impl/ocean/platform/wxwidgets/System.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ std::string System::environmentVariable(const std::string& variable, const bool
4545

4646
std::string value(Utilities::toAString(wxValue));
4747

48-
if (removeQuotes)
48+
if (removeQuotes) {
4949
while (value.length() != 0)
5050
{
5151
if (value[0] == '\"')
@@ -61,6 +61,7 @@ std::string System::environmentVariable(const std::string& variable, const bool
6161
break;
6262
}
6363
}
64+
}
6465

6566
return value;
6667
}

impl/ocean/platform/wxwidgets/Utilities.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ void Utilities::desktopFrameOutput(const int x, const int y, const Frame& frame)
104104

105105
void Utilities::bitmapOutput(wxDC& dc, const int xOutput, const int yOutput, const int widthOutput, const int heightOutput, const int xInput, const int yInput, const int widthInput, const int heightInput, const wxBitmap& bitmap)
106106
{
107-
if (widthOutput <= 0 || heightOutput <= 0 || widthInput <= 0 || heightInput <= 0)
107+
if (widthOutput <= 0 || heightOutput <= 0 || widthInput <= 0 || heightInput <= 0) {
108108
return;
109+
}
109110

110111
ocean_assert(dc.IsOk() && bitmap.IsOk());
111112

impl/ocean/rendering/Engine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ void Engine::registerDynamicObject(DynamicObject* dynamicObject)
220220

221221
void Engine::unregisterDynamicObject(DynamicObject* dynamicObject)
222222
{
223-
if (dynamicObject == nullptr)
223+
if (dynamicObject == nullptr) {
224224
return;
225+
}
225226

226227
const ScopedLock scopedLock(objectLock_);
227228

impl/ocean/rendering/Factory.cpp

Lines changed: 72 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -230,78 +230,114 @@ ObjectRef Factory::createVertexSet() const
230230

231231
ObjectRef Factory::createObject(const std::string& type) const
232232
{
233-
if (type == "AttributeSet")
233+
if (type == "AttributeSet") {
234234
return createAttributeSet();
235-
if (type == "Billboard")
235+
}
236+
if (type == "Billboard") {
236237
return createBillboard();
237-
if (type == "BlendAttribute")
238+
}
239+
if (type == "BlendAttribute") {
238240
return createBlendAttribute();
239-
if (type == "Box")
241+
}
242+
if (type == "Box") {
240243
return createBox();
241-
if (type == "Cone")
244+
}
245+
if (type == "Cone") {
242246
return createCone();
243-
if (type == "Cylinder")
247+
}
248+
if (type == "Cylinder") {
244249
return createCylinder();
245-
if (type == "DepthAttribute")
250+
}
251+
if (type == "DepthAttribute") {
246252
return createDepthAttribute();
247-
if (type == "DirectionalLight")
253+
}
254+
if (type == "DirectionalLight") {
248255
return createDirectionalLight();
249-
if (type == "Geometry")
256+
}
257+
if (type == "Geometry") {
250258
return createGeometry();
251-
if (type == "Group")
259+
}
260+
if (type == "Group") {
252261
return createGroup();
253-
if (type == "Lines")
262+
}
263+
if (type == "Lines") {
254264
return createLines();
255-
if (type == "LineStrips")
265+
}
266+
if (type == "LineStrips") {
256267
return createLineStrips();
257-
if (type == "LOD")
268+
}
269+
if (type == "LOD") {
258270
return createLOD();
259-
if (type == "Material")
271+
}
272+
if (type == "Material") {
260273
return createMaterial();
261-
if (type == "ParallelView")
274+
}
275+
if (type == "ParallelView") {
262276
return createParallelView();
263-
if (type == "PerspectiveView")
277+
}
278+
if (type == "PerspectiveView") {
264279
return createPerspectiveView();
265-
if (type == "PhantomAttribute")
280+
}
281+
if (type == "PhantomAttribute") {
266282
return createPhantomAttribute();
267-
if (type == "PointLight")
283+
}
284+
if (type == "PointLight") {
268285
return createPointLight();
269-
if (type == "PrimitiveAttribute")
286+
}
287+
if (type == "PrimitiveAttribute") {
270288
return createPrimitiveAttribute();
271-
if (type == "Quads")
289+
}
290+
if (type == "Quads") {
272291
return createQuads();
273-
if (type == "QuadStrips")
292+
}
293+
if (type == "QuadStrips") {
274294
return createQuadStrips();
275-
if (type == "Scene")
295+
}
296+
if (type == "Scene") {
276297
return createScene();
277-
if (type == "ShaderProgram")
298+
}
299+
if (type == "ShaderProgram") {
278300
return createShaderProgram();
279-
if (type == "SkyBackground")
301+
}
302+
if (type == "SkyBackground") {
280303
return createSkyBackground();
281-
if (type == "Sphere")
304+
}
305+
if (type == "Sphere") {
282306
return createSphere();
283-
if (type == "SpotLight")
307+
}
308+
if (type == "SpotLight") {
284309
return createSpotLight();
285-
if (type == "StereoView")
310+
}
311+
if (type == "StereoView") {
286312
return createStereoView();
287-
if (type == "Switch")
313+
}
314+
if (type == "Switch") {
288315
return createSwitch();
289-
if (type == "MediaTexture2D")
316+
}
317+
if (type == "MediaTexture2D") {
290318
return createMediaTexture2D();
291-
if (type == "Textures")
319+
}
320+
if (type == "Textures") {
292321
return createTextures();
293-
if (type == "Transform")
322+
}
323+
if (type == "Transform") {
294324
return createTransform();
295-
if (type == "Triangles")
325+
}
326+
if (type == "Triangles") {
296327
return createTriangles();
297-
if (type == "TriangleFans")
328+
}
329+
if (type == "TriangleFans") {
298330
return createTriangleFans();
299-
if (type == "TriangleStrips")
331+
}
332+
if (type == "TriangleStrips") {
300333
return createTriangleStrips();
301-
if (type == "UndistortedBackground")
334+
}
335+
if (type == "UndistortedBackground") {
302336
return createUndistortedBackground();
303-
if (type == "VertexSet")
337+
}
338+
if (type == "VertexSet") {
304339
return createVertexSet();
340+
}
305341

306342
return ObjectRef();
307343
}

impl/ocean/rendering/Framebuffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ bool Framebuffer::hasExtension(const std::string& /*extension*/) const
101101

102102
void Framebuffer::addScene(const SceneRef& scene)
103103
{
104-
if (scene.isNull())
104+
if (scene.isNull()) {
105105
return;
106+
}
106107

107108
const ScopedLock scopedLock(objectLock);
108109

impl/ocean/rendering/Group.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Group::~Group()
2626

2727
void Group::addChild(const NodeRef& node)
2828
{
29-
if (node.isNull())
29+
if (node.isNull()) {
3030
return;
31+
}
3132

3233
const ScopedLock scopedLock(objectLock);
3334

@@ -44,8 +45,9 @@ void Group::addChild(const NodeRef& node)
4445

4546
void Group::registerLight(const LightSourceRef& light)
4647
{
47-
if (light.isNull())
48+
if (light.isNull()) {
4849
return;
50+
}
4951

5052
const ScopedLock scopedLock(objectLock);
5153

@@ -63,33 +65,37 @@ NodeRef Group::child(const unsigned int index) const
6365
{
6466
const ScopedLock scopedLock(objectLock);
6567

66-
if (index >= groupNodes.size())
68+
if (index >= groupNodes.size()) {
6769
return NodeRef();
70+
}
6871

6972
return groupNodes[index];
7073
}
7174

7275
void Group::removeChild(const NodeRef& node)
7376
{
74-
if (node.isNull())
77+
if (node.isNull()) {
7578
return;
79+
}
7680

7781
const ScopedLock scopedLock(objectLock);
7882

79-
for (Nodes::iterator i = groupNodes.begin(); i != groupNodes.end(); ++i)
83+
for (Nodes::iterator i = groupNodes.begin(); i != groupNodes.end(); ++i) {
8084
if (node == *i)
8185
{
8286
groupNodes.erase(i);
8387
break;
8488
}
89+
}
8590

8691
unregisterThisObjectAsParent(node);
8792
}
8893

8994
void Group::unregisterLight(const LightSourceRef& light)
9095
{
91-
if (light.isNull())
96+
if (light.isNull()) {
9297
return;
98+
}
9399

94100
const ScopedLock scopedLock(objectLock);
95101

@@ -102,8 +108,9 @@ void Group::clear()
102108
{
103109
const ScopedLock scopedLock(objectLock);
104110

105-
for (Nodes::iterator i = groupNodes.begin(); i != groupNodes.end(); ++i)
111+
for (Nodes::iterator i = groupNodes.begin(); i != groupNodes.end(); ++i) {
106112
unregisterThisObjectAsParent(*i);
113+
}
107114

108115
groupNodes.clear();
109116
}

impl/ocean/rendering/Textures.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ Textures::Textures() :
2222

2323
Textures::~Textures()
2424
{
25-
for (TextureObjects::const_iterator i = textures.begin(); i != textures.end(); ++i)
25+
for (TextureObjects::const_iterator i = textures.begin(); i != textures.end(); ++i) {
2626
unregisterThisObjectAsParent(*i);
2727
}
28+
}
2829

2930
TextureRef Textures::texture(const unsigned int layerIndex) const
3031
{
3132
const ScopedLock scopedLock(objectLock);
3233

33-
if (layerIndex < textures.size())
34+
if (layerIndex < textures.size()) {
3435
return textures[layerIndex];
36+
}
3537

3638
return TextureRef();
3739
}
@@ -40,8 +42,9 @@ void Textures::setTexture(const TextureRef& texture, const unsigned int layerInd
4042
{
4143
const ScopedLock scopedLock(objectLock);
4244

43-
if (layerIndex >= textures.size())
45+
if (layerIndex >= textures.size()) {
4446
textures.resize(layerIndex + 1);
47+
}
4548

4649
unregisterThisObjectAsParent(textures[layerIndex]);
4750
registerThisObjectAsParent(texture);
@@ -51,8 +54,9 @@ void Textures::setTexture(const TextureRef& texture, const unsigned int layerInd
5154

5255
void Textures::addTexture(const TextureRef& texture)
5356
{
54-
if (texture.isNull())
57+
if (texture.isNull()) {
5558
return;
59+
}
5660

5761
const ScopedLock scopedLock(objectLock);
5862

impl/ocean/rendering/glescenegraph/GLESBlendAttribute.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ GLESBlendAttribute::BlendingFunction GLESBlendAttribute::destinationFunction() c
4444

4545
void GLESBlendAttribute::setSourceFunction(const BlendingFunction function)
4646
{
47-
if (function == attributeSourceBlendingFunction)
47+
if (function == attributeSourceBlendingFunction) {
4848
return;
49+
}
4950

5051
attributeSourceBlendingFunction = function;
5152
attributeGLESSourceBlendingFunction = translateSourceBlendingFunction(function);
5253
}
5354

5455
void GLESBlendAttribute::setDestinationFunction(const BlendingFunction function)
5556
{
56-
if (function == attributeDestinationBlendingFunction)
57+
if (function == attributeDestinationBlendingFunction) {
5758
return;
59+
}
5860

5961
attributeDestinationBlendingFunction = function;
6062
attributeGLESDestinationBlendingFunction = translateDestinationBlendingFunction(function);

0 commit comments

Comments
 (0)