OSDN Git Service

Sim fixes.
authorAndy McFadden <fadden@android.com>
Fri, 21 May 2010 17:58:40 +0000 (10:58 -0700)
committerAndy McFadden <fadden@android.com>
Fri, 21 May 2010 18:00:14 +0000 (11:00 -0700)
Pulled a fix to the simulator app ("long" is 64-bit when 32-bit was
needed) from master.  sim-eng is useful for verifying the x86 SMP stuff.

Also quieted a compiler warning.

Change-Id: I399ea4923b7e0650d5f995e056c751374b057fbd

simulator/app/MessageStream.cpp
simulator/wrapsim/SimMgr.c

index 2397c63..c52e7c4 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "utils/Log.h"
 
+#include <stdint.h>
 #include <string.h>
 #include <assert.h>
 
@@ -338,7 +339,7 @@ bool MessageStream::init(Pipe* readPipe, Pipe* writePipe, bool initiateHello)
      * and capability flags.
      */
     if (initiateHello) {
-        long data = kHelloMsg;
+        int32_t data = kHelloMsg;
         Message msg;
 
         /* send hello */
@@ -357,14 +358,15 @@ bool MessageStream::init(Pipe* readPipe, Pipe* writePipe, bool initiateHello)
             return false;
         }
 
-        const long* pAck;
-        pAck = (const long*) msg.getData();
+        const int32_t* pAck;
+        pAck = (const int32_t*) msg.getData();
         if (pAck == NULL || *pAck != kHelloAckMsg) {
-            LOG(LOG_WARN, "", "hello ack was bad\n");
+            LOG(LOG_WARN, "", "hello ack was bad (%08x vs %08x)\n",
+                *pAck, kHelloAckMsg);
             return false;
         }
     } else {
-        long data = kHelloAckMsg;
+        int32_t data = kHelloAckMsg;
         Message msg;
 
         LOG(LOG_DEBUG, "", "waiting for hello from peer\n");
@@ -375,8 +377,8 @@ bool MessageStream::init(Pipe* readPipe, Pipe* writePipe, bool initiateHello)
             return false;
         }
 
-        const long* pAck;
-        pAck = (const long*) msg.getData();
+        const int32_t* pAck;
+        pAck = (const int32_t*) msg.getData();
         if (pAck == NULL || *pAck != kHelloMsg) {
             LOG(LOG_WARN, "", "hello was bad\n");
             return false;
index a35c7c6..9b566cf 100644 (file)
@@ -763,8 +763,8 @@ static int getSimConfig(void)
                     goto bail;
             }
         } else if (msg.mType == kTypeConfig) {
-            const char *name;
-            const char *val;
+            const char* name = NULL;
+            const char* val = NULL;
             getConfig(&msg, &name, &val);
             if(strcmp(name, "keycharmap") == 0) {
                 free((void*)gWrapSim.keyMap);