diff options
| author | 2012-08-20 15:35:52 -0700 | |
|---|---|---|
| committer | 2012-08-20 15:35:52 -0700 | |
| commit | 1b09b094a85e03f6ef5f687f58bb91c433273ba1 (patch) | |
| tree | 6b039e520ee3b73e6ba5fb23954b9e01ecc68fc9 | |
| parent | 931c278aed62d7a97b87cf1bb9cfdd189e77eb24 (diff) | |
Syntax clean up to make clang happy.
Change-Id: I0984c395bbd1ee4b206eafd19915b6f68781dd16
| -rw-r--r-- | src/compiler.cc | 2 | ||||
| -rw-r--r-- | src/debugger.h | 2 | ||||
| -rw-r--r-- | src/dex_instruction_visitor.h | 2 | ||||
| -rw-r--r-- | src/image_writer.cc | 2 | ||||
| -rw-r--r-- | src/jdwp/jdwp.h | 4 | ||||
| -rw-r--r-- | src/jni_internal.cc | 2 | ||||
| -rw-r--r-- | src/oat/runtime/x86/runtime_support_x86.S | 8 | ||||
| -rw-r--r-- | src/oat_file.cc | 5 | ||||
| -rw-r--r-- | src/oat_file.h | 2 | ||||
| -rw-r--r-- | src/object.cc | 2 | ||||
| -rw-r--r-- | src/object.h | 10 | ||||
| -rw-r--r-- | src/runtime.cc | 9 | ||||
| -rw-r--r-- | src/runtime.h | 2 | ||||
| -rw-r--r-- | src/thread.h | 2 |
14 files changed, 28 insertions, 26 deletions
diff --git a/src/compiler.cc b/src/compiler.cc index c34b7d82c6..b06f7185d9 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1003,7 +1003,7 @@ class WorkerThread { const CompilationContext* const context_; const size_t begin_; const size_t end_; - const Callback* callback_; + Callback* callback_; const size_t stripe_; friend void ForAll(CompilationContext*, size_t, size_t, Callback, size_t); diff --git a/src/debugger.h b/src/debugger.h index 4db9bd76fd..6e82001d82 100644 --- a/src/debugger.h +++ b/src/debugger.h @@ -31,7 +31,7 @@ namespace art { struct AllocRecord; -struct Thread; +class Thread; /* * Invoke-during-breakpoint support. diff --git a/src/dex_instruction_visitor.h b/src/dex_instruction_visitor.h index 2808c9707a..d625b64fa8 100644 --- a/src/dex_instruction_visitor.h +++ b/src/dex_instruction_visitor.h @@ -61,7 +61,7 @@ class DexInstructionVisitor { #undef INSTRUCTION_VISITOR // The default instruction handler. - void Do_Default(const Instruction* inst) { + void Do_Default(const Instruction*) { return; } }; diff --git a/src/image_writer.cc b/src/image_writer.cc index 969f4ab015..bc22af6552 100644 --- a/src/image_writer.cc +++ b/src/image_writer.cc @@ -481,7 +481,7 @@ void ImageWriter::FixupMethod(const Method* orig, Method* copy) { // Every type of method can have an invoke stub uint32_t invoke_stub_offset = orig->GetOatInvokeStubOffset(); const byte* invoke_stub = GetOatAddress(invoke_stub_offset); - copy->invoke_stub_ = reinterpret_cast<const Method::InvokeStub*>(invoke_stub); + copy->invoke_stub_ = reinterpret_cast<Method::InvokeStub*>(const_cast<byte*>(invoke_stub)); if (orig->IsAbstract()) { // Abstract methods are pointed to a stub that will throw AbstractMethodError if they are called diff --git a/src/jdwp/jdwp.h b/src/jdwp/jdwp.h index b80033c434..725e857aea 100644 --- a/src/jdwp/jdwp.h +++ b/src/jdwp/jdwp.h @@ -31,8 +31,8 @@ struct iovec; namespace art { -struct Method; -struct Thread; +class Method; +class Thread; namespace JDWP { diff --git a/src/jni_internal.cc b/src/jni_internal.cc index dbdc149d6c..ab2286fa5c 100644 --- a/src/jni_internal.cc +++ b/src/jni_internal.cc @@ -1162,7 +1162,7 @@ class JNI { ScopedObjectAccess soa(env); va_list ap; va_start(ap, mid); - JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); + InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap); va_end(ap); } diff --git a/src/oat/runtime/x86/runtime_support_x86.S b/src/oat/runtime/x86/runtime_support_x86.S index d8098b672f..45caaae173 100644 --- a/src/oat/runtime/x86/runtime_support_x86.S +++ b/src/oat/runtime/x86/runtime_support_x86.S @@ -422,7 +422,7 @@ DEFINE_FUNCTION art_fmodf_from_code pushl %ecx // pass arg2 b pushl %eax // pass arg1 a call SYMBOL(fmodf) // (jfloat a, jfloat b) - fstp (%esp) // pop return value off fp stack + fstps (%esp) // pop return value off fp stack movss (%esp), %xmm0 // place into %xmm0 addl LITERAL(12), %esp // pop arguments ret @@ -442,7 +442,7 @@ DEFINE_FUNCTION art_l2f_from_code pushl %ecx // pass arg2 a.hi pushl %eax // pass arg1 a.lo call SYMBOL(art_l2f) // (jlong a) - fstp (%esp) // pop return value off fp stack + fstps (%esp) // pop return value off fp stack movss (%esp), %xmm0 // place into %xmm0 addl LITERAL(12), %esp // pop arguments ret @@ -819,8 +819,8 @@ DEFINE_FUNCTION art_string_compareto ret .balign 16 not_equal: - movzxw -2(%esi), %eax // get last compared char from this string - movzxw -2(%edi), %ecx // get last compared char from comp string + movzwl -2(%esi), %eax // get last compared char from this string + movzwl -2(%edi), %ecx // get last compared char from comp string subl %ecx, %eax // return the difference popl %edi // pop callee save reg popl %esi // pop callee save reg diff --git a/src/oat_file.cc b/src/oat_file.cc index 6f96e982e7..264405d6c8 100644 --- a/src/oat_file.cc +++ b/src/oat_file.cc @@ -334,8 +334,9 @@ uint32_t OatFile::OatMethod::GetCodeSize() const { return reinterpret_cast<uint32_t*>(code)[-1]; } -const Method::InvokeStub* OatFile::OatMethod::GetInvokeStub() const { - return GetOatPointer<const Method::InvokeStub*>(invoke_stub_offset_); +Method::InvokeStub* OatFile::OatMethod::GetInvokeStub() const { + const byte* stub = GetOatPointer<const byte*>(invoke_stub_offset_); + return reinterpret_cast<Method::InvokeStub*>(const_cast<byte*>(stub)); } uint32_t OatFile::OatMethod::GetInvokeStubSize() const { diff --git a/src/oat_file.h b/src/oat_file.h index 856a033e18..24b6b40538 100644 --- a/src/oat_file.h +++ b/src/oat_file.h @@ -108,7 +108,7 @@ class OatFile { return GetOatPointer<const uint8_t*>(gc_map_offset_); } - const Method::InvokeStub* GetInvokeStub() const; + Method::InvokeStub* GetInvokeStub() const; uint32_t GetInvokeStubSize() const; #if defined(ART_USE_LLVM_COMPILER) diff --git a/src/object.cc b/src/object.cc index dd984fc293..c8da0fa6b5 100644 --- a/src/object.cc +++ b/src/object.cc @@ -526,7 +526,7 @@ void Method::Invoke(Thread* self, Object* receiver, JValue* args, JValue* result // Call the invoke stub associated with the method. // Pass everything as arguments. - const Method::InvokeStub* stub = GetInvokeStub(); + Method::InvokeStub* stub = GetInvokeStub(); bool have_executable_code = (GetCode() != NULL); diff --git a/src/object.h b/src/object.h index 03ed132c26..dfb34e0a27 100644 --- a/src/object.h +++ b/src/object.h @@ -546,7 +546,7 @@ class MANAGED Field : public Object { // C++ mirror of java.lang.reflect.Method and java.lang.reflect.Constructor class MANAGED Method : public Object { public: - // An function that invokes a method with an array of its arguments. + // A function that invokes a method with an array of its arguments. typedef void InvokeStub(const Method* method, Object* obj, Thread* thread, @@ -857,7 +857,7 @@ class MANAGED Method : public Object { } // Native to managed invocation stub entry point - const InvokeStub* GetInvokeStub() const { + InvokeStub* GetInvokeStub() const { InvokeStub* result = GetFieldPtr<InvokeStub*>( OFFSET_OF_OBJECT_MEMBER(Method, invoke_stub_), false); // TODO: DCHECK(result != NULL); should be ahead of time compiled @@ -865,8 +865,8 @@ class MANAGED Method : public Object { } void SetInvokeStub(InvokeStub* invoke_stub) { - SetFieldPtr<const InvokeStub*>(OFFSET_OF_OBJECT_MEMBER(Method, invoke_stub_), - invoke_stub, false); + SetFieldPtr<InvokeStub*>(OFFSET_OF_OBJECT_MEMBER(Method, invoke_stub_), + invoke_stub, false); } uint32_t GetInvokeStubSize() const { @@ -1010,7 +1010,7 @@ class MANAGED Method : public Object { const uint8_t* gc_map_; // Native invocation stub entry point for calling from native to managed code. - const InvokeStub* invoke_stub_; + InvokeStub* invoke_stub_; // Mapping from native pc to dex pc const uint32_t* mapping_table_; diff --git a/src/runtime.cc b/src/runtime.cc index 5230b77465..60cc6f576c 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -485,13 +485,14 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b } else if (StartsWith(option, "-Xstacktracefile:")) { parsed->stack_trace_file_ = option.substr(strlen("-Xstacktracefile:")); } else if (option == "sensitiveThread") { - parsed->hook_is_sensitive_thread_ = reinterpret_cast<bool (*)()>(options[i].second); + parsed->hook_is_sensitive_thread_ = reinterpret_cast<bool (*)()>(const_cast<void*>(options[i].second)); } else if (option == "vfprintf") { - parsed->hook_vfprintf_ = reinterpret_cast<int (*)(FILE *, const char*, va_list)>(options[i].second); + parsed->hook_vfprintf_ = + reinterpret_cast<int (*)(FILE *, const char*, va_list)>(const_cast<void*>(options[i].second)); } else if (option == "exit") { - parsed->hook_exit_ = reinterpret_cast<void(*)(jint)>(options[i].second); + parsed->hook_exit_ = reinterpret_cast<void(*)(jint)>(const_cast<void*>(options[i].second)); } else if (option == "abort") { - parsed->hook_abort_ = reinterpret_cast<void(*)()>(options[i].second); + parsed->hook_abort_ = reinterpret_cast<void(*)()>(const_cast<void*>(options[i].second)); } else if (option == "host-prefix") { parsed->host_prefix_ = reinterpret_cast<const char*>(options[i].second); } else if (option == "-Xgenregmap" || option == "-Xgc:precise") { diff --git a/src/runtime.h b/src/runtime.h index 3b9919ce40..f61399163d 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -47,7 +47,7 @@ class ClassLoader; class DexFile; class Heap; class InternTable; -class JavaVMExt; +struct JavaVMExt; class Method; class MonitorList; class SignalCatcher; diff --git a/src/thread.h b/src/thread.h index efa92f4660..499527a55d 100644 --- a/src/thread.h +++ b/src/thread.h @@ -46,7 +46,7 @@ class Class; class ClassLinker; class ClassLoader; class Context; -class DebugInvokeReq; +struct DebugInvokeReq; class Method; class Monitor; class Object; |