VirtualBox

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


Ignore:
Timestamp:
May 2, 2024 4:34:04 PM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163010
Message:

libs/xpcom/ds: Add two missing error checks, add some missing field initialization, mark cases as fallthrough, bugref:3409

Location:
trunk/src/libs/xpcom18a4/xpcom/ds
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsArrayEnumerator.cpp

    r1 r104488  
    109109
    110110    // nsSimpleArrayEnumerator methods
    111     nsCOMArrayEnumerator() : mIndex(0) {
     111    nsCOMArrayEnumerator() : mIndex(0), mArraySize(0) {
    112112    }
    113113
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsCRT.cpp

    r102326 r104488  
    5151 */
    5252
     53#include <iprt/cdefs.h>
    5354
    5455#include "nsCRT.h"
     
    370371            switch ( code_length )
    371372              {  // falling through in each case
    372                 case 6:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>24) & 0x003F));
    373                 case 5:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>18) & 0x003F));
    374                 case 4:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>12) & 0x003F));
    375                 case 3:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>6 ) & 0x003F));
    376                 case 2:   h = (h>>28) ^ (h<<4) ^ (0x80 | ( U      & 0x003F));
     373                case 6:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>24) & 0x003F)); RT_FALL_THROUGH();
     374                case 5:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>18) & 0x003F)); RT_FALL_THROUGH();
     375                case 4:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>12) & 0x003F)); RT_FALL_THROUGH();
     376                case 3:   h = (h>>28) ^ (h<<4) ^ (0x80 | ((U>>6 ) & 0x003F)); RT_FALL_THROUGH();
     377                case 2:   h = (h>>28) ^ (h<<4) ^ (0x80 | ( U      & 0x003F)); RT_FALL_THROUGH();
    377378                default:  code_length = 0;
    378379                  break;
     
    416417        return LL_Zero();
    417418
    418     PRInt64 ll = LL_Zero(), digitll = LL_Zero();
     419    PRInt64 ll = LL_Zero();
     420    PRInt64 digitll;
    419421
    420422    while (*str && *str >= '0' && *str <= '9') {
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsManifestLineReader.h

    r1 r104488  
    4545{
    4646public:
    47     nsManifestLineReader() : mBase(nsnull) {}
     47    nsManifestLineReader()
     48        : mCur(nsnull)
     49        , mLength(0)
     50        , mNext(nsnull)
     51        , mBase(nsnull)
     52        , mLimit(nsnull) {}
    4853    ~nsManifestLineReader() {}
    4954
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsSupportsArray.cpp

    r1 r104488  
    222222nsSupportsArray::Read(nsIObjectInputStream *aStream)
    223223{
    224   nsresult rv;
    225 
    226224  PRUint32 newArraySize;
    227   rv = aStream->Read32(&newArraySize);
     225  nsresult rv = aStream->Read32(&newArraySize);
     226  if (NS_FAILED(rv))
     227    return rv;
    228228
    229229  if (newArraySize <= kAutoArraySize) {
     
    665665nsSupportsArray::Clone(nsISupportsArray* *result)
    666666{
    667   nsresult rv;
    668667  nsISupportsArray* newArray;
    669   rv = NS_NewISupportsArray(&newArray);
     668  nsresult rv = NS_NewISupportsArray(&newArray);
     669  if (NS_FAILED(rv))
     670    return rv;
     671
    670672  PRBool ok = EnumerateForwards(CopyElement, newArray);
    671673  if (!ok) return NS_ERROR_OUT_OF_MEMORY;
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsVoidArray.cpp

    r102324 r104488  
    269269    {
    270270      newCapacity = GetArraySize() + PR_MAX(kMaxGrowArrayBy,aGrowBy);
    271       newSize = SIZEOF_IMPL(newCapacity);
     271      //newSize = SIZEOF_IMPL(newCapacity); Not used below
    272272    }
    273273    else
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