summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brian Carlstrom <bdc@google.com> 2012-01-09 18:01:56 -0800
committer Brian Carlstrom <bdc@google.com> 2012-01-09 21:20:50 -0800
commit2e3d1b262af0839380e1d60e86d8b281943ef944 (patch)
treef703c068e2a037d12dac592e1ebc6f1849ce4fbf
parentd170fc48b0895ee98ec0d6e3cf1987c8260af95d (diff)
Changes to compile with gcc 4.6
Change-Id: I55908b3b98b49373ce948fd1f12e0a5cd56ae4f7
-rw-r--r--src/class_linker_test.cc4
-rw-r--r--src/compiler/codegen/arm/Assemble.cc2
-rw-r--r--src/dalvik_system_DexFile.cc2
-rw-r--r--src/dex2oat.cc2
-rw-r--r--src/dex_verifier.cc4
-rw-r--r--src/exception_test.cc2
-rw-r--r--src/jni_internal.cc5
-rw-r--r--src/jni_internal_test.cc8
8 files changed, 18 insertions, 11 deletions
diff --git a/src/class_linker_test.cc b/src/class_linker_test.cc
index eb1828003f..8b0e1a1d66 100644
--- a/src/class_linker_test.cc
+++ b/src/class_linker_test.cc
@@ -863,7 +863,9 @@ TEST_F(ClassLinkerTest, StaticFields) {
EXPECT_TRUE(s8->GetObject(NULL)->AsString()->Equals("android"));
s8->SetObject(NULL, String::AllocFromModifiedUtf8("robot"));
- EXPECT_EQ(false, s0->GetBoolean(NULL));
+ // TODO: Remove EXPECT_FALSE when GCC can handle EXPECT_EQ
+ // http://code.google.com/p/googletest/issues/detail?id=322
+ EXPECT_FALSE( s0->GetBoolean(NULL));
EXPECT_EQ(6, s1->GetByte(NULL));
EXPECT_EQ('b', s2->GetChar(NULL));
EXPECT_EQ(-535, s3->GetShort(NULL));
diff --git a/src/compiler/codegen/arm/Assemble.cc b/src/compiler/codegen/arm/Assemble.cc
index 43fb05ea1b..9a1a30ed55 100644
--- a/src/compiler/codegen/arm/Assemble.cc
+++ b/src/compiler/codegen/arm/Assemble.cc
@@ -1566,7 +1566,7 @@ void oatAssembleLIR(CompilationUnit* cUnit)
*/
while (true) {
- AssemblerStatus res = assembleInstructions(cUnit, NULL);
+ AssemblerStatus res = assembleInstructions(cUnit, 0);
if (res == kSuccess) {
break;
} else {
diff --git a/src/dalvik_system_DexFile.cc b/src/dalvik_system_DexFile.cc
index 23247cf92a..7fce25ff2c 100644
--- a/src/dalvik_system_DexFile.cc
+++ b/src/dalvik_system_DexFile.cc
@@ -97,7 +97,7 @@ static jint DexFile_openDexFile(JNIEnv* env, jclass, jstring javaSourceName, jst
if (!IsValidZipFilename(sourceName.c_str()) || !IsValidDexFilename(outputName.c_str())) {
LOG(ERROR) << "Bad filenames extracting dex '" << outputName.c_str()
<< "' from zip '" << sourceName.c_str() << "'";
- return NULL;
+ return 0;
}
// Generate the output oat file for the source dex file
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index 2781aae78d..41adc74114 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -574,7 +574,7 @@ int dex2oat(int argc, char** argv) {
UniquePtr<ZipArchive> zip_archive(ZipArchive::OpenFromFd(zip_fd));
if (zip_archive.get() == NULL) {
LOG(ERROR) << "Failed to zip from file descriptor for " << zip_name;
- return NULL;
+ return EXIT_FAILURE;
}
const DexFile* dex_file = DexFile::Open(*zip_archive.get(), zip_name);
if (dex_file == NULL) {
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index 2f91dcd03e..9868656e8e 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -1416,8 +1416,8 @@ bool DexVerifier::CheckSwitchTargets(uint32_t cur_offset) {
}
uint32_t table_size = targets_offset + switch_count * 2;
if (switch_insns[0] != expected_signature) {
- Fail(VERIFY_ERROR_GENERIC) << "wrong signature for switch table (" << (void*) switch_insns[0]
- << ", wanted " << (void*) expected_signature << ")";
+ Fail(VERIFY_ERROR_GENERIC) << StringPrintf("wrong signature for switch table (%x, wanted %x)",
+ switch_insns[0], expected_signature);
return false;
}
/* make sure the end of the switch is in range */
diff --git a/src/exception_test.cc b/src/exception_test.cc
index 559636f417..eca1fa8cfe 100644
--- a/src/exception_test.cc
+++ b/src/exception_test.cc
@@ -118,7 +118,7 @@ TEST_F(ExceptionTest, StackTraceElement) {
fake_stack.push_back(0xEBAD6070); // return pc
// Pull Method* of NULL to terminate the trace
- fake_stack.push_back(NULL);
+ fake_stack.push_back(0);
// Set up thread to appear as if we called out of method_g_ at pc 3
Thread* thread = Thread::Current();
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index e6c74104f4..597c58bd7a 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -2356,6 +2356,8 @@ class JNI {
return JNIInvalidRefType;
}
+ LOG(FATAL) << "IndirectRefKind[" << kind << "]";
+ return JNIInvalidRefType;
}
};
@@ -2974,5 +2976,8 @@ std::ostream& operator<<(std::ostream& os, const jobjectRefType& rhs) {
case JNIWeakGlobalRefType:
os << "JNIWeakGlobalRefType";
return os;
+ default:
+ os << "jobjectRefType[" << static_cast<int>(rhs) << "]";
+ return os;
}
}
diff --git a/src/jni_internal_test.cc b/src/jni_internal_test.cc
index d59fb3d828..fabd813d9a 100644
--- a/src/jni_internal_test.cc
+++ b/src/jni_internal_test.cc
@@ -644,9 +644,9 @@ TEST_F(JniInternalTest, GetObjectArrayElement_SetObjectArrayElement) {
jfieldID fid = env_->GetStaticFieldID(c, field_name, sig); \
EXPECT_TRUE(fid != NULL); \
env_->SetStatic ## type ## Field(c, fid, value1); \
- EXPECT_EQ(value1, env_->GetStatic ## type ## Field(c, fid)); \
+ EXPECT_TRUE(value1 == env_->GetStatic ## type ## Field(c, fid)); \
env_->SetStatic ## type ## Field(c, fid, value2); \
- EXPECT_EQ(value2, env_->GetStatic ## type ## Field(c, fid)); \
+ EXPECT_TRUE(value2 == env_->GetStatic ## type ## Field(c, fid)); \
} while (false)
#define EXPECT_PRIMITIVE_FIELD(instance, type, field_name, sig, value1, value2) \
@@ -654,9 +654,9 @@ TEST_F(JniInternalTest, GetObjectArrayElement_SetObjectArrayElement) {
jfieldID fid = env_->GetFieldID(c, field_name, sig); \
EXPECT_TRUE(fid != NULL); \
env_->Set ## type ## Field(instance, fid, value1); \
- EXPECT_EQ(value1, env_->Get ## type ## Field(instance, fid)); \
+ EXPECT_TRUE(value1 == env_->Get ## type ## Field(instance, fid)); \
env_->Set ## type ## Field(instance, fid, value2); \
- EXPECT_EQ(value2, env_->Get ## type ## Field(instance, fid)); \
+ EXPECT_TRUE(value2 == env_->Get ## type ## Field(instance, fid)); \
} while (false)