Index: /trunk/kLdr/kLdrModMachO.c
===================================================================
--- /trunk/kLdr/kLdrModMachO.c	(revision 87)
+++ /trunk/kLdr/kLdrModMachO.c	(revision 88)
@@ -219,8 +219,8 @@
 static int  kldrModMachODoQuerySymbol32Bit(PKLDRMODMACHO pModMachO, const macho_nlist_32_t *paSyms, KU32 cSyms, const char *pchStrings,
                                            KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol, const char *pchSymbol,
-                                           KSIZE cchSymbol, PKLDRADDR puValue, KU32 *pfKind);
+                                           KU32 cchSymbol, PKLDRADDR puValue, KU32 *pfKind);
 static int  kldrModMachODoQuerySymbol64Bit(PKLDRMODMACHO pModMachO, const macho_nlist_64_t *paSyms, KU32 cSyms, const char *pchStrings,
                                            KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol, const char *pchSymbol,
-                                           KSIZE cchSymbol, PKLDRADDR puValue, KU32 *pfKind);
+                                           KU32 cchSymbol, PKLDRADDR puValue, KU32 *pfKind);
 static int  kldrModMachODoEnumSymbols32Bit(PKLDRMODMACHO pModMachO, const macho_nlist_32_t *paSyms, KU32 cSyms,
                                            const char *pchStrings, KU32 cchStrings, KLDRADDR BaseAddress,
@@ -408,9 +408,9 @@
     pMod->pOps = NULL;      /* set upon success. */
     pMod->cSegments = cSegments;
-    pMod->cchFilename = cchFilename;
+    pMod->cchFilename = (KU32)cchFilename;
     pMod->pszFilename = (char *)&pMod->aSegments[pMod->cSegments];
     kHlpMemCopy((char *)pMod->pszFilename, kRdrName(pRdr), cchFilename + 1);
     pMod->pszName = kHlpGetFilename(pMod->pszFilename);
-    pMod->cchName = cchFilename - (pMod->pszName - pMod->pszFilename);
+    pMod->cchName = (KU32)(cchFilename - (pMod->pszName - pMod->pszFilename));
     pMod->fFlags = 0;
     switch (s.Hdr32.cputype)
@@ -571,5 +571,5 @@
     KU32 cSegments = 0;
     KU32 cSections = 0;
-    KU32 cbStringPool = 0;
+    KSIZE cbStringPool = 0;
     KU32 cLeft = pHdr->ncmds;
     KU32 cbLeft = pHdr->sizeofcmds;
@@ -1084,5 +1084,5 @@
     *pcSegments = cSegments;
     *pcSections = cSections;
-    *pcbStringPool = cbStringPool;
+    *pcbStringPool = (KU32)cbStringPool;
 
     return 0;
@@ -1154,5 +1154,5 @@
                         kHlpMemCopy(pbStringPool, a_achName2, cchName2); \
                         pbStringPool += cchName2; \
-                        pDstSeg->cchName += cchName2; \
+                        pDstSeg->cchName += (KU32)cchName2; \
                     } \
                     *pbStringPool++ = '\0'; \
@@ -1166,6 +1166,6 @@
                     if (a_fFileBits) \
                     { \
-                        pDstSeg->offFile = (a_offFile) + pModMachO->offImage; \
-                        pDstSeg->cbFile  = (a_cbFile); \
+                        pDstSeg->offFile = (KLDRFOFF)((a_offFile) + pModMachO->offImage); \
+                        pDstSeg->cbFile  = (KLDRFOFF)(a_cbFile); \
                     } \
                     else \
@@ -1178,13 +1178,13 @@
                     pDstSeg->MapAddress = 0; \
                     \
-                    pSegExtra->iOrgSegNo = pSegExtra - &pModMachO->aSegments[0]; \
+                    pSegExtra->iOrgSegNo = (KU32)(pSegExtra - &pModMachO->aSegments[0]); \
                     pSegExtra->cSections = 0; \
                     pSegExtra->paSections = pSectExtra; \
                 } while (0)
 
