Fix Clang static analysis warnings

This commit is contained in:
Vinnie Falco
2013-06-25 06:59:27 -07:00
parent 94e9632234
commit 6d13ddd43a
5 changed files with 41 additions and 13 deletions

View File

@@ -292,6 +292,7 @@ public:
{
const ScopedLockType lock (getLock());
data.ensureAllocatedSize (numUsed + 1);
bassert (data.elements != nullptr);
data.elements [numUsed++] = newObject;
if (newObject != nullptr)
@@ -322,6 +323,7 @@ public:
indexToInsertAt = numUsed;
data.ensureAllocatedSize (numUsed + 1);
bassert (data.elements != nullptr);
ObjectClass** const e = data.elements + indexToInsertAt;
const int numToMove = numUsed - indexToInsertAt;
@@ -388,6 +390,7 @@ public:
else
{
data.ensureAllocatedSize (numUsed + 1);
bassert (data.elements != nullptr);
data.elements [numUsed++] = newObject;
}
}
@@ -851,5 +854,4 @@ private:
int numUsed;
};
#endif // BEAST_REFERENCECOUNTEDARRAY_BEASTHEADER