Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit be90369

Browse files
authored
Fix darwin namespace-comments and brace lint issues (#29828)
1 parent d581efc commit be90369

File tree

9 files changed

+31
-18
lines changed

9 files changed

+31
-18
lines changed

flow/display_list_utils.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,18 @@ class BoundsAccumulator {
229229
public:
230230
void accumulate(const SkPoint& p) { accumulate(p.fX, p.fY); }
231231
void accumulate(SkScalar x, SkScalar y) {
232-
if (min_x_ > x)
232+
if (min_x_ > x) {
233233
min_x_ = x;
234-
if (min_y_ > y)
234+
}
235+
if (min_y_ > y) {
235236
min_y_ = y;
236-
if (max_x_ < x)
237+
}
238+
if (max_x_ < x) {
237239
max_x_ = x;
238-
if (max_y_ < y)
240+
}
241+
if (max_y_ < y) {
239242
max_y_ = y;
243+
}
240244
}
241245
void accumulate(const SkRect& r) {
242246
if (r.fLeft <= r.fRight && r.fTop <= r.fBottom) {

fml/command_line.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,15 @@ inline CommandLine CommandLineFromIteratorsFindFirstPositionalArg(
182182
InputIterator first,
183183
InputIterator last,
184184
InputIterator* first_positional_arg) {
185-
if (first_positional_arg)
185+
if (first_positional_arg) {
186186
*first_positional_arg = last;
187+
}
187188
internal::CommandLineBuilder builder;
188189
for (auto it = first; it < last; ++it) {
189190
if (builder.ProcessArg(*it)) {
190-
if (first_positional_arg)
191+
if (first_positional_arg) {
191192
*first_positional_arg = it;
193+
}
192194
}
193195
}
194196
return builder.Build();
@@ -213,8 +215,9 @@ inline CommandLine CommandLineFromIteratorsWithArgv0(const std::string& argv0,
213215
InputIterator last) {
214216
internal::CommandLineBuilder builder;
215217
builder.ProcessArg(argv0);
216-
for (auto it = first; it < last; ++it)
218+
for (auto it = first; it < last; ++it) {
217219
builder.ProcessArg(*it);
220+
}
218221
return builder.Build();
219222
}
220223

fml/memory/ref_counted.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ class RefCountedThreadSafe : public internal::RefCountedThreadSafeBase {
6969
// Releases a reference to this object. This will destroy this object once the
7070
// last reference is released.
7171
void Release() const {
72-
if (internal::RefCountedThreadSafeBase::Release())
72+
if (internal::RefCountedThreadSafeBase::Release()) {
7373
delete static_cast<const T*>(this);
74+
}
7475
}
7576

7677
// Returns true if there is exactly one reference to this object. Use of this

fml/platform/darwin/scoped_block.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,21 @@ class ScopedBlock {
3030
explicit ScopedBlock(B block = nullptr,
3131
OwnershipPolicy policy = OwnershipPolicy::Assume)
3232
: block_(block) {
33-
if (block_ && policy == OwnershipPolicy::Retain)
33+
if (block_ && policy == OwnershipPolicy::Retain) {
3434
block_ = Block_copy(block);
35+
}
3536
}
3637

3738
ScopedBlock(const ScopedBlock<B>& that) : block_(that.block_) {
38-
if (block_)
39+
if (block_) {
3940
block_ = Block_copy(block_);
41+
}
4042
}
4143

4244
~ScopedBlock() {
43-
if (block_)
45+
if (block_) {
4446
Block_release(block_);
47+
}
4548
}
4649

4750
ScopedBlock& operator=(const ScopedBlock<B>& that) {
@@ -51,10 +54,12 @@ class ScopedBlock {
5154

5255
void reset(B block = nullptr,
5356
OwnershipPolicy policy = OwnershipPolicy::Assume) {
54-
if (block && policy == OwnershipPolicy::Retain)
57+
if (block && policy == OwnershipPolicy::Retain) {
5558
block = Block_copy(block);
56-
if (block_)
59+
}
60+
if (block_) {
5761
Block_release(block_);
62+
}
5863
block_ = block;
5964
}
6065

shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
FML_DISALLOW_COPY_AND_ASSIGN(MachThreads);
3030
};
3131

32-
}
32+
} // namespace
3333

3434
namespace flutter {
3535
namespace {

shell/platform/darwin/ios/ios_switchable_gl_context.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker);
2323
return [EAGLContext setCurrentContext:previous_context_];
2424
};
25-
}
25+
} // namespace flutter

shell/platform/darwin/macos/framework/Source/FlutterFrameBufferProviderUnittests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
EXPECT_TRUE(status == GL_FRAMEBUFFER_COMPLETE);
3939
}
4040

41-
} // flutter::testing
41+
} // namespace flutter::testing

shell/platform/darwin/macos/framework/Source/FlutterGLCompositorUnittests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
ASSERT_TRUE(flag);
2727
}
2828

29-
} // flutter::testing
29+
} // namespace flutter::testing

shell/platform/darwin/macos/framework/Source/FlutterMetalCompositorUnittests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@
6868
ASSERT_EQ(texture.height, 600u);
6969
}
7070

71-
} // flutter::testing
71+
} // namespace flutter::testing

0 commit comments

Comments
 (0)