-                /* Closes the new segment - parter of NEW_SEGMENT. */
+                /* Closes the new segment - part of NEW_SEGMENT. */
                 #define CLOSE_SEGMENT() \
                 do { \
-                    pSegExtra->cSections = pSectExtra - pSegExtra->paSections; \
+                    pSegExtra->cSections = (KU32)(pSectExtra - pSegExtra->paSections); \
                     pSegExtra++; \
                     pDstSeg++; \
@@ -1254,5 +1254,5 @@
                             pSectExtra->offFixups = -1; \
                         pSectExtra->fFlags = pSect->flags; \
-                        pSectExtra->iSegment = pSegExtra - &pModMachO->aSegments[0]; \
+                        pSectExtra->iSegment = (KU32)(pSegExtra - &pModMachO->aSegments[0]); \
                         pSectExtra->pvMachoSection = pSect; \
                         \
@@ -1405,8 +1405,8 @@
     if (pModMachO->fMakeGot)
     {
-        KSIZE cbPtr = (   pModMachO->Hdr.magic == IMAGE_MACHO32_SIGNATURE
-                       || pModMachO->Hdr.magic == IMAGE_MACHO32_SIGNATURE_OE)
-                    ? sizeof(KU32)
-                    : sizeof(KU64);
+        KU32 cbPtr = (   pModMachO->Hdr.magic == IMAGE_MACHO32_SIGNATURE
+                      || pModMachO->Hdr.magic == IMAGE_MACHO32_SIGNATURE_OE)
+                   ? sizeof(KU32)
+                   : sizeof(KU64);
         KU32 cbGot = pModMachO->cSymbols * cbPtr;
         KU32 cbJmpStubs;
@@ -1702,9 +1702,9 @@
                 rc = kldrModMachODoQuerySymbol32Bit(pModMachO, (macho_nlist_32_t *)pModMachO->pvaSymbols, pModMachO->cSymbols,
                                                     pModMachO->pchStrings, pModMachO->cchStrings, BaseAddress, iSymbol, pchSymbol,
-                                                    cchSymbol, puValue, pfKind);
+                                                    (KU32)cchSymbol, puValue, pfKind);
             else
                 rc = kldrModMachODoQuerySymbol64Bit(pModMachO, (macho_nlist_64_t *)pModMachO->pvaSymbols, pModMachO->cSymbols,
                                                     pModMachO->pchStrings, pModMachO->cchStrings, BaseAddress, iSymbol, pchSymbol,
-                                                    cchSymbol, puValue, pfKind);
+                                                    (KU32)cchSymbol, puValue, pfKind);
         }
 
@@ -1750,7 +1750,7 @@
  * @param   pfKind      See kLdrModQuerySymbol.
  */
-static int kldrModMachODoQuerySymbol32Bit(PKLDRMODMACHO pModMachO, const macho_nlist_32_t *paSyms, KU32 cSyms, const char *pchStrings,
-                                          KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol, const char *pchSymbol, KSIZE cchSymbol,
-                                          PKLDRADDR puValue, KU32 *pfKind)
+static int kldrModMachODoQuerySymbol32Bit(PKLDRMODMACHO pModMachO, const macho_nlist_32_t *paSyms, KU32 cSyms,
+                                          const char *pchStrings, KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol,
+                                          const char *pchSymbol, KU32 cchSymbol, PKLDRADDR puValue, KU32 *pfKind)
 {
     /*
@@ -1878,7 +1878,7 @@
  * @param   pfKind      See kLdrModQuerySymbol.
  */
-static int kldrModMachODoQuerySymbol64Bit(PKLDRMODMACHO pModMachO, const macho_nlist_64_t *paSyms, KU32 cSyms, const char *pchStrings,
-                                          KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol, const char *pchSymbol, KSIZE cchSymbol,
-                                          PKLDRADDR puValue, KU32 *pfKind)
+static int kldrModMachODoQuerySymbol64Bit(PKLDRMODMACHO pModMachO, const macho_nlist_64_t *paSyms, KU32 cSyms,
+                                          const char *pchStrings, KU32 cchStrings, KLDRADDR BaseAddress, KU32 iSymbol,
+                                          const char *pchSymbol, KU32 cchSymbol, PKLDRADDR puValue, KU32 *pfKind)
 {
     /*
@@ -3598,5 +3598,5 @@
                     KLDRMODMACHO_CHECK_RETURN((KU32)paSyms[iSym].n_sect - 1 <= pModMachO->cSections, KLDR_ERR_MACHO_BAD_SYMBOL);
                     pSymSect = &pModMachO->paSections[paSyms[iSym].n_sect - 1];
-                    paGOT[iSym] = paSyms[iSym].n_value - pSymSect->LinkAddress + pSymSect->RVA + NewBaseAddress;
+                    paGOT[iSym] = (KU32)(paSyms[iSym].n_value - pSymSect->LinkAddress + pSymSect->RVA + NewBaseAddress);
                     break;
                 }
@@ -3654,5 +3654,5 @@
 
                     /* create the template. */
-                    off = pModMachO->GotRVA - (pModMachO->JmpStubsRVA + 6);
+                    off = (KI32)(pModMachO->GotRVA - (pModMachO->JmpStubsRVA + 6));
                     Tmpl.ab[0] = 0xff; /* jmp [GOT-entry wrt RIP] */
                     Tmpl.ab[1] = 0x25;
