Fix implicit conversions, rename reserved works, enable -Wc++-compat.

Change-Id: I06292964a6882ea2d0c17c5c962db95e46b01543
diff --git a/vm/compiler/codegen/arm/Assemble.c b/vm/compiler/codegen/arm/Assemble.c
index 42a8d37..16e8e15 100644
--- a/vm/compiler/codegen/arm/Assemble.c
+++ b/vm/compiler/codegen/arm/Assemble.c
@@ -973,7 +973,8 @@
             int delta = target - pc;
             if (delta > 126 || delta < 0) {
                 /* Convert to cmp rx,#0 / b[eq/ne] tgt pair */
-                ArmLIR *newInst = dvmCompilerNew(sizeof(ArmLIR), true);
+                ArmLIR *newInst =
+                    (ArmLIR *)dvmCompilerNew(sizeof(ArmLIR), true);
                 /* Make new branch instruction and insert after */
                 newInst->opcode = kThumbBCond;
                 newInst->operands[0] = 0;
@@ -1280,7 +1281,7 @@
     }
 
     /* Allocate enough space for the code block */
-    cUnit->codeBuffer = dvmCompilerNew(chainCellOffset, true);
+    cUnit->codeBuffer = (unsigned char *)dvmCompilerNew(chainCellOffset, true);
     if (cUnit->codeBuffer == NULL) {
         LOGE("Code buffer allocation failure\n");
         cUnit->baseAddr = NULL;
@@ -1487,7 +1488,7 @@
          * will bring the uninitialized chaining cell to life.
          */
         android_atomic_release_store((int32_t)newContent->clazz,
-            (void*) &cellAddr->clazz);
+            (volatile int32_t *)(void *)&cellAddr->clazz);
         cacheflush((intptr_t) cellAddr, (intptr_t) (cellAddr+1), 0);
         UPDATE_CODE_CACHE_PATCHES();
 
@@ -1583,7 +1584,7 @@
          * trigger immediate patching and will continue to fail to match with
          * a real clazz pointer.
          */
-        cell->clazz = (void *) PREDICTED_CHAIN_FAKE_CLAZZ;
+        cell->clazz = (ClassObject *) PREDICTED_CHAIN_FAKE_CLAZZ;
 
         UPDATE_CODE_CACHE_PATCHES();
         PROTECT_CODE_CACHE(cell, sizeof(*cell));
@@ -1912,7 +1913,7 @@
      * be a meta info field (only used by callsite info for now).
      */
     if (!desc->trace[idx].frag.isCode) {
-        const Method *method = desc->trace[idx+1].meta;
+        const Method *method = (const Method *)desc->trace[idx+1].meta;
         char *methodDesc = dexProtoCopyMethodDescriptor(&method->prototype);
         /* Print the callee info in the trace */
         LOGD("    -> %s%s;%s", method->clazz->descriptor, method->name,
@@ -1964,8 +1965,8 @@
 /* qsort callback function */
 static int sortTraceProfileCount(const void *entry1, const void *entry2)
 {
-    const JitEntry *jitEntry1 = entry1;
-    const JitEntry *jitEntry2 = entry2;
+    const JitEntry *jitEntry1 = (const JitEntry *)entry1;
+    const JitEntry *jitEntry2 = (const JitEntry *)entry2;
 
     int count1 = getProfileCount(jitEntry1);
     int count2 = getProfileCount(jitEntry2);
@@ -1984,7 +1985,7 @@
     dvmLockMutex(&gDvmJit.tableLock);
 
     /* Sort the entries by descending order */
-    sortedEntries = malloc(sizeof(JitEntry) * gDvmJit.jitTableSize);
+    sortedEntries = (JitEntry *)malloc(sizeof(JitEntry) * gDvmJit.jitTableSize);
     if (sortedEntries == NULL)
         goto done;
     memcpy(sortedEntries, gDvmJit.pJitEntryTable,