Skip to content

Commit 9ee8e25

Browse files
enpefacebook-github-bot
authored andcommitted
Revert recent codemods
Summary: Reverting the following diffs because the introduce breaking changes and violate the Ocean code style: * D79329075 [Codemod][CppQualityDownToZero] [batch:8/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean * D79333449 [Codemod][CppQualityDownToZero] [batch:4/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean * D79332676 [Codemod][CppQualityDownToZero] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/metaonly * D79330289 [Codemod][CppQualityDownToZero] [batch:2/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean * D79335633 [Codemod][CppQualityDownToZero] [batch:6/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean * D79334788 [Codemod][CppQualityDownToZero] [batch:5/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean * D79333917 [Codemod][CppQualityDownToZero] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/application * D79328216 [Codemod][CppQualityDownToZero] [batch:7/8] Fix CQS signal readability-braces-around-statements in xplat/ocean/impl/ocean Action: ``` hg update master hg revert -r 995d096cbab27f491a3dce0a9815fd3499f04d2f^ xplat/ocean hg commit ``` Reviewed By: janherling Differential Revision: D79365416 fbshipit-source-id: 0c200fd489554b4fccb6cb80541ee6cb520a4aab
1 parent 859680d commit 9ee8e25

115 files changed

Lines changed: 1048 additions & 1995 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

impl/application/ocean/shark/android/NativeInterfaceShark.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ jboolean Java_com_meta_ocean_app_shark_android_NativeInterfaceShark_loadScene(JN
2828
{
2929
const std::string sceneFilename(filenamePtr);
3030

31-
if (!sceneFilename.empty()) {
31+
if (!sceneFilename.empty())
3232
result = GLMainView::get<GLMainView>().loadScene(sceneFilename, replace);
33-
}
3433

3534
env->ReleaseStringUTFChars(filename, filenamePtr);
3635
}

impl/application/ocean/test/cv/testcv/testopencv/TestCVOpenCV.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ using namespace Ocean;
144144

145145
try
146146
{
147-
if (Test::TestCV::TestOpenCV::testCVOpenCV(testDuration, mediaFilename, functionList)) {
147+
if (Test::TestCV::TestOpenCV::testCVOpenCV(testDuration, mediaFilename, functionList))
148148
resultValue = 0;
149-
}
150149
}
151150
catch (const std::exception& exception)
152151
{

impl/application/ocean/test/geometry/testgeometry/TestGeometry.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ using namespace Ocean;
128128

129129
try
130130
{
131-
if (Test::TestGeometry::testGeometry(testDuration, worker, functionList)) {
131+
if (Test::TestGeometry::testGeometry(testDuration, worker, functionList))
132132
resultValue = 0;
133-
}
134133
}
135134
catch (...)
136135
{

impl/application/ocean/test/media/testmedia/TestMedia.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ using namespace Ocean;
131131

132132
try
133133
{
134-
if (Test::TestMedia::testMedia(testDuration, worker, functionList)) {
134+
if (Test::TestMedia::testMedia(testDuration, worker, functionList))
135135
resultValue = 0;
136-
}
137136
}
138137
catch(...)
139138
{

impl/application/ocean/test/platform/testplatform/TestPlatform.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ using namespace Ocean;
131131

132132
try
133133
{
134-
if (Test::TestPlatform::testPlatform(testDuration, worker, functionList)) {
134+
if (Test::TestPlatform::testPlatform(testDuration, worker, functionList))
135135
resultValue = 0;
136-
}
137136
}
138137
catch(...)
139138
{

impl/application/ocean/test/testocean/TestOcean.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,20 @@ using namespace Ocean;
101101

102102
const std::string file(String::trim(String::toAString(argv[1]), '\"'));
103103

104-
if (!file.empty()) {
104+
if (!file.empty())
105105
mediaFilename = file;
106-
}
107106
}
108107

109108
if (argc >= 3)
110109
{
111110
const std::string file(String::trim(String::toAString(argv[2])));
112111

113-
if (!file.empty()) {
112+
if (!file.empty())
114113
outputFilename = file;
115-
}
116114
}
117115

118-
if (argc >= 4) {
116+
if (argc >= 4)
119117
libraryList = String::trim(String::toAString(argv[3]));
120-
}
121118

122119
if (argc >= 5)
123120
{
@@ -126,15 +123,14 @@ using namespace Ocean;
126123
if (!duration.empty())
127124
{
128125
const double value = atof(duration.c_str());
129-
if (value > 0) {
126+
if (value > 0)
130127
testDuration = value;
131-
}
132128
}
133129
}
134130

135-
if (outputFilename.empty() || outputFilename == "STANDARD") {
131+
if (outputFilename.empty() || outputFilename == "STANDARD")
136132
Messenger::get().setOutputType(Messenger::OUTPUT_STANDARD);
137-
} else
133+
else
138134
{
139135
Messenger::get().setOutputType(Messenger::OUTPUT_FILE);
140136
Messenger::get().setFileOutput(outputFilename);

impl/application/ocean/test/tracking/testtracking/TestTracking.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ using namespace Ocean;
131131

132132
try
133133
{
134-
if (Test::TestTracking::testTracking(testDuration, worker, functionList)) {
134+
if (Test::TestTracking::testTracking(testDuration, worker, functionList))
135135
resultValue = 0;
136-
}
137136
}
138137
catch (...)
139138
{

impl/ocean/cv/FrameShrinkerAlpha.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,11 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
170170
const unsigned int denominator_2 = denominator / 2u;
171171

172172
// data channel
173-
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n) {
173+
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n)
174174
target[n] = uint8_t((sourceFirst[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
175175
+ sourceFirst[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels])
176176
+ sourceSecond[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
177177
+ sourceSecond[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) + denominator_2) / denominator);
178-
}
179178

180179
// alpha channel
181180
target[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()] = uint8_t((sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()]
@@ -215,14 +214,13 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
215214
const unsigned int denominator_2 = denominator / 2u;
216215

217216
// data channel
218-
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n) {
217+
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n)
219218
target[n] = uint8_t((sourceFirst[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
220219
+ sourceFirst[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) * 2u
221220
+ sourceFirst[tChannels * 2u + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels * 2u])
222221
+ sourceSecond[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
223222
+ sourceSecond[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) * 2u
224223
+ sourceSecond[tChannels * 2u + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels * 2u]) + denominator_2) / denominator);
225-
}
226224

227225
// alpha channel
228226
target[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()] =
@@ -274,14 +272,13 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
274272
const unsigned int denominator_2 = denominator / 2u;
275273

276274
// data channel
277-
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n) {
275+
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n)
278276
target[n] = uint8_t((sourceFirst[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
279277
+ sourceFirst[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels])
280278
+ sourceSecond[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()]) * 2u
281279
+ sourceSecond[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceSecond[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) * 2u
282280
+ sourceThird[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceThird[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
283281
+ sourceThird[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceThird[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) + denominator_2) / denominator);
284-
}
285282

286283
// alpha channel
287284
target[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()] =
@@ -332,7 +329,7 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
332329
const unsigned int denominator_2 = denominator / 2u;
333330

334331
// data channel
335-
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n) {
332+
for (unsigned int n = FrameBlender::SourceOffset<tAlphaAtFront>::data(); n < tChannels + FrameBlender::SourceOffset<tAlphaAtFront>::data() - 1u; ++n)
336333
target[n] = uint8_t((sourceFirst[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
337334
+ sourceFirst[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) * 2u
338335
+ sourceFirst[tChannels * 2u + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceFirst[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels * 2u])
@@ -342,7 +339,6 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
342339
+ sourceThird[n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceThird[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()])
343340
+ sourceThird[tChannels + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceThird[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels]) * 2u
344341
+ sourceThird[tChannels * 2u + n] * FrameBlender::alpha8BitToOpaqueIs0xFF<tTransparentIs0xFF>(sourceThird[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>() + tChannels * 2u]) + denominator_2) / denominator);
345-
}
346342

347343
// alpha channel
348344
target[FrameBlender::SourceOffset<tAlphaAtFront>::template alpha<tChannels>()] =
@@ -358,11 +354,10 @@ void FrameShrinkerAlpha::divideByTwo8BitPerChannelSubset(const uint8_t* source,
358354
}
359355
else
360356
{
361-
for (unsigned int n = 0u; n < tChannels; ++n) {
357+
for (unsigned int n = 0u; n < tChannels; ++n)
362358
target[n] = uint8_t((sourceFirst[n] + sourceFirst[tChannels + n] * 2u + sourceFirst[tChannels * 2u + n]
363359
+ sourceSecond[n] * 2u + sourceSecond[tChannels + n] * 4u + sourceSecond[tChannels * 2u + n] * 2u
364360
+ sourceThird[n] + sourceThird[tChannels + n] * 2u + sourceThird[tChannels * 2u + n] + 4u) / 8u);
365-
}
366361
}
367362
}
368363
}

impl/ocean/cv/NonMaximumSuppression.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,8 @@ void NonMaximumSuppression<T>::suppressNonMaximumSubset(StrengthPositions<TCoord
10361036

10371037
if (i2Plus != row2.end() && i2Plus->x() <= i1->x() + 1u)
10381038
{
1039-
if (i2Plus->strength() >= i1->strength()) {
1039+
if (i2Plus->strength() >= i1->strength())
10401040
goto next;
1041-
}
10421041

10431042
// check if there is a further candidate in the south row
10441043

@@ -1048,9 +1047,8 @@ void NonMaximumSuppression<T>::suppressNonMaximumSubset(StrengthPositions<TCoord
10481047
{
10491048
ocean_assert(i2PlusPlus->x() == i1->x() + 1u);
10501049

1051-
if (i2PlusPlus->strength() >= i1->strength()) {
1050+
if (i2PlusPlus->strength() >= i1->strength())
10521051
goto next;
1053-
}
10541052
}
10551053
}
10561054
}
@@ -1075,9 +1073,8 @@ void NonMaximumSuppression<T>::suppressNonMaximumSubset(StrengthPositions<TCoord
10751073

10761074
i1Minus = i1;
10771075

1078-
if (i1Plus != row1.end()) {
1076+
if (i1Plus != row1.end())
10791077
++i1Plus;
1080-
}
10811078
}
10821079
}
10831080

impl/ocean/cv/advanced/AdvancedFrameFilterSobel.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ void AdvancedFrameFilterSobel::filterHorizontalVerticalMaximum8Bit(const unsigne
2020
{
2121
ocean_assert(source && target);
2222

23-
if (worker) {
23+
if (worker)
2424
worker->executeFunction(Worker::Function::createStatic(&AdvancedFrameFilterSobel::filterHorizontalVerticalMaximum8Bit, source, target, width, height, depth, 0u, 0u), 0u, depth, 5u, 6u);
25-
} else {
25+
else
2626
filterHorizontalVerticalMaximum8Bit(source, target, width, height, depth, 0u, depth);
2727
}
28-
}
2928

3029
void AdvancedFrameFilterSobel::filterHorizontalVerticalMaximum8Bit(const unsigned char* source, unsigned short* target, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int firstFrame, const unsigned int numberFrames)
3130
{
@@ -38,9 +37,8 @@ void AdvancedFrameFilterSobel::filterHorizontalVerticalMaximum8Bit(const unsigne
3837
const unsigned int frameSize = width * height;
3938

4039
// set the first frame to zero
41-
if (beginFilterFrame == 1u) {
40+
if (beginFilterFrame == 1u)
4241
memset(target, 0, frameSize * sizeof(unsigned short));
43-
}
4442

4543
ocean_assert(beginFilterFrame >= 1u);
4644

@@ -152,10 +150,9 @@ void AdvancedFrameFilterSobel::filterHorizontalVerticalMaximum8Bit(const unsigne
152150
}
153151

154152
// set the last frame to zero
155-
if (endFilterFrame == depth - 1u) {
153+
if (endFilterFrame == depth - 1u)
156154
memset(target, 0, frameSize * sizeof(unsigned short));
157155
}
158-
}
159156

160157
}
161158

0 commit comments

Comments
 (0)