VirtualBox

Changeset 104490 in vbox for trunk/src/libs/xpcom18a4


Ignore:
Timestamp:
May 2, 2024 4:43:26 PM (11 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163012
Message:

src/libs/xpcom/io: Some smaller cleanups, fix a possible double expansion of a statement with side effects passed to a macro, bugref:3409

Location:
trunk/src/libs/xpcom18a4/xpcom/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/io/nsDirectoryService.cpp

    r101962 r104490  
    9292        return NS_ERROR_FAILURE;
    9393
    94     nsresult rv;
    95 
    9694    nsCOMPtr<nsIProperties> dirService;
    97     rv = nsDirectoryService::Create(nsnull,
    98                                     NS_GET_IID(nsIProperties),
    99                                     getter_AddRefs(dirService));  // needs to be around for life of product
     95    nsDirectoryService::Create(nsnull,
     96                               NS_GET_IID(nsIProperties),
     97                               getter_AddRefs(dirService));  // needs to be around for life of product
    10098
    10199    if (dirService)
     
    121119#if defined(XP_MACOSX)
    122120# ifdef MOZ_DEFAULT_VBOX_XPCOM_HOME
    123     rv = localFile->InitWithNativePath(nsDependentCString(MOZ_DEFAULT_VBOX_XPCOM_HOME));
     121    nsresult rv = localFile->InitWithNativePath(nsDependentCString(MOZ_DEFAULT_VBOX_XPCOM_HOME));
    124122    if (NS_SUCCEEDED(rv))
    125123        *aFile = localFile;
     
    141139                if (CFURLGetFileSystemRepresentation(parentURL, PR_TRUE, (UInt8 *)buffer, sizeof(buffer)))
    142140                {
    143                     rv = localFile->InitWithNativePath(nsDependentCString(buffer));
     141                    nsresult rv = localFile->InitWithNativePath(nsDependentCString(buffer));
    144142                    if (NS_SUCCEEDED(rv))
    145143                        *aFile = localFile;
     
    623621        rv = GetSpecialSystemDirectory(OS_TemporaryDirectory, getter_AddRefs(localFile));
    624622    }
    625     else if (inAtom == nsDirectoryService::sOS_CurrentProcessDirectory)
    626     {
    627         rv = GetSpecialSystemDirectory(OS_CurrentProcessDirectory, getter_AddRefs(localFile));
    628     }
    629623    else if (inAtom == nsDirectoryService::sOS_CurrentWorkingDirectory)
    630624    {
  • trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.cpp

    r102204 r104490  
    869869
    870870    if (!recursive && isSymLink)
    871         return NSRESULT_FOR_IPRT(RTErrConvertFromErrno(unlink(mPath.get())));
     871    {
     872        int vrc = RTErrConvertFromErrno(unlink(mPath.get()));
     873        return NSRESULT_FOR_IPRT(vrc);
     874    }
    872875   
    873876    isDir = S_ISDIR(mCachedStat.st_mode);
     
    946949    }
    947950    InvalidateCache();
    948     return NSRESULT_FOR_IPRT(RTErrConvertFromErrno(result));
     951    int vrc = RTErrConvertFromErrno(result);
     952    return NSRESULT_FOR_IPRT(vrc);
    949953}
    950954
     
    11531157 
    11541158    // <brendan, after jband> I promise to play nice
    1155     char *buffer   = mPath.BeginWriting(),
    1156          *slashp   = buffer;
     1159    char *buffer   = mPath.BeginWriting();
    11571160
    11581161    // find the last significant slash in buffer
    1159     slashp = strrchr(buffer, '/');
     1162    char *slashp = strrchr(buffer, '/');
    11601163    NS_ASSERTION(slashp, "non-canonical mPath?");
    11611164    if (!slashp)
  • trunk/src/libs/xpcom18a4/xpcom/io/nsNativeCharsetUtils.cpp

    r101980 r104490  
    706706        int incr;
    707707
    708         while (*inputLeft && *outputLeft >= MB_CUR_MAX) {
     708        /* MB_CUR_MAX better be positive. */
     709        while (*inputLeft && *outputLeft >= (PRUint32)MB_CUR_MAX) {
    709710#ifdef HAVE_WCRTOMB
    710711            incr = (int) wcrtomb(*output, (wchar_t) **input, &ps);
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