diff options
author | 2011-10-17 18:56:41 -0700 | |
---|---|---|
committer | 2011-10-17 20:26:54 -0700 | |
commit | 362f9bc807169bcfc8761dde067bbfb79b5ad0fd (patch) | |
tree | 100689aa13a39913b43cb12780ba472897cd665a | |
parent | fc86162ce2a3467acb690e18cc8bd9b3daafc606 (diff) |
Fix cpplint's whitespace warnings.
Change-Id: I16b69d773e59b49e8e30227b5aa5cb1959a8930f
42 files changed, 115 insertions, 164 deletions
diff --git a/Android.mk b/Android.mk index a1124ce027..59a4f50a5a 100644 --- a/Android.mk +++ b/Android.mk @@ -250,7 +250,7 @@ dump-oat-Calculator: $(call art-cache-oat,system/app/Calculator.oat) $(TARGET_BO cpplint-art: ./art/tools/cpplint.py \ --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/streams,-readability/todo,-runtime/references \ - art/src/*.h art/src/*.cc + $(ANDROID_BUILD_TOP)/art/src/*.h $(ANDROID_BUILD_TOP)/art/src/*.cc ######################################################################## diff --git a/src/assembler_arm.cc b/src/assembler_arm.cc index ac39f2e141..a36e84def7 100644 --- a/src/assembler_arm.cc +++ b/src/assembler_arm.cc @@ -1532,10 +1532,9 @@ void ArmAssembler::LoadRef(ManagedRegister mdest, ManagedRegister base, void ArmAssembler::LoadRef(ManagedRegister mdest, FrameOffset src) { ArmManagedRegister dest = mdest.AsArm(); - CHECK(dest.IsCoreRegister()); - LoadFromOffset(kLoadWord, dest.AsCoreRegister(), - SP, src.Int32Value()); - } + CHECK(dest.IsCoreRegister()); + LoadFromOffset(kLoadWord, dest.AsCoreRegister(), SP, src.Int32Value()); +} void ArmAssembler::LoadRawPtr(ManagedRegister mdest, ManagedRegister base, Offset offs) { diff --git a/src/atomic.cc b/src/atomic.cc index c373579ee2..e4252fd7b0 100644 --- a/src/atomic.cc +++ b/src/atomic.cc @@ -82,7 +82,7 @@ static inline int64_t QuasiAtomicSwap64Impl(int64_t new_value, volatile int64_t* int64_t prev; int status; do { - __asm__ __volatile__ ("@ QuasiAtomicSwap64\n" + __asm__ __volatile__("@ QuasiAtomicSwap64\n" "ldrexd %0, %H0, [%3]\n" "strexd %1, %4, %H4, [%3]" : "=&r" (prev), "=&r" (status), "+m"(*addr) @@ -107,7 +107,7 @@ int QuasiAtomicCas64(int64_t old_value, int64_t new_value, volatile int64_t* add int64_t prev; int status; do { - __asm__ __volatile__ ("@ QuasiAtomicCas64\n" + __asm__ __volatile__("@ QuasiAtomicCas64\n" "ldrexd %0, %H0, [%3]\n" "mov %1, #0\n" "teq %0, %4\n" @@ -122,7 +122,7 @@ int QuasiAtomicCas64(int64_t old_value, int64_t new_value, volatile int64_t* add int64_t QuasiAtomicRead64(volatile const int64_t* addr) { int64_t value; - __asm__ __volatile__ ("@ QuasiAtomicRead64\n" + __asm__ __volatile__("@ QuasiAtomicRead64\n" "ldrexd %0, %H0, [%1]" : "=&r" (value) : "r" (addr)); diff --git a/src/base64.cc b/src/base64.cc index 49663141d0..1709946e50 100644 --- a/src/base64.cc +++ b/src/base64.cc @@ -73,4 +73,4 @@ byte* DecodeBase64(const char* src, size_t* dst_size) { return dst.release(); } -}; +} // namespace art diff --git a/src/calling_convention_arm.cc b/src/calling_convention_arm.cc index 29003a26b2..89d41700f8 100644 --- a/src/calling_convention_arm.cc +++ b/src/calling_convention_arm.cc @@ -106,7 +106,7 @@ ArmJniCallingConvention::ArmJniCallingConvention(const Method* method) // due to padding appearing in the registers size_t padding = 0; size_t check = method->IsStatic() ? 1 : 0; - for(size_t i = 0; i < method->NumArgs(); i++) { + for (size_t i = 0; i < method->NumArgs(); i++) { if (((i & 1) == check) && method->IsParamALongOrDouble(i)) { padding += 4; } diff --git a/src/check_jni.cc b/src/check_jni.cc index a1a8a18d03..c740291844 100644 --- a/src/check_jni.cc +++ b/src/check_jni.cc @@ -898,7 +898,7 @@ private: sc.Check(true, types, ##args) #define CHECK_JNI_EXIT(type, exp) ({ \ - typeof (exp) _rc = (exp); \ + typeof(exp) _rc = (exp); \ sc.Check(false, type, _rc); \ _rc; }) #define CHECK_JNI_EXIT_VOID() \ diff --git a/src/class_linker.cc b/src/class_linker.cc index 86f2769a92..94011b2375 100644 --- a/src/class_linker.cc +++ b/src/class_linker.cc @@ -31,7 +31,7 @@ namespace art { namespace { -void ThrowNoClassDefFoundError(const char* fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); +void ThrowNoClassDefFoundError(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2))); void ThrowNoClassDefFoundError(const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -39,7 +39,7 @@ void ThrowNoClassDefFoundError(const char* fmt, ...) { va_end(args); } -void ThrowClassFormatError(const char* fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); +void ThrowClassFormatError(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2))); void ThrowClassFormatError(const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -47,7 +47,7 @@ void ThrowClassFormatError(const char* fmt, ...) { va_end(args); } -void ThrowLinkageError(const char* fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); +void ThrowLinkageError(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2))); void ThrowLinkageError(const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -116,7 +116,7 @@ void WrapExceptionInInitializer() { env->Throw(eiie.get()); } -} +} // namespace const char* ClassLinker::class_roots_descriptors_[] = { "Ljava/lang/Class;", @@ -2325,7 +2325,6 @@ bool ClassLinker::LinkStaticFields(Class* klass) { struct LinkFieldsComparator { bool operator()(const Field* field1, const Field* field2) { - // First come reference fields, then 64-bit, and finally 32-bit const Class* type1 = field1->GetTypeDuringLinking(); const Class* type2 = field2->GetTypeDuringLinking(); diff --git a/src/class_linker_test.cc b/src/class_linker_test.cc index 58f36f1a1a..75f2740357 100644 --- a/src/class_linker_test.cc +++ b/src/class_linker_test.cc @@ -228,7 +228,7 @@ class ClassLinkerTest : public CommonTest { Field* field = klass->GetStaticField(i); AssertField(klass, field); EXPECT_TRUE(field->IsStatic()); - } + } // Confirm that all instances fields are packed together at the start EXPECT_GE(klass->NumInstanceFields(), klass->NumReferenceInstanceFields()); @@ -388,7 +388,6 @@ struct CheckOffsets { struct ObjectOffsets : public CheckOffsets<Object> { ObjectOffsets() : CheckOffsets<Object>(false, "Ljava/lang/Object;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Object, klass_), "shadow$_klass_")); @@ -406,7 +405,6 @@ struct AccessibleObjectOffsets : public CheckOffsets<AccessibleObject> { struct FieldOffsets : public CheckOffsets<Field> { FieldOffsets() : CheckOffsets<Field>(false, "Ljava/lang/reflect/Field;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Field, declaring_class_), "declaringClass")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Field, generic_type_), "genericType")); @@ -424,7 +422,6 @@ struct FieldOffsets : public CheckOffsets<Field> { struct MethodOffsets : public CheckOffsets<Method> { MethodOffsets() : CheckOffsets<Method>(false, "Ljava/lang/reflect/Method;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Method, declaring_class_), "declaringClass")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Method, java_exception_types_), "exceptionTypes")); @@ -478,7 +475,6 @@ struct ConstructorOffsets : public MethodOffsets { struct ClassOffsets : public CheckOffsets<Class> { ClassOffsets() : CheckOffsets<Class>(false, "Ljava/lang/Class;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Class, name_), "name")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Class, class_loader_), "shadow$_class_loader_")); @@ -514,7 +510,6 @@ struct ClassOffsets : public CheckOffsets<Class> { struct StringOffsets : public CheckOffsets<String> { StringOffsets() : CheckOffsets<String>(false, "Ljava/lang/String;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(String, array_), "value")); @@ -527,7 +522,6 @@ struct StringOffsets : public CheckOffsets<String> { struct ThrowableOffsets : public CheckOffsets<Throwable> { ThrowableOffsets() : CheckOffsets<Throwable>(false, "Ljava/lang/Throwable;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Throwable, cause_), "cause")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Throwable, detail_message_), "detailMessage")); @@ -539,7 +533,6 @@ struct ThrowableOffsets : public CheckOffsets<Throwable> { struct StackTraceElementOffsets : public CheckOffsets<StackTraceElement> { StackTraceElementOffsets() : CheckOffsets<StackTraceElement>(false, "Ljava/lang/StackTraceElement;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(StackTraceElement, declaring_class_), "declaringClass")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(StackTraceElement, file_name_), "fileName")); @@ -550,7 +543,6 @@ struct StackTraceElementOffsets : public CheckOffsets<StackTraceElement> { struct ClassLoaderOffsets : public CheckOffsets<ClassLoader> { ClassLoaderOffsets() : CheckOffsets<ClassLoader>(false, "Ljava/lang/ClassLoader;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(ClassLoader, packages_), "packages")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(ClassLoader, parent_), "parent")); @@ -561,7 +553,6 @@ struct ClassLoaderOffsets : public CheckOffsets<ClassLoader> { struct BaseDexClassLoaderOffsets : public CheckOffsets<BaseDexClassLoader> { BaseDexClassLoaderOffsets() : CheckOffsets<BaseDexClassLoader>(false, "Ldalvik/system/BaseDexClassLoader;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(BaseDexClassLoader, original_path_), "originalPath")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(BaseDexClassLoader, path_list_), "pathList")); @@ -570,12 +561,11 @@ struct BaseDexClassLoaderOffsets : public CheckOffsets<BaseDexClassLoader> { struct PathClassLoaderOffsets : public CheckOffsets<PathClassLoader> { PathClassLoaderOffsets() - : CheckOffsets<PathClassLoader>(false, "Ldalvik/system/PathClassLoader;") {}; + : CheckOffsets<PathClassLoader>(false, "Ldalvik/system/PathClassLoader;") {} }; struct ProxyOffsets : public CheckOffsets<Proxy> { ProxyOffsets() : CheckOffsets<Proxy>(false, "Ljava/lang/reflect/Proxy;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(Proxy, h_), "h")); }; @@ -583,7 +573,6 @@ struct ProxyOffsets : public CheckOffsets<Proxy> { struct ClassClassOffsets : public CheckOffsets<ClassClass> { ClassClassOffsets() : CheckOffsets<ClassClass>(true, "Ljava/lang/Class;") { - // padding 32-bit CHECK_EQ(OFFSETOF_MEMBER(ClassClass, padding_) + 4, OFFSETOF_MEMBER(ClassClass, serialVersionUID_)); @@ -595,7 +584,6 @@ struct ClassClassOffsets : public CheckOffsets<ClassClass> { struct StringClassOffsets : public CheckOffsets<StringClass> { StringClassOffsets() : CheckOffsets<StringClass>(true, "Ljava/lang/String;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(StringClass, ASCII_), "ASCII")); offsets.push_back(CheckOffset(OFFSETOF_MEMBER(StringClass, CASE_INSENSITIVE_ORDER_), "CASE_INSENSITIVE_ORDER")); @@ -610,7 +598,6 @@ struct StringClassOffsets : public CheckOffsets<StringClass> { struct FieldClassOffsets : public CheckOffsets<FieldClass> { FieldClassOffsets() : CheckOffsets<FieldClass>(true, "Ljava/lang/reflect/Field;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(FieldClass, ORDER_BY_NAME_AND_DECLARING_CLASS_), "ORDER_BY_NAME_AND_DECLARING_CLASS")); @@ -628,7 +615,6 @@ struct FieldClassOffsets : public CheckOffsets<FieldClass> { struct MethodClassOffsets : public CheckOffsets<MethodClass> { MethodClassOffsets() : CheckOffsets<MethodClass>(true, "Ljava/lang/reflect/Method;") { - // alphabetical references offsets.push_back(CheckOffset(OFFSETOF_MEMBER(MethodClass, ORDER_BY_SIGNATURE_), "ORDER_BY_SIGNATURE")); }; @@ -636,7 +622,6 @@ struct MethodClassOffsets : public CheckOffsets<MethodClass> { struct ProxyClassOffsets : public CheckOffsets<ProxyClass> { ProxyClassOffsets() : CheckOffsets<ProxyClass>(true, "Ljava/lang/reflect/Proxy;") { - // alphabetical 32-bit offsets.push_back(CheckOffset(OFFSETOF_MEMBER(ProxyClass, NextClassNameIndex_), "NextClassNameIndex")); diff --git a/src/common_test.h b/src/common_test.h index c17417397f..fc02a49a78 100644 --- a/src/common_test.h +++ b/src/common_test.h @@ -197,14 +197,14 @@ class CommonTest : public testing::Test { #endif runtime_->SetJniStubArray(JniCompiler::CreateJniStub(instruction_set)); runtime_->SetAbstractMethodErrorStubArray(Compiler::CreateAbstractMethodErrorStub(instruction_set)); - for (int i=0; i < Runtime::kLastTrampolineMethodType; i++) { + for (int i = 0; i < Runtime::kLastTrampolineMethodType; i++) { Runtime::TrampolineType type = Runtime::TrampolineType(i); if (!runtime_->HasResolutionStubArray(type)) { runtime_->SetResolutionStubArray( Compiler::CreateResolutionStub(instruction_set, type), type); } } - for (int i=0; i < Runtime::kLastCalleeSaveType; i++) { + for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) { Runtime::CalleeSaveType type = Runtime::CalleeSaveType(i); if (!runtime_->HasCalleeSaveMethod(type)) { runtime_->SetCalleeSaveMethod( diff --git a/src/context_arm.cc b/src/context_arm.cc index 885a9bc96b..2f7274dbc6 100644 --- a/src/context_arm.cc +++ b/src/context_arm.cc @@ -11,10 +11,10 @@ namespace arm { ArmContext::ArmContext() { #ifndef NDEBUG // Initialize registers with easy to spot debug values - for (int i=0; i < 16; i++) { + for (int i = 0; i < 16; i++) { gprs_[i] = 0xEBAD6070+i; } - for (int i=0; i < 32; i++) { + for (int i = 0; i < 32; i++) { fprs_[i] = 0xEBAD8070+i; } #endif @@ -29,7 +29,7 @@ void ArmContext::FillCalleeSaves(const Frame& fr) { if (spill_count > 0) { // Lowest number spill is furthest away, walk registers and fill into context int j = 1; - for(int i = 0; i < 16; i++) { + for (int i = 0; i < 16; i++) { if (((core_spills >> i) & 1) != 0) { gprs_[i] = fr.LoadCalleeSave(spill_count - j); j++; @@ -39,7 +39,7 @@ void ArmContext::FillCalleeSaves(const Frame& fr) { if (fp_spill_count > 0) { // Lowest number spill is furthest away, walk registers and fill into context int j = 1; - for(int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { if (((fp_core_spills >> i) & 1) != 0) { fprs_[i] = fr.LoadCalleeSave(spill_count + fp_spill_count - j); j++; diff --git a/src/context_x86.cc b/src/context_x86.cc index 479b950b65..e7faa3abf2 100644 --- a/src/context_x86.cc +++ b/src/context_x86.cc @@ -25,7 +25,7 @@ void X86Context::FillCalleeSaves(const Frame& fr) { if (spill_count > 0) { // Lowest number spill is furthest away, walk registers and fill into context int j = 1; - for(int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { if (((core_spills >> i) & 1) != 0) { gprs_[i] = fr.LoadCalleeSave(spill_count - j); j++; @@ -39,7 +39,7 @@ void X86Context::DoLongJump() { // Load ESP and EIP gprs_[ESP] -= 4; // push EIP for return *((uintptr_t*)(gprs_[ESP])) = eip_; - asm volatile ( + asm volatile( "pushl %4\n\t" "pushl %0\n\t" "pushl %1\n\t" diff --git a/src/dalvik_system_Zygote.cc b/src/dalvik_system_Zygote.cc index 7c0b6a630c..a0fd4290d6 100644 --- a/src/dalvik_system_Zygote.cc +++ b/src/dalvik_system_Zygote.cc @@ -108,7 +108,7 @@ void setSigchldHandler() { memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigchldHandler; - int err = sigaction (SIGCHLD, &sa, NULL); + int err = sigaction(SIGCHLD, &sa, NULL); if (err < 0) { PLOG(WARNING) << "Error setting SIGCHLD handler"; } @@ -120,7 +120,7 @@ void unsetSigchldHandler() { memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_DFL; - int err = sigaction (SIGCHLD, &sa, NULL); + int err = sigaction(SIGCHLD, &sa, NULL); if (err < 0) { PLOG(WARNING) << "Error unsetting SIGCHLD handler"; } diff --git a/src/dex2oat.cc b/src/dex2oat.cc index ad140ecec3..aca8e8ce4d 100644 --- a/src/dex2oat.cc +++ b/src/dex2oat.cc @@ -126,18 +126,18 @@ int dex2oat(int argc, char** argv) { } if (oat_filename == NULL) { - fprintf(stderr, "--oat file name not specified\n"); - return EXIT_FAILURE; + fprintf(stderr, "--oat file name not specified\n"); + return EXIT_FAILURE; } if (image_filename == NULL && boot_image_option.empty()) { - fprintf(stderr, "Either --image or --boot-image must be specified\n"); - return EXIT_FAILURE; + fprintf(stderr, "Either --image or --boot-image must be specified\n"); + return EXIT_FAILURE; } if (dex_filenames.empty()) { - fprintf(stderr, "no --dex-file values specified\n"); - return EXIT_FAILURE; + fprintf(stderr, "no --dex-file values specified\n"); + return EXIT_FAILURE; } if (boot_image_option.empty()) { diff --git a/src/dex_cache.h b/src/dex_cache.h index a9776b7a55..ee1731a8de 100644 --- a/src/dex_cache.h +++ b/src/dex_cache.h @@ -55,9 +55,9 @@ class MANAGED CodeAndDirectMethods : public IntArray { return (CodeIndex(method_idx) * sizeof(ElementType) + Array::DataOffset().Int32Value()); } - size_t NumCodeAndDirectMethods() const { - return GetLength() / kMax; - } + size_t NumCodeAndDirectMethods() const { + return GetLength() / kMax; + } private: enum TupleIndex { diff --git a/src/dex_cache_test.cc b/src/dex_cache_test.cc index a01647a36a..25f194ab68 100644 --- a/src/dex_cache_test.cc +++ b/src/dex_cache_test.cc @@ -13,7 +13,6 @@ namespace art { class DexCacheTest : public CommonTest {}; TEST_F(DexCacheTest, Open) { - DexCache* dex_cache = class_linker_->AllocDexCache(*java_lang_dex_file_.get()); ASSERT_TRUE(dex_cache != NULL); diff --git a/src/dex_file.cc b/src/dex_file.cc index d5c5e86fb1..220c111010 100644 --- a/src/dex_file.cc +++ b/src/dex_file.cc @@ -111,7 +111,7 @@ const char* DexFile::kClassesDex = "classes.dex"; class LockedFd { public: - static LockedFd* CreateAndLock(std::string& name, mode_t mode) { + static LockedFd* CreateAndLock(std::string& name, mode_t mode) { int fd = open(name.c_str(), O_CREAT | O_RDWR, mode); if (fd == -1) { PLOG(ERROR) << "Failed to open file '" << name << "'"; @@ -125,17 +125,17 @@ class LockedFd { LOG(WARNING) << "sleeping while locking file " << name; result = flock(fd, LOCK_EX); } - if (result == -1 ) { + if (result == -1) { PLOG(ERROR) << "Failed to lock file '" << name << "'"; close(fd); return NULL; } return new LockedFd(fd); - } + } - int GetFd() const { - return fd_; - } + int GetFd() const { + return fd_; + } ~LockedFd() { if (fd_ != -1) { @@ -166,7 +166,6 @@ class TmpFile { // Open classes.dex from within a .zip, .jar, .apk, ... const DexFile* DexFile::OpenZip(const std::string& filename, const std::string& strip_location_prefix) { - // First, look for a ".dex" alongside the jar file. It will have // the same name/path except for the extension. diff --git a/src/dex_file.h b/src/dex_file.h index 453b7c2f4e..f41040ee8b 100644 --- a/src/dex_file.h +++ b/src/dex_file.h @@ -300,7 +300,7 @@ class DexFile { struct Field { uint32_t field_idx_; // index into the field_ids list for the identity of this field uint32_t access_flags_; // access flags for the field - Field() {}; + Field() {} private: DISALLOW_COPY_AND_ASSIGN(Field); }; @@ -310,7 +310,7 @@ class DexFile { uint32_t method_idx_; uint32_t access_flags_; uint32_t code_off_; - Method() {}; + Method() {} private: DISALLOW_COPY_AND_ASSIGN(Method); }; diff --git a/src/dex_file_test.cc b/src/dex_file_test.cc index ad3b17b770..e33276b881 100644 --- a/src/dex_file_test.cc +++ b/src/dex_file_test.cc @@ -141,7 +141,6 @@ TEST_F(DexFileTest, CreateMethodDescriptor) { std::string descriptor(raw->CreateMethodDescriptor(proto_idx, &length)); ASSERT_EQ("(ZSC)LCreateMethodDescriptor;", descriptor); } - } } // namespace art diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc index d84e4cb767..3e41d235e9 100644 --- a/src/dex_verifier.cc +++ b/src/dex_verifier.cc @@ -1760,7 +1760,7 @@ bool DexVerifier::CodeFlowVerifyInstruction(VerifierData* vdata, SetRegisterType(work_line, dec_insn.vA_, uninit_type); } break; - case Instruction::NEW_ARRAY: + case Instruction::NEW_ARRAY: res_class = ResolveClassAndCheckAccess(dex_file, dec_insn.vC_, klass, &failure); if (res_class == NULL) { const char* bad_class_desc = dex_file->dexStringByTypeIdx(dec_insn.vC_); @@ -2030,7 +2030,6 @@ aget_1nr_common: failure = VERIFY_ERROR_GENERIC; break; } - } SetRegisterType(work_line, dec_insn.vA_, tmp_type); } @@ -5887,10 +5886,11 @@ void DexVerifier::DumpRegTypes(const VerifierData* vdata, char reg_chars[reg_char_size + 1]; memset(reg_chars, ' ', reg_char_size); reg_chars[0] = '['; - if (reg_count == 0) + if (reg_count == 0) { reg_chars[1] = ']'; - else - reg_chars[1 + (reg_count - 1) + (reg_count -1 ) / 4 + 1] = ']'; + } else { + reg_chars[1 + (reg_count - 1) + (reg_count - 1) / 4 + 1] = ']'; + } reg_chars[reg_char_size] = '\0'; for (i = 0; i < reg_count + kExtraRegs; i++) { diff --git a/src/dex_verifier_test.cc b/src/dex_verifier_test.cc index 89482bda2a..b72f495398 100644 --- a/src/dex_verifier_test.cc +++ b/src/dex_verifier_test.cc @@ -31,7 +31,6 @@ class DexVerifierTest : public CommonTest { VerifyClass(class_loader, descriptor); } } - }; TEST_F(DexVerifierTest, LibCore) { diff --git a/src/heap.cc b/src/heap.cc index e9900ba8fb..01ba840198 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -572,8 +572,7 @@ void Heap::GrowForUtilization() { // We know what our utilization is at this moment. // This doesn't actually resize any memory. It just lets the heap grow more // when necessary. - size_t target_size = size_t( num_bytes_allocated_ / - Heap::GetTargetHeapUtilization() ); + size_t target_size(num_bytes_allocated_ / Heap::GetTargetHeapUtilization()); if (target_size > num_bytes_allocated_ + kHeapIdealFree) { target_size = num_bytes_allocated_ + kHeapIdealFree; diff --git a/src/image_writer.h b/src/image_writer.h index cdf2d9c574..35486b0cbe 100644 --- a/src/image_writer.h +++ b/src/image_writer.h @@ -19,12 +19,11 @@ namespace art { // Write a Space built during compilation for use during execution. class ImageWriter { - public: - ImageWriter() : source_space_(NULL), image_top_(0), image_base_(NULL) {}; + ImageWriter() : source_space_(NULL), image_top_(0), image_base_(NULL) {} bool Write(const char* image_filename, uintptr_t image_base, const std::string& oat_filename, const std::string& strip_location_prefix); - ~ImageWriter() {}; + ~ImageWriter() {} private: diff --git a/src/logging.h b/src/logging.h index 2f73599220..d3dbcd423f 100644 --- a/src/logging.h +++ b/src/logging.h @@ -31,7 +31,7 @@ #define CHECK_OP(LHS, RHS, OP) \ for (::art::EagerEvaluator<typeof(LHS), typeof(RHS)> _values(LHS, RHS); \ - UNLIKELY(!(_values.lhs OP _values.rhs)); ) \ + UNLIKELY(!(_values.lhs OP _values.rhs)); /* empty */) \ ::art::LogMessage(__FILE__, __LINE__, FATAL, -1).stream() \ << "Check failed: " << #LHS << " " << #OP << " " << #RHS \ << " (" #LHS "=" << _values.lhs << ", " #RHS "=" << _values.rhs << ") " diff --git a/src/macros.h b/src/macros.h index f016f9e07b..88c241634d 100644 --- a/src/macros.h +++ b/src/macros.h @@ -110,15 +110,12 @@ char (&ArraySizeHelper(T (&array)[N]))[N]; // where a pointer is 4 bytes, this means all pointers to a type whose // size is 3 or greater than 4 will be (righteously) rejected. #define ARRAYSIZE_UNSAFE(a) \ - ((sizeof(a) / sizeof(*(a))) / \ - static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) + ((sizeof(a) / sizeof(*(a))) / static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) #define SIZEOF_MEMBER(t, f) sizeof(((t*) 4096)->f) -#define OFFSETOF_MEMBER(t, f) \ - (reinterpret_cast<char*>( \ - &reinterpret_cast<t*>(16)->f) - \ - reinterpret_cast<char*>(16)) +#define OFFSETOF_MEMBER(t, f) \ + (reinterpret_cast<char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<char*>(16)) #define OFFSETOF_VOLATILE_MEMBER(t, f) \ (reinterpret_cast<volatile char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<volatile char*>(16)) diff --git a/src/mark_sweep.cc b/src/mark_sweep.cc index 94b35e0598..2e8041d578 100644 --- a/src/mark_sweep.cc +++ b/src/mark_sweep.cc @@ -137,7 +137,7 @@ void MarkSweep::SweepSystemWeaks() { } void MarkSweep::SweepCallback(size_t num_ptrs, void** ptrs, void* arg) { - // TODO, lock heap if concurrent + // TODO: lock heap if concurrent size_t freed_objects = num_ptrs; size_t freed_bytes = 0; Space* space = static_cast<Space*>(arg); @@ -148,7 +148,7 @@ void MarkSweep::SweepCallback(size_t num_ptrs, void** ptrs, void* arg) { space->Free(obj); } Heap::RecordFreeLocked(freed_objects, freed_bytes); - // TODO, unlock heap if concurrent + // TODO: unlock heap if concurrent } void MarkSweep::Sweep() { diff --git a/src/oat.cc b/src/oat.cc index 14040f3eda..1a615fe83e 100644 --- a/src/oat.cc +++ b/src/oat.cc @@ -66,14 +66,14 @@ void OatHeader::SetExecutableOffset(uint32_t executable_offset) { } OatMethodOffsets::OatMethodOffsets() - : code_offset_(0), - frame_size_in_bytes_(0), - return_pc_offset_in_bytes_(0), - core_spill_mask_(0), - fp_spill_mask_(0), - mapping_table_offset_(0), - vmap_table_offset_(0), - invoke_stub_offset_(0) {} + : code_offset_(0), + frame_size_in_bytes_(0), + return_pc_offset_in_bytes_(0), + core_spill_mask_(0), + fp_spill_mask_(0), + mapping_table_offset_(0), + vmap_table_offset_(0), + invoke_stub_offset_(0) {} OatMethodOffsets::OatMethodOffsets(uint32_t code_offset, uint32_t frame_size_in_bytes, @@ -83,14 +83,14 @@ OatMethodOffsets::OatMethodOffsets(uint32_t code_offset, uint32_t mapping_table_offset, uint32_t vmap_table_offset, uint32_t invoke_stub_offset) - : code_offset_(code_offset), - frame_size_in_bytes_(frame_size_in_bytes), - return_pc_offset_in_bytes_(return_pc_offset_in_bytes), - core_spill_mask_(core_spill_mask), - fp_spill_mask_(fp_spill_mask), - mapping_table_offset_(mapping_table_offset), - vmap_table_offset_(vmap_table_offset), - invoke_stub_offset_(invoke_stub_offset) {} + : code_offset_(code_offset), + frame_size_in_bytes_(frame_size_in_bytes), + return_pc_offset_in_bytes_(return_pc_offset_in_bytes), + core_spill_mask_(core_spill_mask), + fp_spill_mask_(fp_spill_mask), + mapping_table_offset_(mapping_table_offset), + vmap_table_offset_(vmap_table_offset), + invoke_stub_offset_(invoke_stub_offset) {} OatMethodOffsets::~OatMethodOffsets() {} diff --git a/src/oat_file.cc b/src/oat_file.cc index 23eae7cbe7..6e8c60f186 100644 --- a/src/oat_file.cc +++ b/src/oat_file.cc @@ -145,7 +145,7 @@ const OatFile::OatDexFile* OatFile::GetOatDexFile(const std::string& dex_file_lo std::vector<const OatFile::OatDexFile*> OatFile::GetOatDexFiles() const { std::vector<const OatFile::OatDexFile*> result; - for (Table::const_iterator it = oat_dex_files_.begin(); it != oat_dex_files_.end(); ++it ) { + for (Table::const_iterator it = oat_dex_files_.begin(); it != oat_dex_files_.end(); ++it) { result.push_back(it->second); } return result; diff --git a/src/oat_writer.cc b/src/oat_writer.cc index 8c48f734d5..797c187c53 100644 --- a/src/oat_writer.cc +++ b/src/oat_writer.cc @@ -178,7 +178,6 @@ size_t OatWriter::InitOatCodeMethod(size_t offset, const CompiledMethod* compiled_method = compiler_->GetCompiledMethod(method); if (compiled_method != NULL) { - offset = compiled_method->AlignCode(offset); DCHECK_ALIGNED(offset, kArmAlignment); const std::vector<uint8_t>& code = compiled_method->GetCode(); @@ -207,7 +206,6 @@ size_t OatWriter::InitOatCodeMethod(size_t offset, oat_header_->UpdateChecksum(&fp_spill_mask, sizeof(fp_spill_mask)); if (compiled_method != NULL) { - const std::vector<uint32_t>& mapping_table = compiled_method->GetMappingTable(); size_t mapping_table_size = mapping_table.size() * sizeof(mapping_table[0]); mapping_table_offset = (mapping_table_size == 0) ? 0 : offset; @@ -259,7 +257,6 @@ size_t OatWriter::InitOatCodeMethod(size_t offset, DCHECK_EQ(static_cast<off_t>(code_offset), lseek(file->Fd(), 0, SEEK_CUR)) bool OatWriter::Write(const std::string& filename) { - UniquePtr<File> file(OS::OpenFile(filename.c_str(), true)); if (file.get() == NULL) { return false; diff --git a/src/oatdump.cc b/src/oatdump.cc index db17d30bad..a50aecbb0b 100644 --- a/src/oatdump.cc +++ b/src/oatdump.cc @@ -211,11 +211,9 @@ class OatDump { oat_method.invoke_stub_, reinterpret_cast<const byte*>(oat_method.invoke_stub_) - oat_file.GetBase()); } - }; class ImageDump { - public: static void Dump(const std::string& image_filename, const std::string& host_prefix, @@ -556,13 +554,13 @@ int oatdump(int argc, char** argv) { } if (image_filename == NULL && oat_filename == NULL) { - fprintf(stderr, "Either --image or --oat must be specified\n"); - return EXIT_FAILURE; + fprintf(stderr, "Either --image or --oat must be specified\n"); + return EXIT_FAILURE; } if (image_filename != NULL && oat_filename != NULL) { - fprintf(stderr, "Either --image or --oat must be specified but not both\n"); - return EXIT_FAILURE; + fprintf(stderr, "Either --image or --oat must be specified but not both\n"); + return EXIT_FAILURE; } if (oat_filename != NULL) { diff --git a/src/oatopt.cc b/src/oatopt.cc index 367e5bfc4d..b2a33cbaa4 100644 --- a/src/oatopt.cc +++ b/src/oatopt.cc @@ -113,7 +113,6 @@ int FromZip(const int argc, const char* const argv[]) { } int oatopt(int argc, char** argv) { - setvbuf(stdout, NULL, _IONBF, 0); if (true) { diff --git a/src/object.cc b/src/object.cc index d9dfc4fa01..b28594acaa 100644 --- a/src/object.cc +++ b/src/object.cc @@ -446,10 +446,8 @@ ObjectArray<StaticStorageBase>* Method::GetDexCacheInitializedStaticStorage() co } void Method::SetDexCacheInitializedStaticStorage(ObjectArray<StaticStorageBase>* new_value) { - SetFieldObject( - OFFSET_OF_OBJECT_MEMBER(Method, dex_cache_initialized_static_storage_), + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, dex_cache_initialized_static_storage_), new_value, false); - } size_t Method::NumArgRegisters(const StringPiece& shorty) { @@ -585,7 +583,7 @@ Method* Method::FindOverriddenMethod() const { result = interface->FindInterfaceMethod(name, signature); } } - DCHECK (result == NULL || HasSameNameAndSignature(result)); + DCHECK(result == NULL || HasSameNameAndSignature(result)); return result; } diff --git a/src/object.h b/src/object.h index 35acc27232..a1023865eb 100644 --- a/src/object.h +++ b/src/object.h @@ -970,7 +970,7 @@ class MANAGED Method : public AccessibleObject { bool IsCalleeSaveMethod() const { Runtime* runtime = Runtime::Current(); bool result = false; - for (int i=0; i < Runtime::kLastCalleeSaveType; i++) { + for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) { if (this == runtime->GetCalleeSaveMethod(Runtime::CalleeSaveType(i))) { result = true; break; @@ -2267,7 +2267,7 @@ void ObjectArray<T>::Copy(const ObjectArray<T>* src, int src_pos, Class* array_class = dst->GetClass(); if (array_class == src->GetClass()) { // No need for array store checks if arrays are of the same type - for (size_t i=0; i < length; i++) { + for (size_t i = 0; i < length; i++) { Object* object = src->GetFieldObject<Object*>(src_offset, false); dst->SetFieldObject(dst_offset, object, false); src_offset = MemberOffset(src_offset.Uint32Value() + sizeof(Object*)); @@ -2276,7 +2276,7 @@ void ObjectArray<T>::Copy(const ObjectArray<T>* src, int src_pos, } else { Class* element_class = array_class->GetComponentType(); CHECK(!element_class->IsPrimitive()); - for (size_t i=0; i < length; i++) { + for (size_t i = 0; i < length; i++) { Object* object = src->GetFieldObject<Object*>(src_offset, false); if (object != NULL && !object->InstanceOf(element_class)) { dst->ThrowArrayStoreException(object); @@ -2495,16 +2495,14 @@ class MANAGED String : public Object { }; inline const String* Field::GetName() const { - DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous()); - String* result = - GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Field, name_), false); - DCHECK(result != NULL); - return result; + DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous()); + String* result = GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Field, name_), false); + DCHECK(result != NULL); + return result; } inline void Field::SetName(String* new_name) { - SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Field, name_), - new_name, false); + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Field, name_), new_name, false); } inline uint32_t Field::GetAccessFlags() const { @@ -2519,14 +2517,12 @@ inline uint32_t Field::GetTypeIdx() const { inline MemberOffset Field::GetOffset() const { DCHECK(GetDeclaringClass()->IsResolved() || GetDeclaringClass()->IsErroneous()); - return MemberOffset( - GetField32(OFFSET_OF_OBJECT_MEMBER(Field, offset_), false)); + return MemberOffset(GetField32(OFFSET_OF_OBJECT_MEMBER(Field, offset_), false)); } inline MemberOffset Field::GetOffsetDuringLinking() const { DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous()); - return MemberOffset( - GetField32(OFFSET_OF_OBJECT_MEMBER(Field, offset_), false)); + return MemberOffset(GetField32(OFFSET_OF_OBJECT_MEMBER(Field, offset_), false)); } inline String* Method::GetName() const { @@ -2537,40 +2533,32 @@ inline String* Method::GetName() const { } inline void Method::SetName(String* new_name) { - SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, name_), - new_name, false); - + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, name_), new_name, false); } inline ByteArray* Method::GetRegisterMapData() const { - return GetFieldObject<ByteArray*>( - OFFSET_OF_OBJECT_MEMBER(Method, register_map_data_), false); + return GetFieldObject<ByteArray*>(OFFSET_OF_OBJECT_MEMBER(Method, register_map_data_), false); } inline void Method::SetRegisterMapData(ByteArray* data) { - SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, register_map_data_), - data, false); + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, register_map_data_), data, false); } inline ByteArray* Method::GetRegisterMapHeader() const { - return GetFieldObject<ByteArray*>( - OFFSET_OF_OBJECT_MEMBER(Method, register_map_header_), false); + return GetFieldObject<ByteArray*>(OFFSET_OF_OBJECT_MEMBER(Method, register_map_header_), false); } inline void Method::SetRegisterMapHeader(ByteArray* header) { - SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, register_map_header_), - header, false); + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, register_map_header_), header, false); } inline String* Method::GetShorty() const { DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous()); - return GetFieldObject<String*>( - OFFSET_OF_OBJECT_MEMBER(Method, shorty_), false); + return GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Method, shorty_), false); } inline void Method::SetShorty(String* new_shorty) { - DCHECK(NULL == GetFieldObject<String*>( - OFFSET_OF_OBJECT_MEMBER(Method, shorty_), false)); + DCHECK(NULL == GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Method, shorty_), false)); DCHECK_LE(1, new_shorty->GetLength()); SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, shorty_), new_shorty, false); } @@ -2583,8 +2571,7 @@ inline String* Method::GetSignature() const { } inline void Method::SetSignature(String* new_signature) { - SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, signature_), - new_signature, false); + SetFieldObject(OFFSET_OF_OBJECT_MEMBER(Method, signature_), new_signature, false); } inline void Method::SetExceptionTypes(ObjectArray<Class>* exception_types) { diff --git a/src/offsets.cc b/src/offsets.cc index 500e17e9f8..49e52fbabf 100644 --- a/src/offsets.cc +++ b/src/offsets.cc @@ -10,4 +10,4 @@ std::ostream& operator<<(std::ostream& os, const Offset& offs) { return os << offs.Int32Value(); } -} +} // namespace art diff --git a/src/runtime_linux.cc b/src/runtime_linux.cc index 1461528a31..89fb627c61 100644 --- a/src/runtime_linux.cc +++ b/src/runtime_linux.cc @@ -47,7 +47,7 @@ void Runtime::PlatformAbort(const char* file, int line) { // "[0xf7b62057]" // We extract the pieces and demangle, so we can produce output like this: - // libartd.so:-1] #00 art::Runtime::PlatformAbort(char const*, int) +0x15b [0xf770dd51] + // libartd.so:-1] #00 art::Runtime::PlatformAbort(char const*, int) +0x15b [0xf770dd51] for (size_t i = 0; i < frame_count; ++i) { std::string text(symbols[i]); diff --git a/src/runtime_support.cc b/src/runtime_support.cc index ad01f4d64b..a8243e20aa 100644 --- a/src/runtime_support.cc +++ b/src/runtime_support.cc @@ -468,7 +468,7 @@ Field* FindFieldFromCode(uint32_t field_idx, const Method* referrer, bool is_sta if (fields_class->IsInitializing()) { return resolved_field; } - if(Runtime::Current()->GetClassLinker()->EnsureInitialized(fields_class, true)) { + if (Runtime::Current()->GetClassLinker()->EnsureInitialized(fields_class, true)) { return resolved_field; } } @@ -984,7 +984,7 @@ extern "C" void artProxyInvokeHandler(Method* proxy_method, Object* receiver, ObjectArray<Object>* args = NULL; if ((num_params - 1) > 0) { args = Runtime::Current()->GetClassLinker()->AllocObjectArray<Object>(num_params - 1); - if(args == NULL) { + if (args == NULL) { CHECK(self->IsExceptionPending()); return; } diff --git a/src/stringprintf.h b/src/stringprintf.h index 2e685d1b05..413fef5f36 100644 --- a/src/stringprintf.h +++ b/src/stringprintf.h @@ -8,11 +8,11 @@ // Returns a string corresponding to printf-like formatting of the arguments. std::string StringPrintf(const char* fmt, ...) - __attribute__((__format__ (__printf__, 1, 2))); + __attribute__((__format__(__printf__, 1, 2))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendF(std::string* dst, const char* fmt, ...) - __attribute__((__format__ (__printf__, 2, 3))); + __attribute__((__format__(__printf__, 2, 3))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendV(std::string* dst, const char* format, va_list ap); diff --git a/src/stub_arm.cc b/src/stub_arm.cc index b9593773d4..dfbd5247f9 100644 --- a/src/stub_arm.cc +++ b/src/stub_arm.cc @@ -10,7 +10,7 @@ namespace art { namespace arm { ByteArray* ArmCreateResolutionTrampoline(Runtime::TrampolineType type) { - UniquePtr<ArmAssembler> assembler( static_cast<ArmAssembler*>(Assembler::Create(kArm)) ); + UniquePtr<ArmAssembler> assembler(static_cast<ArmAssembler*>(Assembler::Create(kArm))); // | Out args | // | Method* | <- SP on entry // | LR | return address into caller @@ -49,7 +49,7 @@ ByteArray* ArmCreateResolutionTrampoline(Runtime::TrampolineType type) { typedef void (*ThrowAme)(Method*, Thread*); ByteArray* CreateAbstractMethodErrorStub() { - UniquePtr<ArmAssembler> assembler( static_cast<ArmAssembler*>(Assembler::Create(kArm)) ); + UniquePtr<ArmAssembler> assembler(static_cast<ArmAssembler*>(Assembler::Create(kArm))); // Save callee saves and ready frame for exception delivery RegList save = (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7) | (1 << R8) | (1 << R9) | (1 << R10) | (1 << R11) | (1 << LR); @@ -79,7 +79,7 @@ ByteArray* CreateAbstractMethodErrorStub() { } ByteArray* CreateJniStub() { - UniquePtr<ArmAssembler> assembler( static_cast<ArmAssembler*>(Assembler::Create(kArm)) ); + UniquePtr<ArmAssembler> assembler(static_cast<ArmAssembler*>(Assembler::Create(kArm))); // Build frame and save argument registers and LR. RegList save = (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3) | (1 << LR); __ PushList(save); diff --git a/src/stub_x86.cc b/src/stub_x86.cc index 9a6797a2fb..ea745eefe8 100644 --- a/src/stub_x86.cc +++ b/src/stub_x86.cc @@ -10,7 +10,7 @@ namespace art { namespace x86 { ByteArray* X86CreateResolutionTrampoline(Runtime::TrampolineType) { - UniquePtr<X86Assembler> assembler( static_cast<X86Assembler*>(Assembler::Create(kX86)) ); + UniquePtr<X86Assembler> assembler(static_cast<X86Assembler*>(Assembler::Create(kX86))); // TODO: unimplemented __ int3(); @@ -28,7 +28,7 @@ ByteArray* X86CreateResolutionTrampoline(Runtime::TrampolineType) { typedef void (*ThrowAme)(Method*, Thread*); ByteArray* CreateAbstractMethodErrorStub() { - UniquePtr<X86Assembler> assembler( static_cast<X86Assembler*>(Assembler::Create(kX86)) ); + UniquePtr<X86Assembler> assembler(static_cast<X86Assembler*>(Assembler::Create(kX86))); // Pad stack to ensure 16-byte alignment __ pushl(Immediate(0)); @@ -55,7 +55,7 @@ ByteArray* CreateAbstractMethodErrorStub() { } ByteArray* CreateJniStub() { - UniquePtr<X86Assembler> assembler( static_cast<X86Assembler*>(Assembler::Create(kX86)) ); + UniquePtr<X86Assembler> assembler(static_cast<X86Assembler*>(Assembler::Create(kX86))); // Pad stack to ensure 16-byte alignment __ pushl(Immediate(0)); diff --git a/src/thread.cc b/src/thread.cc index e72046cbf0..73b8a94684 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -1383,7 +1383,7 @@ class ReferenceMapVisitor : public Thread::StackVisitor { spill_shifts--; // wind back one as we want the last match ref = reinterpret_cast<Object*>(context_->GetGPR(spill_shifts)); } else { - ref = reinterpret_cast<Object*>(frame.GetVReg(m ,reg)); + ref = reinterpret_cast<Object*>(frame.GetVReg(m, reg)); } if (ref != NULL) { root_visitor_(ref, arg_); diff --git a/src/thread.h b/src/thread.h index ca8cb03551..f30d092b10 100644 --- a/src/thread.h +++ b/src/thread.h @@ -122,7 +122,7 @@ class PACKED Thread { void* (*pAllocArrayFromCode)(uint32_t, void*, int32_t); void (*pCanPutArrayElementFromCode)(void*, void*); void* (*pCheckAndAllocArrayFromCode)(uint32_t, void*, int32_t); - void (*pCheckCastFromCode) (void*, void*); + void (*pCheckCastFromCode)(void*, void*); Object* (*pDecodeJObjectInThread)(Thread* thread, jobject obj); void (*pDeliverException)(void*); void* (*pFindInstanceFieldFromCode)(uint32_t, void*); @@ -133,7 +133,7 @@ class PACKED Thread { void* (*pGetObjStatic)(uint32_t, void*); void (*pHandleFillArrayDataFromCode)(void*, void*); void* (*pInitializeStaticStorage)(uint32_t, void*); - uint32_t (*pInstanceofNonTrivialFromCode) (const Class*, const Class*); + uint32_t (*pInstanceofNonTrivialFromCode)(const Class*, const Class*); void (*pInvokeInterfaceTrampoline)(uint32_t, void*); Class* (*pInitializeTypeFromCode)(uint32_t, Method*); void (*pLockObjectFromCode)(void*); @@ -285,7 +285,7 @@ class PACKED Thread { void ThrowNewException(const char* exception_class_descriptor, const char* msg); void ThrowNewExceptionF(const char* exception_class_descriptor, const char* fmt, ...) - __attribute__ ((format(printf, 3, 4))); + __attribute__((format(printf, 3, 4))); void ThrowNewExceptionV(const char* exception_class_descriptor, const char* fmt, va_list ap); diff --git a/src/zip_archive.cc b/src/zip_archive.cc index fb5d23c1e8..550d04a3d0 100644 --- a/src/zip_archive.cc +++ b/src/zip_archive.cc @@ -236,7 +236,6 @@ static bool InflateToFile(File& out, int in, size_t uncompressed_length, size_t } bool ZipEntry::Extract(File& file) { - off_t data_offset = GetDataOffset(); if (data_offset == -1) { return false; diff --git a/src/zip_archive.h b/src/zip_archive.h index acf18b0b0e..17c9ddccbe 100644 --- a/src/zip_archive.h +++ b/src/zip_archive.h @@ -37,7 +37,6 @@ class ZipArchive; class MemMap; class ZipEntry { - public: // Uncompress an entry, in its entirety, to an open file descriptor. bool Extract(File& file); @@ -46,7 +45,7 @@ class ZipEntry { private: - ZipEntry(ZipArchive* zip_archive, const byte* ptr) : zip_archive_(zip_archive), ptr_(ptr) {}; + ZipEntry(ZipArchive* zip_archive, const byte* ptr) : zip_archive_(zip_archive), ptr_(ptr) {} // Zip compression methods enum { |