Fix darwin namespace-comments and brace lint issues (flutter/engine#29828)

This commit is contained in:
Jenn Magder
2021-11-18 21:06:56 -08:00
committed by GitHub
parent 5291ff4193
commit b39436f7e5
9 changed files with 31 additions and 18 deletions

View File

@@ -229,14 +229,18 @@ class BoundsAccumulator {
public:
void accumulate(const SkPoint& p) { accumulate(p.fX, p.fY); }
void accumulate(SkScalar x, SkScalar y) {
if (min_x_ > x)
if (min_x_ > x) {
min_x_ = x;
if (min_y_ > y)
}
if (min_y_ > y) {
min_y_ = y;
if (max_x_ < x)
}
if (max_x_ < x) {
max_x_ = x;
if (max_y_ < y)
}
if (max_y_ < y) {
max_y_ = y;
}
}
void accumulate(const SkRect& r) {
if (r.fLeft <= r.fRight && r.fTop <= r.fBottom) {

View File

@@ -182,13 +182,15 @@ inline CommandLine CommandLineFromIteratorsFindFirstPositionalArg(
InputIterator first,
InputIterator last,
InputIterator* first_positional_arg) {
if (first_positional_arg)
if (first_positional_arg) {
*first_positional_arg = last;
}
internal::CommandLineBuilder builder;
for (auto it = first; it < last; ++it) {
if (builder.ProcessArg(*it)) {
if (first_positional_arg)
if (first_positional_arg) {
*first_positional_arg = it;
}
}
}
return builder.Build();
@@ -213,8 +215,9 @@ inline CommandLine CommandLineFromIteratorsWithArgv0(const std::string& argv0,
InputIterator last) {
internal::CommandLineBuilder builder;
builder.ProcessArg(argv0);
for (auto it = first; it < last; ++it)
for (auto it = first; it < last; ++it) {
builder.ProcessArg(*it);
}
return builder.Build();
}

View File

@@ -69,8 +69,9 @@ class RefCountedThreadSafe : public internal::RefCountedThreadSafeBase {
// Releases a reference to this object. This will destroy this object once the
// last reference is released.
void Release() const {
if (internal::RefCountedThreadSafeBase::Release())
if (internal::RefCountedThreadSafeBase::Release()) {
delete static_cast<const T*>(this);
}
}
// Returns true if there is exactly one reference to this object. Use of this

View File

@@ -30,18 +30,21 @@ class ScopedBlock {
explicit ScopedBlock(B block = nullptr,
OwnershipPolicy policy = OwnershipPolicy::Assume)
: block_(block) {
if (block_ && policy == OwnershipPolicy::Retain)
if (block_ && policy == OwnershipPolicy::Retain) {
block_ = Block_copy(block);
}
}
ScopedBlock(const ScopedBlock<B>& that) : block_(that.block_) {
if (block_)
if (block_) {
block_ = Block_copy(block_);
}
}
~ScopedBlock() {
if (block_)
if (block_) {
Block_release(block_);
}
}
ScopedBlock& operator=(const ScopedBlock<B>& that) {
@@ -51,10 +54,12 @@ class ScopedBlock {
void reset(B block = nullptr,
OwnershipPolicy policy = OwnershipPolicy::Assume) {
if (block && policy == OwnershipPolicy::Retain)
if (block && policy == OwnershipPolicy::Retain) {
block = Block_copy(block);
if (block_)
}
if (block_) {
Block_release(block_);
}
block_ = block;
}

View File

@@ -29,7 +29,7 @@ class MachThreads {
FML_DISALLOW_COPY_AND_ASSIGN(MachThreads);
};
}
} // namespace
namespace flutter {
namespace {

View File

@@ -22,4 +22,4 @@ bool IOSSwitchableGLContext::RemoveCurrent() {
FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker);
return [EAGLContext setCurrentContext:previous_context_];
};
}
} // namespace flutter

View File

@@ -38,4 +38,4 @@ TEST(FlutterFrameBufferProviderTest, TestCreate) {
EXPECT_TRUE(status == GL_FRAMEBUFFER_COMPLETE);
}
} // flutter::testing
} // namespace flutter::testing

View File

@@ -26,4 +26,4 @@ TEST(FlutterGLCompositorTest, TestPresent) {
ASSERT_TRUE(flag);
}
} // flutter::testing
} // namespace flutter::testing

View File

@@ -68,4 +68,4 @@ TEST(FlutterMetalCompositorTest, TestCompositing) {
ASSERT_EQ(texture.height, 600u);
}
} // flutter::testing
} // namespace flutter::testing