VirtualBox

Changeset 101997 in vbox for trunk/src


Ignore:
Timestamp:
Nov 8, 2023 5:57:57 PM (16 months ago)
Author:
vboxsync
Message:

libs/xpcom/xpcom: Convert from PR_ASSERT to IPRT assertions, bugref:10545

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

Legend:

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

    r101975 r101997  
    4949#include <string.h>
    5050#include "prmem.h"
    51 #include "prlog.h"
    5251#include "nsHashtable.h"
    5352#include "nsReadableUtils.h"
     
    221220
    222221    // shouldn't be adding an item during enumeration
    223     PR_ASSERT(!mEnumerating);
     222    Assert(!mEnumerating);
    224223   
    225224    HTEntry* entry =
     
    267266
    268267    // shouldn't be adding an item during enumeration
    269     PR_ASSERT(!mEnumerating);
     268    Assert(!mEnumerating);
    270269
    271270
  • trunk/src/libs/xpcom18a4/xpcom/ds/pldhash.c

    r49491 r101997  
    4747#include "prbit.h"
    4848#include "pldhash.h"
    49 #include "prlog.h"     /* for PR_ASSERT */
    5049
    5150#ifdef PL_DHASHMETER
     
    5857#endif
    5958#ifdef VBOX_USE_IPRT_IN_XPCOM
     59# include <iprt/assert.h>
    6060# include <iprt/mem.h>
    6161#endif
     
    273273     * buggy caller intended.
    274274     */
    275     PR_ASSERT(0.5 <= maxAlpha && maxAlpha < 1 && 0 <= minAlpha);
     275    Assert(0.5 <= maxAlpha && maxAlpha < 1 && 0 <= minAlpha);
    276276    if (maxAlpha < 0.5 || 1 <= maxAlpha || minAlpha < 0)
    277277        return;
     
    282282     * size and the precision limit of maxAlphaFrac's fixed point format.
    283283     */
    284     PR_ASSERT(PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) >= 1);
     284    Assert(PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) >= 1);
    285285    if (PL_DHASH_MIN_SIZE - (maxAlpha * PL_DHASH_MIN_SIZE) < 1) {
    286286        maxAlpha = (float)
     
    294294     * (8-bit fixed point format).
    295295     */
    296     PR_ASSERT(minAlpha < maxAlpha / 2);
     296    Assert(minAlpha < maxAlpha / 2);
    297297    if (minAlpha >= maxAlpha / 2) {
    298298        size = PL_DHASH_TABLE_SIZE(table);
     
    388388
    389389    METER(table->stats.searches++);
    390     PR_ASSERT(!(keyHash & COLLISION_FLAG));
     390    Assert(!(keyHash & COLLISION_FLAG));
    391391
    392392    /* Compute the primary hash address. */
     
    464464
    465465#ifdef VBOX /* HACK ALERT! generation == PR_UINT32_MAX during enumeration. */
    466     PR_ASSERT(table->generation != PR_UINT32_MAX);
     466    Assert(table->generation != PR_UINT32_MAX);
    467467    if (table->generation == PR_UINT32_MAX)
    468468        return PR_FALSE;
     
    506506            newEntry = SearchTable(table, getKey(table, oldEntry),
    507507                                   oldEntry->keyHash, PL_DHASH_ADD);
    508             PR_ASSERT(PL_DHASH_ENTRY_IS_FREE(newEntry));
     508            Assert(PL_DHASH_ENTRY_IS_FREE(newEntry));
    509509            moveEntry(table, oldEntry, newEntry);
    510510            newEntry->keyHash = oldEntry->keyHash;
     
    615615
    616616      default:
    617         PR_ASSERT(0);
     617        AssertFailed();
    618618        entry = NULL;
    619619    }
     
    627627    PLDHashNumber keyHash;      /* load first in case clearEntry goofs it */
    628628
    629     PR_ASSERT(PL_DHASH_ENTRY_IS_LIVE(entry));
     629    Assert(PL_DHASH_ENTRY_IS_LIVE(entry));
    630630    keyHash = entry->keyHash;
    631631    table->ops->clearEntry(table, entry);
     
    675675            op = etor(table, entry, i++, arg);
    676676#ifdef VBOX /* HACK ALERT! generation == PR_UINT32_MAX during enumeration. */
    677             PR_ASSERT(table->generation == PR_UINT32_MAX);
     677            Assert(table->generation == PR_UINT32_MAX);
    678678#endif
    679679            if (op & PL_DHASH_REMOVE) {
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