Fix cpplint build/namespaces issues
Change-Id: I19c68703270c1482d6c6aad8cdf97d3d2924360a
diff --git a/runtime/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc
index 91c9253..940ed13 100644
--- a/runtime/gc/accounting/mod_union_table.cc
+++ b/runtime/gc/accounting/mod_union_table.cc
@@ -30,7 +30,7 @@
#include "thread.h"
#include "UniquePtr.h"
-using namespace art::mirror;
+using ::art::mirror::Object;
namespace art {
namespace gc {
@@ -141,7 +141,7 @@
class AddToReferenceArrayVisitor {
public:
explicit AddToReferenceArrayVisitor(ModUnionTableReferenceCache* mod_union_table,
- std::vector<const mirror::Object*>* references)
+ std::vector<const Object*>* references)
: mod_union_table_(mod_union_table),
references_(references) {
}
@@ -157,13 +157,13 @@
private:
ModUnionTableReferenceCache* const mod_union_table_;
- std::vector<const mirror::Object*>* const references_;
+ std::vector<const Object*>* const references_;
};
class ModUnionReferenceVisitor {
public:
explicit ModUnionReferenceVisitor(ModUnionTableReferenceCache* const mod_union_table,
- std::vector<const mirror::Object*>* references)
+ std::vector<const Object*>* references)
: mod_union_table_(mod_union_table),
references_(references) {
}
@@ -178,7 +178,7 @@
}
private:
ModUnionTableReferenceCache* const mod_union_table_;
- std::vector<const mirror::Object*>* const references_;
+ std::vector<const Object*>* const references_;
};
class CheckReferenceVisitor {
@@ -237,8 +237,8 @@
void ModUnionTableReferenceCache::Verify() {
// Start by checking that everything in the mod union table is marked.
Heap* heap = GetHeap();
- typedef SafeMap<const byte*, std::vector<const mirror::Object*> >::const_iterator It;
- typedef std::vector<const mirror::Object*>::const_iterator It2;
+ typedef SafeMap<const byte*, std::vector<const Object*> >::const_iterator It;
+ typedef std::vector<const Object*>::const_iterator It2;
for (It it = references_.begin(), end = references_.end(); it != end; ++it) {
for (It2 it_ref = it->second.begin(), end_ref = it->second.end(); it_ref != end_ref;
++it_ref ) {
@@ -277,13 +277,13 @@
os << reinterpret_cast<void*>(start) << "-" << reinterpret_cast<void*>(end) << ",";
}
os << "]\nModUnionTable references: [";
- typedef SafeMap<const byte*, std::vector<const mirror::Object*> >::const_iterator It2;
+ typedef SafeMap<const byte*, std::vector<const Object*> >::const_iterator It2;
for (It2 it = references_.begin(); it != references_.end(); ++it) {
const byte* card = &*it->first;
uintptr_t start = reinterpret_cast<uintptr_t>(card_table->AddrFromCard(card));
uintptr_t end = start + CardTable::kCardSize;
os << reinterpret_cast<void*>(start) << "-" << reinterpret_cast<void*>(end) << "->{";
- typedef std::vector<const mirror::Object*>::const_iterator It3;
+ typedef std::vector<const Object*>::const_iterator It3;
for (It3 itr = it->second.begin(); itr != it->second.end();++itr) {
os << reinterpret_cast<const void*>(*itr) << ",";
}
@@ -295,7 +295,7 @@
Heap* heap = GetHeap();
CardTable* card_table = heap->GetCardTable();
- std::vector<const mirror::Object*> cards_references;
+ std::vector<const Object*> cards_references;
ModUnionReferenceVisitor visitor(this, &cards_references);
typedef std::set<byte*>::iterator It;
@@ -311,7 +311,7 @@
// Update the corresponding references for the card.
// TODO: C++0x auto
- SafeMap<const byte*, std::vector<const mirror::Object*> >::iterator
+ SafeMap<const byte*, std::vector<const Object*> >::iterator
found = references_.find(card);
if (found == references_.end()) {
if (cards_references.empty()) {
@@ -330,9 +330,9 @@
// TODO: C++0x auto
size_t count = 0;
- typedef SafeMap<const byte*, std::vector<const mirror::Object*> >::const_iterator It;
+ typedef SafeMap<const byte*, std::vector<const Object*> >::const_iterator It;
for (It it = references_.begin(); it != references_.end(); ++it) {
- typedef std::vector<const mirror::Object*>::const_iterator It2;
+ typedef std::vector<const Object*>::const_iterator It2;
for (It2 it_ref = it->second.begin(); it_ref != it->second.end(); ++it_ref) {
mark_sweep->MarkRoot(*it_ref);
++count;
diff --git a/runtime/gc/allocator/dlmalloc.cc b/runtime/gc/allocator/dlmalloc.cc
index 7725215..3cc64e9 100644
--- a/runtime/gc/allocator/dlmalloc.cc
+++ b/runtime/gc/allocator/dlmalloc.cc
@@ -50,17 +50,16 @@
#include "utils.h"
#include <sys/mman.h>
-using namespace art;
extern "C" void DlmallocMadviseCallback(void* start, void* end, size_t used_bytes, void* arg) {
// Is this chunk in use?
if (used_bytes != 0) {
return;
}
// Do we have any whole pages to give back?
- start = reinterpret_cast<void*>(RoundUp(reinterpret_cast<uintptr_t>(start), kPageSize));
- end = reinterpret_cast<void*>(RoundDown(reinterpret_cast<uintptr_t>(end), kPageSize));
+ start = reinterpret_cast<void*>(art::RoundUp(reinterpret_cast<uintptr_t>(start), art::kPageSize));
+ end = reinterpret_cast<void*>(art::RoundDown(reinterpret_cast<uintptr_t>(end), art::kPageSize));
if (end > start) {
- size_t length = reinterpret_cast<byte*>(end) - reinterpret_cast<byte*>(start);
+ size_t length = reinterpret_cast<uint8_t*>(end) - reinterpret_cast<uint8_t*>(start);
int rc = madvise(start, length, MADV_DONTNEED);
if (UNLIKELY(rc != 0)) {
errno = rc;
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 2ca5f2d..2d07f062 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -50,7 +50,10 @@
#include "thread_list.h"
#include "verifier/method_verifier.h"
-using namespace art::mirror;
+using ::art::mirror::Class;
+using ::art::mirror::Field;
+using ::art::mirror::Object;
+using ::art::mirror::ObjectArray;
namespace art {
namespace gc {