VirtualBox

Changeset 26526 in vbox


Ignore:
Timestamp:
Feb 15, 2010 3:36:01 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57697
Message:

VMM,asm.h,Config.kmk: win.amd64 warnings; fixed the ASMAtomicSubU32 signature.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Config.kmk

    r26523 r26526  
    18591859  VBOX_GCC_WERR ?= -Werror
    18601860  VBOX_VCC_WERR ?= -WX
     1861  VBOX_VCC_LD_WERR ?= ## @todo later also: -WX
    18611862 endif
    18621863endif
     
    21642165  endif
    21652166  TEMPLATE_VBoxRc_CFLAGS             = $(TEMPLATE_VBoxRc_CXXFLAGS)
    2166   TEMPLATE_VBoxRc_LDFLAGS            = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Lines -MapInfo:Exports -NoD $(VBOX_VCC_WERR)
     2167  TEMPLATE_VBoxRc_LDFLAGS            = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Lines -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR)
    21672168  ifndef VBOX_NOINC_MISC
    21682169   include $(KBUILD_PATH)/sdks/W2K3DDKX86.kmk
     
    22872288 endif
    22882289TEMPLATE_VBoxR0_CFLAGS              = $(TEMPLATE_VBoxR0_CXXFLAGS)
    2289 TEMPLATE_VBoxR0_LDFLAGS             = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_WERR)
     2290TEMPLATE_VBoxR0_LDFLAGS             = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR)
    22902291TEMPLATE_VBoxR0_LIBS                = \
    22912292        $(PATH_LIB)/RuntimeR0Stub$(VBOX_SUFF_LIB)
     
    27252726 TEMPLATE_VBoxR3Dll_CFLAGS            += $(VBOX_VCC_WERR)
    27262727 TEMPLATE_VBoxR3Dll_CXXFLAGS          += $(VBOX_VCC_WERR)
    2727  TEMPLATE_VBoxR3Dll_LDFLAGS           += $(VBOX_VCC_WERR)
     2728 TEMPLATE_VBoxR3Dll_LDFLAGS           += $(VBOX_VCC_LD_WERR)
    27282729else
    27292730 TEMPLATE_VBoxR3Dll_CFLAGS            += $(VBOX_GCC_WERR)
     
    27662767 TEMPLATE_VBoxR3Static_CFLAGS      += $(VBOX_VCC_WERR)
    27672768 TEMPLATE_VBoxR3Static_CXXFLAGS    += $(VBOX_VCC_WERR)
    2768  TEMPLATE_VBoxR3Static_LDFLAGS     += $(VBOX_VCC_WERR)
     2769 TEMPLATE_VBoxR3Static_LDFLAGS     += $(VBOX_VCC_LD_WERR)
    27692770else
    27702771 TEMPLATE_VBoxR3Static_CFLAGS      += $(VBOX_GCC_WERR)
  • TabularUnified trunk/include/iprt/asm.h

    r25671 r26526  
    37043704 *
    37053705 * @returns The old value.
    3706  * @param   pi32        Pointer to the value.
    3707  * @param   i32         Number to subtract.
    3708  */
    3709 DECLINLINE(uint32_t) ASMAtomicSubU32(int32_t volatile *pi32, uint32_t i32)
    3710 {
    3711     return ASMAtomicAddU32((uint32_t volatile *)pi32, (uint32_t)-(int32_t)i32);
     3706 * @param   pu32        Pointer to the value.
     3707 * @param   u32         Number to subtract.
     3708 */
     3709DECLINLINE(uint32_t) ASMAtomicSubU32(uint32_t volatile *pu32, uint32_t u32)
     3710{
     3711    return ASMAtomicAddU32(pu32, (uint32_t)-(int32_t)u32);
    37123712}
    37133713
  • TabularUnified trunk/src/VBox/Devices/Audio/coreaudio.c

    r26101 r26526  
    168168    pBuffer->uReadPos = (pBuffer->uReadPos + cSize) % pBuffer->cBufSize;
    169169
    170     ASMAtomicSubU32((int32_t*)&pBuffer->cBufferUsed, cSize);
     170    ASMAtomicSubU32(&pBuffer->cBufferUsed, cSize);
    171171}
    172172
  • TabularUnified trunk/src/VBox/VMM/Makefile.kmk

    r26523 r26526  
    181181        PDMAsyncCompletionFileCache.cpp
    182182endif
     183if defined(VBOX_WITH_WARNINGS_AS_ERRORS) && "$(KBUILD_TARGET)" == "win"
     184PDMAsyncCompletionFileCache.cpp_CXXFLAGS = -WX-
     185endif
    183186
    184187ifdef VBOX_WITH_RAW_MODE
  • TabularUnified trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp

    r26338 r26526  
    326326    else
    327327    {
    328         uint32_t uOld = ASMAtomicSubU32(&pTaskFile->cbTransferLeft, pTask->DataSeg.cbSeg);
     328        Assert((uint32_t)pTask->DataSeg.cbSeg == pTask->DataSeg.cbSeg && (int32_t)pTask->DataSeg.cbSeg >= 0);
     329        uint32_t uOld = ASMAtomicSubS32(&pTaskFile->cbTransferLeft, (int32_t)pTask->DataSeg.cbSeg);
    329330
    330331        if (!(uOld - pTask->DataSeg.cbSeg)
     
    347348           || (enmTransfer == PDMACTASKFILETRANSFER_WRITE));
    348349
    349     ASMAtomicWriteS32(&pTaskFile->cbTransferLeft, cbTransfer);
     350    Assert((uint32_t)cbTransfer == cbTransfer && (uint32_t)cbTransfer >= 0);
     351    ASMAtomicWriteS32(&pTaskFile->cbTransferLeft, (int32_t)cbTransfer);
    350352    ASMAtomicWriteBool(&pTaskFile->fCompleted, false);
    351353
  • TabularUnified trunk/src/VBox/VMM/PDMAsyncCompletionFileCache.cpp

    r26334 r26526  
    605605    PPDMACFILETASKSEG pNext = pTaskSeg->pNext;
    606606
    607     uint32_t uOld = ASMAtomicSubU32(&pTaskSeg->pTask->cbTransferLeft, pTaskSeg->cbTransfer);
     607    uint32_t uOld = ASMAtomicSubS32(&pTaskSeg->pTask->cbTransferLeft, pTaskSeg->cbTransfer);
    608608    AssertMsg(uOld >= pTaskSeg->cbTransfer, ("New value would overflow\n"));
    609609    if (!(uOld - pTaskSeg->cbTransfer)
     
    17711771                LogFlow(("Evicted enough bytes (%u requested). Creating new cache entry\n", cbToWrite));
    17721772
    1773                 uint8_t *pbBuf;
    17741773                PPDMACFILECACHEENTRY pEntryNew;
    17751774
  • TabularUnified trunk/src/VBox/VMM/PDMAsyncCompletionFileNormal.cpp

    r26491 r26526  
    374374static int pdmacFileAioMgrNormalReqsEnqueue(PPDMACEPFILEMGR pAioMgr,
    375375                                            PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint,
    376                                             PRTFILEAIOREQ pahReqs, size_t cReqs)
     376                                            PRTFILEAIOREQ pahReqs, unsigned cReqs)
    377377{
    378378    int rc;
  • TabularUnified trunk/src/VBox/VMM/SSM.cpp

    r25235 r26526  
    559559             * @{ */
    560560            /** The size of the file header. */
    561             size_t          cbFileHdr;
     561            uint32_t        cbFileHdr;
    562562            /** The major version number. */
    563563            uint16_t        u16VerMajor;
     
    23462346    Assert(pStrm->pCur);
    23472347    Assert(pStrm->off + cb <= RT_SIZEOFMEMB(SSMSTRMBUF, abData));
    2348     pStrm->off += cb;
     2348    pStrm->off += (uint32_t)cb;
    23492349    return VINF_SUCCESS;
    23502350}
     
    34083408    while (cbToFill > 0)
    34093409    {
    3410         size_t cb = RT_MIN(sizeof(g_abZero), cbToFill);
     3410        uint32_t cb = RT_MIN(sizeof(g_abZero), cbToFill);
    34113411        int rc = ssmR3DataWrite(pSSM, g_abZero, cb);
    34123412        if (RT_FAILURE(rc))
     
    57985798                    /* Spill the remainer into the data buffer. */
    57995799                    memset(&pSSM->u.Read.abDataBuffer[0], 0, cbToRead - cbBuf);
    5800                     pSSM->u.Read.cbDataBuffer  = cbToRead - cbBuf;
     5800                    pSSM->u.Read.cbDataBuffer  = cbToRead - (uint32_t)cbBuf;
    58015801                    pSSM->u.Read.offDataBuffer = 0;
    58025802                    cbToRead = (uint32_t)cbBuf;
     
    69026902                while (pSSM->u.Read.cbRecLeft)
    69036903                {
    6904                     uint8_t abBuf[8192];
    6905                     size_t cbToRead = RT_MIN(pSSM->u.Read.cbRecLeft, sizeof(abBuf));
     6904                    uint8_t  abBuf[8192];
     6905                    uint32_t cbToRead = RT_MIN(pSSM->u.Read.cbRecLeft, sizeof(abBuf));
    69066906                    int rc = ssmR3DataReadV2Raw(pSSM, abBuf, cbToRead);
    69076907                    if (RT_FAILURE(rc))
     
    71427142    {
    71437143        char        szMagic[sizeof(SSMFILEHDR_MAGIC_V2_0)];
    7144         size_t      cbHdr;
     7144        uint32_t    cbHdr;
    71457145        unsigned    uFmtVerMajor;
    71467146        unsigned    uFmtVerMinor;
     
    84658465    int rc = ssmR3StrmPeekAt(&pSSM->Strm, offDir, pDir, cbDir, NULL);
    84668466    AssertLogRelRCReturn(rc, rc);
    8467     rc = ssmR3ValidateDirectory(pDir, cbDir, offDir, cDirEntries, pSSM->u.Read.cbFileHdr, pSSM->u.Read.u32SvnRev);
     8467    rc = ssmR3ValidateDirectory(pDir, (uint32_t)cbDir, offDir, cDirEntries, pSSM->u.Read.cbFileHdr, pSSM->u.Read.u32SvnRev);
    84688468    if (RT_FAILURE(rc))
    84698469        return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette