Index: /trunk/src/VBox/Disassembler/DisasmCore.cpp
===================================================================
--- /trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 41786)
+++ /trunk/src/VBox/Disassembler/DisasmCore.cpp	(revision 41787)
@@ -313,5 +313,5 @@
     }
 
-    disReadMore(pCpu, offInstr, 1);
+    disReadMore(pCpu, (uint8_t)offInstr, 1);
     return pCpu->abInstr[offInstr];
 }
@@ -353,5 +353,5 @@
     }
 
-    disReadMore(pCpu, offInstr, 2);
+    disReadMore(pCpu, (uint8_t)offInstr, 2);
 #ifdef DIS_HOST_UNALIGNED_ACCESS_OK
     return *(uint16_t const *)&pCpu->abInstr[offInstr];
@@ -409,5 +409,5 @@
     }
 
-    disReadMore(pCpu, offInstr, 4);
+    disReadMore(pCpu, (uint8_t)offInstr, 4);
 #ifdef DIS_HOST_UNALIGNED_ACCESS_OK
     return *(uint32_t const *)&pCpu->abInstr[offInstr];
@@ -481,5 +481,5 @@
     }
 
-    disReadMore(pCpu, offInstr, 8);
+    disReadMore(pCpu, (uint8_t)offInstr, 8);
 #ifdef DIS_HOST_UNALIGNED_ACCESS_OK
     return *(uint64_t const *)&pCpu->abInstr[offInstr];
@@ -519,7 +519,7 @@
 //*****************************************************************************
 //*****************************************************************************
