VirtualBox

Changeset 14281 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Nov 18, 2008 9:50:33 AM (16 years ago)
Author:
vboxsync
Message:

Storage/VMDK: Use AssertPtr whereever applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r13580 r14281  
    540540    PVMDKFILE pVmdkFile = *ppVmdkFile;
    541541
    542     Assert(VALID_PTR(pVmdkFile));
     542    AssertPtr(pVmdkFile);
    543543
    544544    pVmdkFile->fDelete |= fDelete;
     
    698698    char *pszDst = szEnc;
    699699
    700     Assert(VALID_PTR(psz));
     700    AssertPtr(psz);
    701701
    702702    for (; *psz; psz = RTStrNextCp(psz))
     
    742742        return VERR_BUFFER_OVERFLOW;
    743743
    744     Assert(VALID_PTR(psz));
     744    AssertPtr(psz);
    745745
    746746    for (; *pszEncoded; pszEncoded = RTStrNextCp(pszEncoded))
     
    29702970    /* Basename strings needed for constructing the extent names. */
    29712971    char *pszBasenameSubstr = RTPathFilename(pImage->pszFilename);
    2972     Assert(pszBasenameSubstr);
     2972    AssertPtr(pszBasenameSubstr);
    29732973    size_t cbBasenameSubstr = strlen(pszBasenameSubstr) + 1;
    29742974
     
    33673367static void vmdkFreeImage(PVMDKIMAGE pImage, bool fDelete)
    33683368{
    3369     Assert(pImage);
     3369    AssertPtr(pImage);
    33703370
    33713371    if (pImage->enmImageType)
     
    39433943static char * vmdkStrReplace(const char *pszWhere, const char *pszWhat, const char *pszByWhat)
    39443944{
    3945     Assert(VALID_PTR(pszWhere));
    3946     Assert(VALID_PTR(pszWhat));
    3947     Assert(VALID_PTR(pszByWhat));
     3945    AssertPtr(pszWhere);
     3946    AssertPtr(pszWhat);
     3947    AssertPtr(pszByWhat);
    39483948    const char *pszFoundStr = strstr(pszWhere, pszWhat);
    39493949    if (!pszFoundStr)
     
    41514151        }
    41524152        else
    4153         {   
     4153        {
    41544154            /* Shouldn't be null for separate descriptor.
    41554155             * There will be no access to the actual content.
    41564156             */
    4157             pImage->pDescData = pszOldDescName; 
     4157            pImage->pDescData = pszOldDescName;
    41584158            pImage->pFile = pFile;
    41594159        }
     
    42404240    int rc;
    42414241
    4242     Assert(pImage);
     4242    AssertPtr(pImage);
    42434243    Assert(uOffset % 512 == 0);
    42444244    Assert(cbToRead % 512 == 0);
     
    42964296            break;
    42974297    }
    4298     *pcbActuallyRead = cbToRead;
     4298    if (pcbActuallyRead)
     4299        *pcbActuallyRead = cbToRead;
    42994300
    43004301out:
     
    43154316    int rc;
    43164317
    4317     Assert(pImage);
     4318    AssertPtr(pImage);
    43184319    Assert(uOffset % 512 == 0);
    43194320    Assert(cbToWrite % 512 == 0);
     
    44214422    int rc;
    44224423
    4423     Assert(pImage);
     4424    AssertPtr(pImage);
    44244425
    44254426    rc = vmdkFlushImage(pImage);
     
    44344435    PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
    44354436
    4436     Assert(pImage);
     4437    AssertPtr(pImage);
    44374438
    44384439    if (pImage)
     
    44494450    int rc = VINF_SUCCESS;
    44504451
    4451     Assert(pImage);
    4452     Assert(penmImageType);
     4452    AssertPtr(pImage);
     4453    AssertPtr(penmImageType);
    44534454
    44544455    if (pImage && pImage->cExtents != 0)
     
    44674468    PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
    44684469
    4469     Assert(pImage);
     4470    AssertPtr(pImage);
    44704471
    44714472    if (pImage)
     
    44824483    uint64_t cb = 0;
    44834484
    4484     Assert(pImage);
     4485    AssertPtr(pImage);
    44854486
    44864487    if (pImage)
     
    45134514    int rc;
    45144515
    4515     Assert(pImage);
     4516    AssertPtr(pImage);
    45164517
    45174518    if (pImage)
     
    45404541    int rc;
    45414542
    4542     Assert(pImage);
     4543    AssertPtr(pImage);
    45434544
    45444545    if (pImage)
     
    45724573    int rc;
    45734574
    4574     Assert(pImage);
     4575    AssertPtr(pImage);
    45754576
    45764577    if (pImage)
     
    45994600    int rc;
    46004601
    4601     Assert(pImage);
     4602    AssertPtr(pImage);
    46024603
    46034604    if (pImage)
     
    46304631    unsigned uImageFlags;
    46314632
    4632     Assert(pImage);
     4633    AssertPtr(pImage);
    46334634
    46344635    if (pImage)
     
    46484649    unsigned uOpenFlags;
    46494650
    4650     Assert(pImage);
     4651    AssertPtr(pImage);
    46514652
    46524653    if (pImage)
     
    46914692    int rc;
    46924693
    4693     Assert(pImage);
     4694    AssertPtr(pImage);
    46944695
    46954696    if (pImage)
     
    47254726    int rc;
    47264727
    4727     Assert(pImage);
     4728    AssertPtr(pImage);
    47284729
    47294730    if (pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
     
    47504751    int rc;
    47514752
    4752     Assert(pImage);
     4753    AssertPtr(pImage);
    47534754
    47544755    if (pImage)
     
    47724773
    47734774    LogFlowFunc(("%RTuuid\n", pUuid));
    4774     Assert(pImage);
     4775    AssertPtr(pImage);
    47754776
    47764777    if (pImage)
     
    48024803    int rc;
    48034804
    4804     Assert(pImage);
     4805    AssertPtr(pImage);
    48054806
    48064807    if (pImage)
     
    48234824    int rc;
    48244825
    4825     Assert(pImage);
     4826    AssertPtr(pImage);
    48264827
    48274828    if (pImage)
     
    48534854    int rc;
    48544855
    4855     Assert(pImage);
     4856    AssertPtr(pImage);
    48564857
    48574858    if (pImage)
     
    48744875    int rc;
    48754876
    4876     Assert(pImage);
     4877    AssertPtr(pImage);
    48774878
    48784879    if (pImage)
     
    49044905    int rc;
    49054906
    4906     Assert(pImage);
     4907    AssertPtr(pImage);
    49074908
    49084909    if (pImage)
     
    49254926    int rc;
    49264927
    4927     Assert(pImage);
     4928    AssertPtr(pImage);
    49284929
    49294930    if (pImage)
     
    49534954    PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
    49544955
    4955     Assert(pImage);
     4956    AssertPtr(pImage);
    49564957    if (pImage)
    49574958    {
     
    50375038    unsigned  uOffsetInCurrentSegment = 0;
    50385039
    5039     Assert(pImage);
     5040    AssertPtr(pImage);
    50405041    Assert(uOffset % 512 == 0);
    50415042    Assert(cbRead % 512 == 0);
     
    51735174    unsigned  uOffsetInCurrentSegment = 0;
    51745175
    5175     Assert(pImage);
     5176    AssertPtr(pImage);
    51765177    Assert(uOffset % 512 == 0);
    51775178    Assert(cbWrite % 512 == 0);
Note: See TracChangeset for help on using the changeset viewer.

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