summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-18 18:04:08 -0700
committerBrian Carlstrom <bdc@google.com>2013-07-18 18:10:42 -0700
commit4274889d48ef82369bf2c1ca70d84689b4f9e93a (patch)
tree9cc958f16e27ef3d6f50978c1024f79d7a56a725
parent2d88862f0752a7a0e65145b088f49dabd49d4284 (diff)
downloadart-4274889d48ef82369bf2c1ca70d84689b4f9e93a.zip
art-4274889d48ef82369bf2c1ca70d84689b4f9e93a.tar.gz
art-4274889d48ef82369bf2c1ca70d84689b4f9e93a.tar.bz2
Fixing cpplint readability/check issues
Change-Id: Ia81db7238b4a13ff2e585aaac9d5e3e91df1e3e0
-rw-r--r--Android.mk2
-rw-r--r--compiler/dex/mir_graph.cc2
-rw-r--r--compiler/dex/quick/arm/int_arm.cc4
-rw-r--r--compiler/llvm/gbc_expander.cc6
-rw-r--r--runtime/gc/accounting/space_bitmap_test.cc2
-rw-r--r--runtime/gc/heap.cc2
-rw-r--r--runtime/gc/space/dlmalloc_space.cc4
-rw-r--r--runtime/gc/space/large_object_space.cc2
-rw-r--r--runtime/jdwp/jdwp_adb.cc4
-rw-r--r--runtime/jdwp/jdwp_socket.cc4
-rw-r--r--runtime/oat/runtime/support_instrumentation.cc2
11 files changed, 17 insertions, 17 deletions
diff --git a/Android.mk b/Android.mk
index 8331b69..94b7a65 100644
--- a/Android.mk
+++ b/Android.mk
@@ -334,7 +334,7 @@ endif
.PHONY: cpplint-art
cpplint-art:
./art/tools/cpplint.py \
- --filter=-,+build/header_guard,+whitespace/braces,+whitespace/comma,+runtime/explicit,+whitespace/newline,+whitespace/parens,+build/namespaces,+readability/fn_size,+whitespace/operators,+readability/braces,+whitespace/indent,+whitespace/blank_line,+whitespace/end_of_line,+whitespace/labels,+whitespace/semicolon,+legal/copyright,+readability/casting \
+ --filter=-,+build/header_guard,+whitespace/braces,+whitespace/comma,+runtime/explicit,+whitespace/newline,+whitespace/parens,+build/namespaces,+readability/fn_size,+whitespace/operators,+readability/braces,+whitespace/indent,+whitespace/blank_line,+whitespace/end_of_line,+whitespace/labels,+whitespace/semicolon,+legal/copyright,+readability/casting,+readability/check \
$(shell find art -name *.h -o -name *$(ART_CPP_EXTENSION) | grep -v art/compiler/llvm/generated/)
# "mm cpplint-art-aspirational" to see warnings we would like to fix
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index c2ee8e8..90e68ab 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -543,7 +543,7 @@ void MIRGraph::InlineMethod(const DexFile::CodeItem* code_item, uint32_t access_
if (current_method_ == 0) {
DCHECK(entry_block_ == NULL);
DCHECK(exit_block_ == NULL);
- DCHECK(num_blocks_ == 0);
+ DCHECK_EQ(num_blocks_, 0);
entry_block_ = NewMemBB(kEntryBlock, num_blocks_++);
exit_block_ = NewMemBB(kExitBlock, num_blocks_++);
block_list_.Insert(entry_block_);
diff --git a/compiler/dex/quick/arm/int_arm.cc b/compiler/dex/quick/arm/int_arm.cc
index 3a367c9..15d361e 100644
--- a/compiler/dex/quick/arm/int_arm.cc
+++ b/compiler/dex/quick/arm/int_arm.cc
@@ -121,8 +121,8 @@ void ArmMir2Lir::GenFusedLongCmpImmBranch(BasicBlock* bb, RegLocation rl_src1,
int64_t val, ConditionCode ccode) {
int32_t val_lo = Low32Bits(val);
int32_t val_hi = High32Bits(val);
- DCHECK(ModifiedImmediate(val_lo) >= 0);
- DCHECK(ModifiedImmediate(val_hi) >= 0);
+ DCHECK_GE(ModifiedImmediate(val_lo), 0);
+ DCHECK_GE(ModifiedImmediate(val_hi), 0);
LIR* taken = &block_label_list_[bb->taken->id];
LIR* not_taken = &block_label_list_[bb->fall_through->id];
rl_src1 = LoadValueWide(rl_src1, kCoreReg);
diff --git a/compiler/llvm/gbc_expander.cc b/compiler/llvm/gbc_expander.cc
index a7793ae..c990ee6 100644
--- a/compiler/llvm/gbc_expander.cc
+++ b/compiler/llvm/gbc_expander.cc
@@ -873,7 +873,7 @@ llvm::Value* GBCExpanderPass::EmitInvoke(llvm::CallInst& call_inst) {
break;
case art::kVirtual:
- DCHECK(vtable_idx != -1);
+ DCHECK_NE(vtable_idx, -1);
callee_method_object_addr =
EmitLoadVirtualCalleeMethodObjectAddr(vtable_idx, this_addr);
break;
@@ -1073,7 +1073,7 @@ void GBCExpanderPass::Expand_FilledNewArray(llvm::CallInst& call_inst) {
uint32_t element_jty =
llvm::cast<llvm::ConstantInt>(call_inst.getArgOperand(1))->getZExtValue();
- DCHECK(call_inst.getNumArgOperands() > 2);
+ DCHECK_GT(call_inst.getNumArgOperands(), 2U);
unsigned num_elements = (call_inst.getNumArgOperands() - 2);
bool is_elem_int_ty = (static_cast<JType>(element_jty) == kInt);
@@ -3698,7 +3698,7 @@ GBCExpanderPass::ExpandIntrinsic(IntrinsicHelper::IntrinsicId intr_id,
irb_.getJDoubleTy());
}
case IntrinsicHelper::ConstObj: {
- CHECK(LV2UInt(call_inst.getArgOperand(0)) == 0);
+ CHECK_EQ(LV2UInt(call_inst.getArgOperand(0)), 0U);
return irb_.getJNull();
}
diff --git a/runtime/gc/accounting/space_bitmap_test.cc b/runtime/gc/accounting/space_bitmap_test.cc
index 806f301..e70704f 100644
--- a/runtime/gc/accounting/space_bitmap_test.cc
+++ b/runtime/gc/accounting/space_bitmap_test.cc
@@ -49,7 +49,7 @@ class BitmapVerify {
void operator()(const mirror::Object* obj) {
EXPECT_TRUE(obj >= begin_);
EXPECT_TRUE(obj <= end_);
- EXPECT_TRUE(bitmap_->Test(obj) == ((reinterpret_cast<uintptr_t>(obj) & 0xF) != 0));
+ EXPECT_EQ(bitmap_->Test(obj), ((reinterpret_cast<uintptr_t>(obj) & 0xF) != 0));
}
SpaceBitmap* bitmap_;
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 341b62f..dd76f3e 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -210,7 +210,7 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max
mark_sweep_collectors_.push_back(new collector::StickyMarkSweep(this, concurrent));
}
- CHECK(max_allowed_footprint_ != 0);
+ CHECK_NE(max_allowed_footprint_, 0U);
if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) {
LOG(INFO) << "Heap() exiting";
}
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc
index 02acd28..9f85394 100644
--- a/runtime/gc/space/dlmalloc_space.cc
+++ b/runtime/gc/space/dlmalloc_space.cc
@@ -131,8 +131,8 @@ DlMallocSpace::DlMallocSpace(const std::string& name, MemMap* mem_map, void* msp
size_t bitmap_index = bitmap_index_++;
static const uintptr_t kGcCardSize = static_cast<uintptr_t>(accounting::CardTable::kCardSize);
- CHECK(reinterpret_cast<uintptr_t>(mem_map->Begin()) % kGcCardSize == 0);
- CHECK(reinterpret_cast<uintptr_t>(mem_map->End()) % kGcCardSize == 0);
+ CHECK_EQ(reinterpret_cast<uintptr_t>(mem_map->Begin()) % kGcCardSize, 0U);
+ CHECK_EQ(reinterpret_cast<uintptr_t>(mem_map->End()) % kGcCardSize, 0U);
live_bitmap_.reset(accounting::SpaceBitmap::Create(
StringPrintf("allocspace %s live-bitmap %d", name.c_str(), static_cast<int>(bitmap_index)),
Begin(), Capacity()));
diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc
index 6aedd9c..d7db561 100644
--- a/runtime/gc/space/large_object_space.cc
+++ b/runtime/gc/space/large_object_space.cc
@@ -125,7 +125,7 @@ bool LargeObjectMapSpace::Contains(const mirror::Object* obj) const {
}
FreeListSpace* FreeListSpace::Create(const std::string& name, byte* requested_begin, size_t size) {
- CHECK(size % kAlignment == 0);
+ CHECK_EQ(size % kAlignment, 0U);
MemMap* mem_map = MemMap::MapAnonymous(name.c_str(), requested_begin, size,
PROT_READ | PROT_WRITE);
CHECK(mem_map != NULL) << "Failed to allocate large object space mem map";
diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc
index 2bfe63e..cbf35be 100644
--- a/runtime/jdwp/jdwp_adb.cc
+++ b/runtime/jdwp/jdwp_adb.cc
@@ -297,7 +297,7 @@ bool JdwpAdbState::Accept() {
bool JdwpAdbState::ProcessIncoming() {
int readCount;
- CHECK(clientSock != -1);
+ CHECK_NE(clientSock, -1);
if (!HaveFullPacket()) {
/* read some more, looping until we have data */
@@ -371,7 +371,7 @@ bool JdwpAdbState::ProcessIncoming() {
LOG(INFO) << "Ignoring second debugger -- accepting and dropping";
close(sock);
} else {
- CHECK(control_sock_ == -1);
+ CHECK_EQ(control_sock_, -1);
/*
* Remote side most likely went away, so our next read
* on clientSock will fail and throw us out of the loop.
diff --git a/runtime/jdwp/jdwp_socket.cc b/runtime/jdwp/jdwp_socket.cc
index 87706a4..3f5546e 100644
--- a/runtime/jdwp/jdwp_socket.cc
+++ b/runtime/jdwp/jdwp_socket.cc
@@ -218,7 +218,7 @@ bool JdwpSocketState::Accept() {
return false; /* you're not listening! */
}
- CHECK(clientSock == -1); /* must not already be talking */
+ CHECK_EQ(clientSock, -1); /* must not already be talking */
addrlen = sizeof(addr);
do {
@@ -348,7 +348,7 @@ bool JdwpSocketState::Establish(const JdwpOptions* options) {
bool JdwpSocketState::ProcessIncoming() {
int readCount;
- CHECK(clientSock != -1);
+ CHECK_NE(clientSock, -1);
if (!HaveFullPacket()) {
/* read some more, looping until we have data */
diff --git a/runtime/oat/runtime/support_instrumentation.cc b/runtime/oat/runtime/support_instrumentation.cc
index 1f1b952..7ecd296 100644
--- a/runtime/oat/runtime/support_instrumentation.cc
+++ b/runtime/oat/runtime/support_instrumentation.cc
@@ -51,7 +51,7 @@ extern "C" uint64_t artInstrumentationMethodExitFromCode(Thread* self, mirror::A
*sp = callee_save;
uintptr_t* return_pc = reinterpret_cast<uintptr_t*>(reinterpret_cast<byte*>(sp) +
callee_save->GetReturnPcOffsetInBytes());
- CHECK(*return_pc == 0);
+ CHECK_EQ(*return_pc, 0U);
self->SetTopOfStack(sp, 0);
self->VerifyStack();
instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();