-static unsigned disParseInstruction(size_t offInstr, PCDISOPCODE pOp, PDISCPUSTATE pCpu)
-{
-    int  size = 0;
+static size_t disParseInstruction(size_t offInstr, PCDISOPCODE pOp, PDISCPUSTATE pCpu)
+{
+    size_t size = 0;
     bool fFiltered = false;
 
@@ -595,5 +595,5 @@
     int index;
     PCDISOPCODE fpop;
-    unsigned size = 0;
+    size_t size = 0;
     unsigned ModRM;
     NOREF(pOp);
@@ -948,8 +948,8 @@
 // Query the size of the ModRM parameters and fetch the immediate data (if any)
 //*****************************************************************************
-static unsigned QueryModRM(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
-{
-    unsigned sibinc;
-    unsigned size = 0;
+static size_t QueryModRM(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu, size_t *pSibInc)
+{
+    size_t sibinc;
+    size_t size = 0;
     // unsigned reg = pCpu->ModRM.Bits.Reg;
     unsigned mod = pCpu->ModRM.Bits.Mod;
@@ -1031,8 +1031,8 @@
 // Query the size of the ModRM parameters and fetch the immediate data (if any)
 //*****************************************************************************
-static unsigned QueryModRM_SizeOnly(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu, unsigned *pSibInc)
-{
-    unsigned sibinc;
-    unsigned size = 0;
+static size_t QueryModRM_SizeOnly(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu, size_t *pSibInc)
+{
+    size_t sibinc;
+    size_t size = 0;
     // unsigned reg = pCpu->ModRM.Bits.Reg;
     unsigned mod = pCpu->ModRM.Bits.Mod;
@@ -1116,8 +1116,8 @@
 static size_t ParseModRM(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = sizeof(uint8_t);   //ModRM byte
-    unsigned sibinc, ModRM;
-
-    ModRM = disReadByte(pCpu, offInstr);
+    size_t size = sizeof(uint8_t);   //ModRM byte
+    size_t sibinc;
+
+    unsigned ModRM = disReadByte(pCpu, offInstr);
     offInstr += sizeof(uint8_t);
 
@@ -1162,8 +1162,8 @@
 static size_t ParseModRM_SizeOnly(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = sizeof(uint8_t);   //ModRM byte
-    unsigned sibinc, ModRM;
-
-    ModRM = disReadByte(pCpu, offInstr);
+    size_t size = sizeof(uint8_t);   //ModRM byte
+    size_t sibinc;
+
+    unsigned ModRM = disReadByte(pCpu, offInstr);
     offInstr += sizeof(uint8_t);
 
@@ -1793,5 +1793,5 @@
 {
     PCDISOPCODE   pOpcode;
-    int           size    = sizeof(uint8_t);
+    size_t        size    = sizeof(uint8_t);
     NOREF(pOp); NOREF(pParam);
 
@@ -1852,5 +1852,5 @@
 {
     PCDISOPCODE   pOpcode;
-    int           size    = sizeof(uint8_t);
+    size_t        size    = sizeof(uint8_t);
     NOREF(pOp); NOREF(pParam);
 
@@ -1913,5 +1913,5 @@
 {
     PCDISOPCODE   pOpcode;
-    int           size    = sizeof(uint8_t);
+    size_t        size    = sizeof(uint8_t);
     NOREF(pOp); NOREF(pParam);
 
@@ -1947,5 +1947,5 @@
 static size_t ParseNopPause(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0;
+    size_t size = 0;
     NOREF(pParam);
 
@@ -1966,9 +1966,9 @@
 {
     int idx = (pCpu->bOpCode - 0x80) * 8;
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group1[idx+reg];
@@ -1986,5 +1986,5 @@
 {
     int idx;
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
@@ -2008,8 +2008,8 @@
     }
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
-
-    pOp = (PCDISOPCODE)&g_aMapX86_Group2[idx+reg];
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
+
+    pOp = &g_aMapX86_Group2[idx+reg];
 
     //little hack to make sure the ModRM byte is included in the returned size
@@ -2026,9 +2026,9 @@
 {
     int idx = (pCpu->bOpCode - 0xF6) * 8;
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group3[idx+reg];
@@ -2046,9 +2046,9 @@
 static size_t ParseGrp4(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group4[reg];
@@ -2066,9 +2066,9 @@
 static size_t ParseGrp5(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group5[reg];
@@ -2090,5 +2090,5 @@
 static size_t Parse3DNow(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrmsize;
+    size_t size = 0;
 
 #ifdef DEBUG_Sander
@@ -2102,5 +2102,5 @@
     pCpu->ModRM.Bits.Reg = MODRM_REG(ModRM);
 
-    modrmsize = QueryModRM(offInstr+sizeof(uint8_t), pOp, pParam, pCpu, NULL);
+    size_t modrmsize = QueryModRM(offInstr+sizeof(uint8_t), pOp, pParam, pCpu, NULL);
 
     uint8_t opcode = disReadByte(pCpu, offInstr+sizeof(uint8_t)+modrmsize);
@@ -2126,9 +2126,9 @@
 static size_t ParseGrp6(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group6[reg];
@@ -2146,11 +2146,11 @@
 static size_t ParseGrp7(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg, rm, mod;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    mod   = MODRM_MOD(modrm);
-    reg   = MODRM_REG(modrm);
-    rm    = MODRM_RM(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned mod   = MODRM_MOD(modrm);
+    unsigned reg   = MODRM_REG(modrm);
+    unsigned rm    = MODRM_RM(modrm);
 
     if (mod == 3 && rm == 0)
@@ -2174,9 +2174,9 @@
 static size_t ParseGrp8(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group8[reg];
@@ -2194,9 +2194,9 @@
 static size_t ParseGrp9(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group9[reg];
@@ -2214,9 +2214,9 @@
 static size_t ParseGrp10(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group10[reg];
@@ -2234,9 +2234,9 @@
 static size_t ParseGrp12(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     if (pCpu->fPrefix & DISPREFIX_OPSIZE)
@@ -2256,9 +2256,9 @@
 static size_t ParseGrp13(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
     if (pCpu->fPrefix & DISPREFIX_OPSIZE)
         reg += 8;   //2nd table
@@ -2278,9 +2278,9 @@
 static size_t ParseGrp14(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
     if (pCpu->fPrefix & DISPREFIX_OPSIZE)
         reg += 8;   //2nd table
@@ -2300,11 +2300,11 @@
 static size_t ParseGrp15(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg, mod, rm;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    mod   = MODRM_MOD(modrm);
-    reg   = MODRM_REG(modrm);
-    rm    = MODRM_RM(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned mod   = MODRM_MOD(modrm);
+    unsigned reg   = MODRM_REG(modrm);
+    unsigned rm    = MODRM_RM(modrm);
 
     if (mod == 3 && rm == 0)
@@ -2324,9 +2324,9 @@
 static size_t ParseGrp16(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISCPUSTATE pCpu)
 {
-    unsigned size = 0, modrm, reg;
+    size_t size = 0;
     NOREF(pParam);
 
-    modrm = disReadByte(pCpu, offInstr);
-    reg   = MODRM_REG(modrm);
+    unsigned modrm = disReadByte(pCpu, offInstr);
+    unsigned reg   = MODRM_REG(modrm);
 
     pOp = (PCDISOPCODE)&g_aMapX86_Group16[reg];
@@ -2630,7 +2630,7 @@
     }
 
-    pCpu->cbInstr = offInstr;
+    pCpu->cbInstr = (uint8_t)offInstr;
     if (pcbInstr)
-        *pcbInstr = offInstr;
+        *pcbInstr = (uint32_t)offInstr;
 
     if (pCpu->fPrefix & DISPREFIX_LOCK)
