VirtualBox

Changeset 13836 in vbox


Ignore:
Timestamp:
Nov 5, 2008 2:42:54 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38827
Message:

s/ELEMENTS/RT_ELEMENTS/g - retiring ELEMENTS (finally).

Location:
trunk
Files:
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r13832 r13836  
    13781378 * Converts an uint16_t value from network to host byte order. */
    13791379#define RT_N2H_U16_C(u16)   RT_BE2H_U16_C(u16)
    1380 
    1381 
    1382 /** @def RT_NO_DEPRECATED_MACROS
    1383  * Define RT_NO_DEPRECATED_MACROS to not define deprecated macros.
    1384  */
    1385 #ifndef RT_NO_DEPRECATED_MACROS
    1386 /** @copydoc RT_ELEMENTS
    1387  * @deprecated use RT_ELEMENTS. */
    1388 # define ELEMENTS(aArray)               RT_ELEMENTS(aArray)
    1389 #endif
    13901380
    13911381
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/drv.c

    r8155 r13836  
    8787    {
    8888        PPDEV ppdev = (PPDEV)pso->dhpdev;
    89        
    90         /* The screen surface has the 'pso->dhpdev' field, 
     89
     90        /* The screen surface has the 'pso->dhpdev' field,
    9191         * and is either the screen device surface with handle = hsurfScreen,
    9292         * or a surface derived from DDRAW with address equal to the framebuffer.
     
    302302
    303303    STATPRINT;
    304    
     304
    305305#ifdef VBOX_VBVA_ADJUST_RECT
    306     /* Experimental fix for too large bitmap updates. 
     306    /* Experimental fix for too large bitmap updates.
    307307     *
    308308     * Some application do a large bitmap update event if only
     
    312312     * the current framebuffer content with the source bitmap.
    313313     *
    314      * The optimization is only active when: 
     314     * The optimization is only active when:
    315315     *  - the VBVA extension is enabled;
    316316     *  - the source bitmap is not cacheable;
     
    597597            DISPDBG((1, "DrvSaveScreenBits: SS_SAVE %d\n", ppdev->cSSB));
    598598
    599             if (ppdev->cSSB >= ELEMENTS(ppdev->aSSB))
     599            if (ppdev->cSSB >= RT_ELEMENTS(ppdev->aSSB))
    600600            {
    601601                /* All slots are already in use. Fail. */
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdp.c

    r8155 r13836  
    231231    prcl->right  = x + w;
    232232    prcl->bottom = y + h;
    233    
     233
    234234    DISPDBG((1, "vrdpAdjustRect: result %d-%d %d-%d\n", prcl->left, prcl->right, prcl->top, prcl->bottom));
    235235}
     
    11941194        ULONG ulForeRGB = pboFore? vrdpColor2RGB (pso, pboFore->iSolidColor): 0;
    11951195        ULONG ulBackRGB = pboOpaque? vrdpColor2RGB (pso, pboOpaque->iSolidColor): 0;
    1196        
     1196
    11971197        DISPDBG((1, "VRDP::vrdpTextOut: calling vboxReportText fg %x bg %x\n",
    11981198                    ulForeRGB, ulBackRGB));
    1199                    
     1199
    12001200        if (!vboxReportText (ppdev, &clipRects, pstro, pfo, prclOpaque, ulForeRGB, ulBackRGB))
    12011201        {
     
    13451345static void vrdpPolyPointsAdd (VRDPORDERPOLYPOINTS *pPoints, const VRDPORDERPOINT *ppt)
    13461346{
    1347     VBVA_ASSERT(pPoints->c < ELEMENTS(pPoints->a));
     1347    VBVA_ASSERT(pPoints->c < RT_ELEMENTS(pPoints->a));
    13481348
    13491349    pPoints->a[pPoints->c] = *ppt;
     
    15171517                vrdpExtendOrderBounds (&bounds, &pt);
    15181518
    1519                 if (order.points.c == ELEMENTS(order.points.a))
     1519                if (order.points.c == RT_ELEMENTS(order.points.a))
    15201520                {
    15211521                    /* Flush the order and start a new order. */
     
    15381538                    || ptStart.y != pt.y)
    15391539                {
    1540                     VBVA_ASSERT(order.points.c < ELEMENTS(order.points.a));
     1540                    VBVA_ASSERT(order.points.c < RT_ELEMENTS(order.points.a));
    15411541
    15421542                    vrdpPolyPointsAdd     (&order.points, &ptStart);
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdpbmp.c

    r8155 r13836  
    144144    /* Get the free entry to be used. Try tail, that should be */
    145145    pEntry = pCache->tail;
    146    
     146
    147147    if (pEntry == NULL)
    148148    {
     
    221221
    222222    pCache->head = &pCache->aEntries[0];
    223     pCache->tail = &pCache->aEntries[ELEMENTS(pCache->aEntries) - 1];
    224 
    225     for (i = 0; i < ELEMENTS(pCache->aEntries); i++)
     223    pCache->tail = &pCache->aEntries[RT_ELEMENTS(pCache->aEntries) - 1];
     224
     225    for (i = 0; i < RT_ELEMENTS(pCache->aEntries); i++)
    226226    {
    227227        VRDPBCENTRY *pEntry = &pCache->aEntries[i];
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp

    r10777 r13836  
    9191{
    9292    int i;
    93     for (i = 0; i < ELEMENTS(parameters); i++)
     93    for (i = 0; i < RT_ELEMENTS(parameters); i++)
    9494    {
    9595        if (parameters[i].level > level)
     
    9999             */
    100100            Log(("VBoxTray: vboxExperienceSet: Saving %s\n", parameters[i].name));
    101            
     101
    102102            /* Save the current value. */
    103103            switch (parameters[i].type)
     
    106106                {
    107107                    /* The 2nd parameter is size in characters of the buffer.
    108                      * The 3rd parameter points to the buffer. 
     108                     * The 3rd parameter points to the buffer.
    109109                     */
    110110                    SystemParametersInfo (parameters[i].uActionGet,
     
    126126                case VBOX_SPI_PTR:
    127127                {
    128                     /* The 3rd parameter points to the structure. 
     128                    /* The 3rd parameter points to the structure.
    129129                     * The cbSize member of this structure must be set.
    130130                     * The uiParam parameter must alos be set.
     
    135135                        break;
    136136                    }
    137                    
     137
    138138                    *(UINT *)&parameters[i].achSavedValue[0] = parameters[i].cbSavedValue;
    139                    
     139
    140140                    SystemParametersInfo (parameters[i].uActionGet,
    141141                                          parameters[i].cbSavedValue,
     
    147147                    break;
    148148            }
    149            
     149
    150150            Log(("VBoxTray: vboxExperienceSet: Disabling %s\n", parameters[i].name));
    151            
     151
    152152            /* Disable the feature. */
    153153            switch (parameters[i].type)
     
    199199{
    200200    int i;
    201     for (i = 0; i < ELEMENTS(parameters); i++)
     201    for (i = 0; i < RT_ELEMENTS(parameters); i++)
    202202    {
    203203        if (parameters[i].level > level)
    204204        {
    205205            Log(("VBoxTray: vboxExperienceRestore: Restoring %s\n", parameters[i].name));
    206            
     206
    207207            /* Restore the feature. */
    208208            switch (parameters[i].type)
     
    260260    uint32_t level;
    261261    BOOL fSavedThemeEnabled;
    262    
     262
    263263    HMODULE hModule;
    264264
     
    280280
    281281    gCtx.hModule = LoadLibrary("UxTheme");
    282    
     282
    283283    if (gCtx.hModule)
    284284    {
     
    290290        gCtx.pfnEnableTheming = 0;
    291291    }
    292    
     292
    293293    *pfStartThread = true;
    294294    *ppInstance = &gCtx;
     
    318318    VBoxGuestFilterMaskInfo maskInfo;
    319319    DWORD cbReturned;
    320    
     320
    321321    maskInfo.u32OrMask = VMMDEV_EVENT_VRDP;
    322322    maskInfo.u32NotMask = 0;
     
    352352                /* Call the host to get VRDP status and the experience level. */
    353353                VMMDevVRDPChangeRequest vrdpChangeRequest = {0};
    354                
     354
    355355                vrdpChangeRequest.header.size            = sizeof(VMMDevVRDPChangeRequest);
    356356                vrdpChangeRequest.header.version         = VMMDEV_REQUEST_HEADER_VERSION;
     
    358358                vrdpChangeRequest.u8VRDPActive           = 0;
    359359                vrdpChangeRequest.u32VRDPExperienceLevel = 0;
    360                
     360
    361361                if (DeviceIoControl (gVBoxDriver,
    362362                                     VBOXGUEST_IOCTL_VMMREQUEST(sizeof(VMMDevVRDPChangeRequest)),
     
    368368                {
    369369                    Log(("VBoxTray: VBoxVRDPThread: u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel));
    370                    
     370
    371371                    if (vrdpChangeRequest.u8VRDPActive)
    372372                    {
    373373                        pCtx->level = vrdpChangeRequest.u32VRDPExperienceLevel;
    374374                        vboxExperienceSet (pCtx->level);
    375    
     375
    376376                        if (pCtx->level == VRDP_EXPERIENCE_LEVEL_ZERO
    377377                            && pCtx->pfnEnableTheming
     
    379379                        {
    380380                            pCtx->fSavedThemeEnabled = pCtx->pfnIsThemeActive ();
    381                            
     381
    382382                            Log(("VBoxTray: VBoxVRDPThread: pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled));
    383                            
     383
    384384                            if (pCtx->fSavedThemeEnabled)
    385385                            {
     
    402402                            }
    403403                        }
    404                        
     404
    405405                        vboxExperienceRestore (pCtx->level);
    406                        
     406
    407407                        pCtx->level = VRDP_EXPERIENCE_LEVEL_FULL;
    408408                    }
     
    420420                }
    421421            }
    422         } 
     422        }
    423423        else
    424424        {
  • trunk/src/VBox/Additions/common/VBoxGuestLib/HGCM.cpp

    r13835 r13836  
    8181     */
    8282
    83     for (i = 0; i < ELEMENTS(g_vbgldata.aHGCMHandleData); i++)
     83    for (i = 0; i < RT_ELEMENTS(g_vbgldata.aHGCMHandleData); i++)
    8484    {
    8585        if (!g_vbgldata.aHGCMHandleData[i].fAllocated)
  • trunk/src/VBox/Devices/Storage/testcase/vditool.cpp

    r13835 r13836  
    373373    static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
    374374    int rc = RTLogCreate(&pLogger, 0, "all",
    375                          NULL, ELEMENTS(s_apszGroups), s_apszGroups,
     375                         NULL, RT_ELEMENTS(s_apszGroups), s_apszGroups,
    376376                          RTLOGDEST_STDOUT, NULL);
    377377    RTLogRelSetDefaultInstance(pLogger);
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r13834 r13836  
    23692369{
    23702370#if 0 //def DEBUG_Sander
    2371     AssertMsg(idx < ELEMENTS(szModRMSegReg), ("idx=%d\n", idx));
     2371    AssertMsg(idx < RT_ELEMENTS(szModRMSegReg), ("idx=%d\n", idx));
    23722372#endif
    23732373#ifdef IN_RING3
    2374     if (idx >= ELEMENTS(szModRMSegReg))
     2374    if (idx >= RT_ELEMENTS(szModRMSegReg))
    23752375    {
    23762376        Log(("disasmModRMSReg %d failed!!\n", idx));
     
    23792379#endif
    23802380
    2381     idx = RT_MIN(idx, ELEMENTS(szModRMSegReg)-1);
     2381    idx = RT_MIN(idx, RT_ELEMENTS(szModRMSegReg)-1);
    23822382    disasmAddString(pParam->szParam, szModRMSegReg[idx]);
    23832383    pParam->flags |= USE_REG_SEG;
  • trunk/src/VBox/Disassembler/DisasmReg.cpp

    r13835 r13836  
    327327DISDECL(int) DISFetchReg8(PCCPUMCTXCORE pCtx, unsigned reg8, uint8_t *pVal)
    328328{
    329     AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
     329    AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
    330330
    331331    *pVal = DIS_READ_REG8(pCtx, reg8);
     
    339339DISDECL(int) DISFetchReg16(PCCPUMCTXCORE pCtx, unsigned reg16, uint16_t *pVal)
    340340{
    341     AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
     341    AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
    342342
    343343    *pVal = DIS_READ_REG16(pCtx, reg16);
     
    351351DISDECL(int) DISFetchReg32(PCCPUMCTXCORE pCtx, unsigned reg32, uint32_t *pVal)
    352352{
    353     AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
     353    AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
    354354
    355355    *pVal = DIS_READ_REG32(pCtx, reg32);
     
    363363DISDECL(int) DISFetchReg64(PCCPUMCTXCORE pCtx, unsigned reg64, uint64_t *pVal)
    364364{
    365     AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
     365    AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
    366366
    367367    *pVal = DIS_READ_REG64(pCtx, reg64);
     
    375375DISDECL(int) DISPtrReg8(PCPUMCTXCORE pCtx, unsigned reg8, uint8_t **ppReg)
    376376{
    377     AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
     377    AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
    378378
    379379    *ppReg = DIS_PTR_REG8(pCtx, reg8);
     
    387387DISDECL(int) DISPtrReg16(PCPUMCTXCORE pCtx, unsigned reg16, uint16_t **ppReg)
    388388{
    389     AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
     389    AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
    390390
    391391    *ppReg = DIS_PTR_REG16(pCtx, reg16);
     
    399399DISDECL(int) DISPtrReg32(PCPUMCTXCORE pCtx, unsigned reg32, uint32_t **ppReg)
    400400{
    401     AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
     401    AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
    402402
    403403    *ppReg = DIS_PTR_REG32(pCtx, reg32);
     
    411411DISDECL(int) DISPtrReg64(PCPUMCTXCORE pCtx, unsigned reg64, uint64_t **ppReg)
    412412{
    413     AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
     413    AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
    414414
    415415    *ppReg = DIS_PTR_REG64(pCtx, reg64);
     
    423423DISDECL(int) DISFetchRegSeg(PCCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL *pVal)
    424424{
    425     AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
     425    AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
    426426
    427427    AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));
     
    436436DISDECL(int) DISFetchRegSegEx(PCCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL *pVal, CPUMSELREGHID **ppSelHidReg)
    437437{
    438     AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
     438    AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
    439439
    440440    AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));
     
    450450DISDECL(int) DISWriteReg64(PCPUMCTXCORE pRegFrame, unsigned reg64, uint64_t val64)
    451451{
    452     AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
     452    AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);
    453453
    454454    DIS_WRITE_REG64(pRegFrame, reg64, val64);
     
    462462DISDECL(int) DISWriteReg32(PCPUMCTXCORE pRegFrame, unsigned reg32, uint32_t val32)
    463463{
    464     AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
     464    AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);
    465465
    466466    DIS_WRITE_REG32(pRegFrame, reg32, val32);
     
    474474DISDECL(int) DISWriteReg16(PCPUMCTXCORE pRegFrame, unsigned reg16, uint16_t val16)
    475475{
    476     AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
     476    AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);
    477477
    478478    DIS_WRITE_REG16(pRegFrame, reg16, val16);
     
    486486DISDECL(int) DISWriteReg8(PCPUMCTXCORE pRegFrame, unsigned reg8, uint8_t val8)
    487487{
    488     AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
     488    AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);
    489489
    490490    DIS_WRITE_REG8(pRegFrame, reg8, val8);
     
    498498DISDECL(int) DISWriteRegSeg(PCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL val)
    499499{
    500     AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
     500    AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
    501501
    502502    AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r13835 r13836  
    11381138        PRTLOGGER pLogger;
    11391139        rc2 = RTLogCreateEx(&pLogger, RTLOGFLAGS_PREFIX_TIME_PROG, "all",
    1140                             "VBOX_RELEASE_LOG", ELEMENTS(s_apszGroups), s_apszGroups,
     1140                            "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
    11411141                            RTLOGDEST_FILE, szError, sizeof(szError), "./VBoxBFE.log");
    11421142        if (RT_SUCCESS(rc2))
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r13603 r13836  
    17041704{
    17051705    QStringList list;
    1706     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1706    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    17071707        list << comKnownPorts [i].name;
    17081708
     
    17161716{
    17171717    QStringList list;
    1718     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1718    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    17191719        list << lptKnownPorts [i].name;
    17201720
     
    17291729QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const
    17301730{
    1731     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1731    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    17321732        if (comKnownPorts [i].IRQ == aIRQ &&
    17331733            comKnownPorts [i].IOBase == aIOBase)
     
    17441744QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const
    17451745{
    1746     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1746    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    17471747        if (lptKnownPorts [i].IRQ == aIRQ &&
    17481748            lptKnownPorts [i].IOBase == aIOBase)
     
    17601760                                   ulong &aIOBase) const
    17611761{
    1762     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1762    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    17631763        if (strcmp (comKnownPorts [i].name, aName.utf8().data()) == 0)
    17641764        {
     
    17791779                                   ulong &aIOBase) const
    17801780{
    1781     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1781    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    17821782        if (strcmp (lptKnownPorts [i].name, aName.utf8().data()) == 0)
    17831783        {
     
    44554455        { "kfmclient:exec", "gnome-open", "x-www-browser", "firefox", "konqueror" };
    44564456
    4457     for (size_t i = 0; i < ELEMENTS (commands); ++ i)
     4457    for (size_t i = 0; i < RT_ELEMENTS (commands); ++ i)
    44584458    {
    44594459        QStringList args = QStringList::split (':', commands [i]);
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h

    r13580 r13836  
    382382    QString text (int aColumn) const
    383383    {
    384         AssertReturn (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos),
     384        AssertReturn (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos),
    385385                      QString::null);
    386386
     
    390390    const QPixmap *pixmap (int aColumn) const
    391391    {
    392         AssertReturn (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos),
     392        AssertReturn (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos),
    393393                      NULL);
    394394
     
    412412        if (mFocusColumn >= 0)
    413413        {
    414             AssertReturnVoid ((size_t) mFocusColumn < ELEMENTS (mCombos));
     414            AssertReturnVoid ((size_t) mFocusColumn < RT_ELEMENTS (mCombos));
    415415
    416416            if (mCombos [mFocusColumn]->count())
     
    469469               const QUuid &aMachineId)
    470470    {
    471         AssertReturnVoid (listView()->columns() == ELEMENTS (mCombos));
     471        AssertReturnVoid (listView()->columns() == RT_ELEMENTS (mCombos));
    472472
    473473        setSelectable (false);
     
    502502                    int aColumn, int aWidth, int aAlign)
    503503    {
    504         AssertReturnVoid (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos));
     504        AssertReturnVoid (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos));
    505505
    506506        QComboBox *cb = mCombos [aColumn];
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r13835 r13836  
    16731673{
    16741674    QStringList list;
    1675     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1675    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    16761676        list << comKnownPorts [i].name;
    16771677
     
    16851685{
    16861686    QStringList list;
    1687     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1687    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    16881688        list << lptKnownPorts [i].name;
    16891689
     
    16981698QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const
    16991699{
    1700     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1700    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    17011701        if (comKnownPorts [i].IRQ == aIRQ &&
    17021702            comKnownPorts [i].IOBase == aIOBase)
     
    17131713QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const
    17141714{
    1715     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1715    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    17161716        if (lptKnownPorts [i].IRQ == aIRQ &&
    17171717            lptKnownPorts [i].IOBase == aIOBase)
     
    17291729                                   ulong &aIOBase) const
    17301730{
    1731     for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)
     1731    for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i)
    17321732        if (strcmp (comKnownPorts [i].name, aName.toUtf8().data()) == 0)
    17331733        {
     
    17481748                                   ulong &aIOBase) const
    17491749{
    1750     for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)
     1750    for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i)
    17511751        if (strcmp (lptKnownPorts [i].name, aName.toUtf8().data()) == 0)
    17521752        {
     
    47824782        { "kfmclient:exec", "gnome-open", "x-www-browser", "firefox", "konqueror" };
    47834783
    4784     for (size_t i = 0; i < ELEMENTS (commands); ++ i)
     4784    for (size_t i = 0; i < RT_ELEMENTS (commands); ++ i)
    47854785    {
    47864786        QStringList args = QString(commands [i]).split (':');
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r13471 r13836  
    49474947     * TSC History.
    49484948     */
    4949     Assert(ELEMENTS(pGipCpu->au32TSCHistory) == 8);
     4949    Assert(RT_ELEMENTS(pGipCpu->au32TSCHistory) == 8);
    49504950
    49514951    iTSCHistoryHead = (pGipCpu->iTSCHistoryHead + 1) & 7;
  • trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp

    r13835 r13836  
    5959        void *pvPages0 = (void *)0x77777777;
    6060        memset(&aPages0[0], 0x8f, sizeof(aPages0));
    61         rc = SUPLowAlloc(ELEMENTS(aPages0), &pvPages0, NULL, aPages0);
     61        rc = SUPLowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0);
    6262        if (RT_SUCCESS(rc))
    6363        {
    6464            /* check that the pages are below 4GB and valid. */
    65             for (unsigned iPage = 0; iPage < ELEMENTS(aPages0); iPage++)
     65            for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++)
    6666            {
    6767                RTPrintf("%-4d: Phys=%VHp Reserved=%p\n", iPage, aPages0[iPage].Phys, aPages0[iPage].uReserved);
     
    8080            if (!rcRet)
    8181            {
    82                 for (unsigned iPage = 0; iPage < ELEMENTS(aPages0); iPage++)
     82                for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++)
    8383                    memset((char *)pvPages0 + iPage * PAGE_SIZE, iPage, PAGE_SIZE);
    84                 for (unsigned iPage = 0; iPage < ELEMENTS(aPages0); iPage++)
     84                for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++)
    8585                    for (uint8_t *pu8 = (uint8_t *)pvPages0 + iPage * PAGE_SIZE, *pu8End = pu8 + PAGE_SIZE; pu8 < pu8End; pu8++)
    8686                        if (*pu8 != (uint8_t)iPage)
     
    9191                        }
    9292            }
    93             SUPLowFree(pvPages0, ELEMENTS(aPages0));
     93            SUPLowFree(pvPages0, RT_ELEMENTS(aPages0));
    9494        }
    9595        else
    9696        {
    97             RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Vrc\n", ELEMENTS(aPages0), rc);
     97            RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Vrc\n", RT_ELEMENTS(aPages0), rc);
    9898            rcRet++;
    9999        }
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r13782 r13836  
    274274
    275275#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    276     Assert(ELEMENTS(maTapFD) == ELEMENTS(maTAPDeviceName));
    277     Assert(ELEMENTS(maTapFD) >= SchemaDefs::NetworkAdapterCount);
    278     for (unsigned i = 0; i < ELEMENTS(maTapFD); i++)
     276    Assert(RT_ELEMENTS(maTapFD) == RT_ELEMENTS(maTAPDeviceName));
     277    Assert(RT_ELEMENTS(maTapFD) >= SchemaDefs::NetworkAdapterCount);
     278    for (unsigned i = 0; i < RT_ELEMENTS(maTapFD); i++)
    279279    {
    280280        maTapFD[i] = NIL_RTFILE;
     
    41824182            Utf8Str oldName, newName;
    41834183
    4184             for (unsigned int j = 0; j < ELEMENTS (files); ++ j)
     4184            for (unsigned int j = 0; j < RT_ELEMENTS (files); ++ j)
    41854185            {
    41864186                if (i > 0)
  • trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r13835 r13836  
    10711071
    10721072    unsigned i;
    1073     for (i = 0; i < ELEMENTS(maFramebuffers); i++)
     1073    for (i = 0; i < RT_ELEMENTS(maFramebuffers); i++)
    10741074    {
    10751075        if (maFramebuffers[i])
     
    19721972            #undef DEFSYMENTRY
    19731973
    1974             for (unsigned i = 0; i < ELEMENTS(symbols); i++)
     1974            for (unsigned i = 0; i < RT_ELEMENTS(symbols); i++)
    19751975            {
    19761976                rc = RTLdrGetSymbol(mVRDPLibrary, symbols[i].name, symbols[i].ppfn);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r13835 r13836  
    202202    mBootOrder [1] = DeviceType_DVD;
    203203    mBootOrder [2] = DeviceType_HardDisk;
    204     for (size_t i = 3; i < ELEMENTS (mBootOrder); i++)
     204    for (size_t i = 3; i < RT_ELEMENTS (mBootOrder); i++)
    205205        mBootOrder [i] = DeviceType_Null;
    206206
     
    231231        return false;
    232232
    233     for (size_t i = 0; i < ELEMENTS (mBootOrder); ++ i)
     233    for (size_t i = 0; i < RT_ELEMENTS (mBootOrder); ++ i)
    234234        if (mBootOrder [i] != that.mBootOrder [i])
    235235            return false;
     
    22582258    if (!port)
    22592259        return E_POINTER;
    2260     if (slot >= ELEMENTS (mSerialPorts))
     2260    if (slot >= RT_ELEMENTS (mSerialPorts))
    22612261        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22622262
     
    22752275    if (!port)
    22762276        return E_POINTER;
    2277     if (slot >= ELEMENTS (mParallelPorts))
     2277    if (slot >= RT_ELEMENTS (mParallelPorts))
    22782278        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22792279
     
    22922292    if (!adapter)
    22932293        return E_POINTER;
    2294     if (slot >= ELEMENTS (mNetworkAdapters))
     2294    if (slot >= RT_ELEMENTS (mNetworkAdapters))
    22952295        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22962296
     
    43494349
    43504350    /* create associated serial port objects */
    4351     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     4351    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    43524352    {
    43534353        unconst (mSerialPorts [slot]).createObject();
     
    43564356
    43574357    /* create associated parallel port objects */
    4358     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     4358    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    43594359    {
    43604360        unconst (mParallelPorts [slot]).createObject();
     
    43754375
    43764376    /* create associated network adapter objects */
    4377     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     4377    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    43784378    {
    43794379        unconst (mNetworkAdapters [slot]).createObject();
     
    44064406    /* tell all our other child objects we've been uninitialized */
    44074407
    4408     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     4408    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    44094409    {
    44104410        if (mNetworkAdapters [slot])
     
    44334433    }
    44344434
    4435     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     4435    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    44364436    {
    44374437        if (mParallelPorts [slot])
     
    44424442    }
    44434443
    4444     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     4444    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    44454445    {
    44464446        if (mSerialPorts [slot])
     
    50005000    {
    50015001        /* reset all boot order positions to NoDevice */
    5002         for (size_t i = 0; i < ELEMENTS (mHWData->mBootOrder); i++)
     5002        for (size_t i = 0; i < RT_ELEMENTS (mHWData->mBootOrder); i++)
    50035003            mHWData->mBootOrder [i] = DeviceType_Null;
    50045004
     
    50135013            uint32_t position = (*it).value <uint32_t> ("position");
    50145014            -- position;
    5015             Assert (position < ELEMENTS (mHWData->mBootOrder));
     5015            Assert (position < RT_ELEMENTS (mHWData->mBootOrder));
    50165016
    50175017            /* device (required) */
     
    50825082            /* slot unicity is guaranteed by XML Schema */
    50835083            uint32_t slot = (*it).value <uint32_t> ("slot");
    5084             AssertBreak (slot < ELEMENTS (mNetworkAdapters));
     5084            AssertBreak (slot < RT_ELEMENTS (mNetworkAdapters));
    50855085
    50865086            rc = mNetworkAdapters [slot]->loadSettings (*it);
     
    51025102            /* slot unicity is guaranteed by XML Schema */
    51035103            uint32_t slot = (*it).value <uint32_t> ("slot");
    5104             AssertBreak (slot < ELEMENTS (mSerialPorts));
     5104            AssertBreak (slot < RT_ELEMENTS (mSerialPorts));
    51055105
    51065106            rc = mSerialPorts [slot]->loadSettings (*it);
     
    51225122            /* slot unicity is guaranteed by XML Schema */
    51235123            uint32_t slot = (*it).value <uint32_t> ("slot");
    5124             AssertBreak (slot < ELEMENTS (mSerialPorts));
     5124            AssertBreak (slot < RT_ELEMENTS (mSerialPorts));
    51255125
    51265126            rc = mParallelPorts [slot]->loadSettings (*it);
     
    63736373        Key bootNode = aNode.createKey ("Boot");
    63746374
    6375         for (ULONG pos = 0; pos < ELEMENTS (mHWData->mBootOrder); ++ pos)
     6375        for (ULONG pos = 0; pos < RT_ELEMENTS (mHWData->mBootOrder); ++ pos)
    63766376        {
    63776377            const char *device = NULL;
     
    64376437        Key nwNode = aNode.createKey ("Network");
    64386438
    6439         for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); ++ slot)
     6439        for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); ++ slot)
    64406440        {
    64416441            Key adapterNode = nwNode.appendKey ("Adapter");
     
    64526452        Key serialNode = aNode.createKey ("UART");
    64536453
    6454         for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); ++ slot)
     6454        for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); ++ slot)
    64556455        {
    64566456            Key portNode = serialNode.appendKey ("Port");
     
    64676467        Key parallelNode = aNode.createKey ("LPT");
    64686468
    6469         for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); ++ slot)
     6469        for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); ++ slot)
    64706470        {
    64716471            Key portNode = parallelNode.appendKey ("Port");
     
    71937193    AutoReadLock alock (this);
    71947194
    7195     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7195    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    71967196        if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isModified())
    71977197            return true;
    71987198
    7199     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7199    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    72007200        if (mSerialPorts [slot] && mSerialPorts [slot]->isModified())
    72017201            return true;
    72027202
    7203     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7203    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    72047204        if (mParallelPorts [slot] && mParallelPorts [slot]->isModified())
    72057205            return true;
     
    72357235    AutoReadLock alock (this);
    72367236
    7237     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7237    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    72387238        if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isReallyModified())
    72397239            return true;
    72407240
    7241     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7241    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    72427242        if (mSerialPorts [slot] && mSerialPorts [slot]->isReallyModified())
    72437243            return true;
    72447244
    7245     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7245    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    72467246        if (mParallelPorts [slot] && mParallelPorts [slot]->isReallyModified())
    72477247            return true;
     
    73207320         usbChanged = false, sataChanged = false;
    73217321
    7322     ComPtr <INetworkAdapter> networkAdapters [ELEMENTS (mNetworkAdapters)];
    7323     ComPtr <ISerialPort> serialPorts [ELEMENTS (mSerialPorts)];
    7324     ComPtr <IParallelPort> parallelPorts [ELEMENTS (mParallelPorts)];
     7322    ComPtr <INetworkAdapter> networkAdapters [RT_ELEMENTS (mNetworkAdapters)];
     7323    ComPtr <ISerialPort> serialPorts [RT_ELEMENTS (mSerialPorts)];
     7324    ComPtr <IParallelPort> parallelPorts [RT_ELEMENTS (mParallelPorts)];
    73257325
    73267326    if (mBIOSSettings)
     
    73477347        sataChanged = mSATAController->rollback();
    73487348
    7349     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7349    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    73507350        if (mNetworkAdapters [slot])
    73517351            if (mNetworkAdapters [slot]->rollback())
    73527352                networkAdapters [slot] = mNetworkAdapters [slot];
    73537353
    7354     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7354    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    73557355        if (mSerialPorts [slot])
    73567356            if (mSerialPorts [slot]->rollback())
    73577357                serialPorts [slot] = mSerialPorts [slot];
    73587358
    7359     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7359    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    73607360        if (mParallelPorts [slot])
    73617361            if (mParallelPorts [slot]->rollback())
     
    73837383            that->onSATAControllerChange();
    73847384
    7385         for (ULONG slot = 0; slot < ELEMENTS (networkAdapters); slot ++)
     7385        for (ULONG slot = 0; slot < RT_ELEMENTS (networkAdapters); slot ++)
    73867386            if (networkAdapters [slot])
    73877387                that->onNetworkAdapterChange (networkAdapters [slot]);
    7388         for (ULONG slot = 0; slot < ELEMENTS (serialPorts); slot ++)
     7388        for (ULONG slot = 0; slot < RT_ELEMENTS (serialPorts); slot ++)
    73897389            if (serialPorts [slot])
    73907390                that->onSerialPortChange (serialPorts [slot]);
    7391         for (ULONG slot = 0; slot < ELEMENTS (parallelPorts); slot ++)
     7391        for (ULONG slot = 0; slot < RT_ELEMENTS (parallelPorts); slot ++)
    73927392            if (parallelPorts [slot])
    73937393                that->onParallelPortChange (parallelPorts [slot]);
     
    74307430    mSATAController->commit();
    74317431
    7432     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7432    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    74337433        mNetworkAdapters [slot]->commit();
    7434     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7434    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    74357435        mSerialPorts [slot]->commit();
    7436     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7436    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    74377437        mParallelPorts [slot]->commit();
    74387438
     
    74877487    mSATAController->copyFrom (aThat->mSATAController);
    74887488
    7489     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7489    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    74907490        mNetworkAdapters [slot]->copyFrom (aThat->mNetworkAdapters [slot]);
    7491     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7491    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    74927492        mSerialPorts [slot]->copyFrom (aThat->mSerialPorts [slot]);
    7493     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7493    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    74947494        mParallelPorts [slot]->copyFrom (aThat->mParallelPorts [slot]);
    74957495}
     
    77387738    mAudioAdapter->init (this, aMachine->mAudioAdapter);
    77397739    /* create a list of serial ports that will be mutable */
    7740     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7740    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    77417741    {
    77427742        unconst (mSerialPorts [slot]).createObject();
     
    77447744    }
    77457745    /* create a list of parallel ports that will be mutable */
    7746     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7746    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    77477747    {
    77487748        unconst (mParallelPorts [slot]).createObject();
     
    77567756    mSATAController->init (this, aMachine->mSATAController);
    77577757    /* create a list of network adapters that will be mutable */
    7758     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7758    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    77597759    {
    77607760        unconst (mNetworkAdapters [slot]).createObject();
     
    1057810578    mSATAController->initCopy (this, mPeer->mSATAController);
    1057910579
    10580     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     10580    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1058110581    {
    1058210582        unconst (mNetworkAdapters [slot]).createObject();
     
    1058410584    }
    1058510585
    10586     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     10586    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1058710587    {
    1058810588        unconst (mSerialPorts [slot]).createObject();
     
    1059010590    }
    1059110591
    10592     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     10592    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1059310593    {
    1059410594        unconst (mParallelPorts [slot]).createObject();
     
    1068010680    mSATAController->init (this);
    1068110681
    10682     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     10682    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1068310683    {
    1068410684        unconst (mNetworkAdapters [slot]).createObject();
     
    1068610686    }
    1068710687
    10688     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     10688    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1068910689    {
    1069010690        unconst (mSerialPorts [slot]).createObject();
     
    1069210692    }
    1069310693
    10694     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     10694    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1069510695    {
    1069610696        unconst (mParallelPorts [slot]).createObject();
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r13835 r13836  
    30103010    const char *kMediaNodes[] = { "HardDisks", "DVDImages", "FloppyImages" };
    30113011
    3012     for (size_t n = 0; n < ELEMENTS (kMediaNodes); ++ n)
     3012    for (size_t n = 0; n < RT_ELEMENTS (kMediaNodes); ++ n)
    30133013    {
    30143014        /* All three media nodes are optional */
  • trunk/src/VBox/Main/include/AutoLock.h

    r13580 r13836  
    11151115
    11161116        size_t i = 0;
    1117         while (i < ELEMENTS (mOps))
     1117        while (i < RT_ELEMENTS (mOps))
    11181118            if (mOps [i])
    11191119                mOps [i ++]->lock();
     
    11321132        AssertReturnVoid (mIsLocked);
    11331133
    1134         AssertReturnVoid (ELEMENTS (mOps) > 0);
    1135         size_t i = ELEMENTS (mOps);
     1134        AssertReturnVoid (RT_ELEMENTS (mOps) > 0);
     1135        size_t i = RT_ELEMENTS (mOps);
    11361136        do
    11371137            if (mOps [-- i])
     
    12471247    {
    12481248        size_t i = 0;
    1249         while (i < ELEMENTS (mLocks))
     1249        while (i < RT_ELEMENTS (mLocks))
    12501250            mLocks [i ++].lock();
    12511251    }
     
    12571257    void unlock()
    12581258    {
    1259         AssertReturnVoid (ELEMENTS (mLocks) > 0);
    1260         size_t i = ELEMENTS (mLocks);
     1259        AssertReturnVoid (RT_ELEMENTS (mLocks) > 0);
     1260        size_t i = RT_ELEMENTS (mLocks);
    12611261        do
    12621262            mLocks [-- i].unlock();
     
    12701270    void leave()
    12711271    {
    1272         AssertReturnVoid (ELEMENTS (mLocks) > 0);
    1273         size_t i = ELEMENTS (mLocks);
     1272        AssertReturnVoid (RT_ELEMENTS (mLocks) > 0);
     1273        size_t i = RT_ELEMENTS (mLocks);
    12741274        do
    12751275            mLocks [-- i].leave();
     
    12831283    void maybeLeave()
    12841284    {
    1285         AssertReturnVoid (ELEMENTS (mLocks) > 0);
    1286         size_t i = ELEMENTS (mLocks);
     1285        AssertReturnVoid (RT_ELEMENTS (mLocks) > 0);
     1286        size_t i = RT_ELEMENTS (mLocks);
    12871287        do
    12881288            mLocks [-- i].maybeLeave();
     
    12971297    {
    12981298        size_t i = 0;
    1299         while (i < ELEMENTS (mLocks))
     1299        while (i < RT_ELEMENTS (mLocks))
    13001300            mLocks [i ++].maybeEnter();
    13011301    }
     
    13081308    {
    13091309        size_t i = 0;
    1310         while (i < ELEMENTS (mLocks))
     1310        while (i < RT_ELEMENTS (mLocks))
    13111311            mLocks [i ++].enter();
    13121312    }
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r13580 r13836  
    609609#endif
    610610        };
    611         for (size_t i = 0; i < ELEMENTS (Names); ++ i)
     611        for (size_t i = 0; i < RT_ELEMENTS (Names); ++ i)
    612612        {
    613613            Bstr src = Names [i];
  • trunk/src/VBox/Main/xml/Settings.cpp

    r9703 r13836  
    202202    uint16_t mm = 0, dd = 0, hh = 0, mi = 0, ss = 0;
    203203    char buf [256];
    204     if (strlen (aValue) > ELEMENTS (buf) - 1 ||
     204    if (strlen (aValue) > RT_ELEMENTS (buf) - 1 ||
    205205        sscanf (aValue, "%d-%hu-%huT%hu:%hu:%hu%s",
    206206                &yyyy, &mm, &dd, &hh, &mi, &ss, buf) == 7)
  • trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp

    r13775 r13836  
    329329                     - sizeof(RTHEAPSIMPLEINTERNAL);
    330330    pHeapInt->pFreeTail = pHeapInt->pFreeHead = (PRTHEAPSIMPLEFREE)(pHeapInt + 1);
    331     for (i = 0; i < ELEMENTS(pHeapInt->auAlignment); i++)
     331    for (i = 0; i < RT_ELEMENTS(pHeapInt->auAlignment); i++)
    332332        pHeapInt->auAlignment[i] = ~(size_t)0;
    333333
  • trunk/src/VBox/Runtime/common/err/errmsg.cpp

    r13083 r13836  
    7878    unsigned iFound = ~0;
    7979    unsigned i;
    80     for (i = 0; i < ELEMENTS(g_aStatusMsgs); i++)
     80    for (i = 0; i < RT_ELEMENTS(g_aStatusMsgs); i++)
    8181    {
    8282        if (g_aStatusMsgs[i].iCode == rc)
     
    9999     * Need to use the temporary stuff.
    100100     */
    101     int iMsg = ASMAtomicXchgU32(&g_iUnknownMsgs, (g_iUnknownMsgs + 1) % ELEMENTS(g_aUnknownMsgs));
     101    int iMsg = ASMAtomicXchgU32(&g_iUnknownMsgs, (g_iUnknownMsgs + 1) % RT_ELEMENTS(g_aUnknownMsgs));
    102102    RTStrPrintf(&g_aszUnknownStr[iMsg][0], sizeof(g_aszUnknownStr[iMsg]), "Unknown Status 0x%X", rc);
    103103    return &g_aUnknownMsgs[iMsg];
  • trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h

    r8245 r13836  
    736736          "RTLdrELF:     e_shnum: " FMT_ELF_HALF "\n"
    737737          "RTLdrELF:  e_shstrndx: " FMT_ELF_HALF "\n",
    738           ELEMENTS(pEhdr->e_ident), &pEhdr->e_ident[0], pEhdr->e_type, pEhdr->e_version,
     738          RT_ELEMENTS(pEhdr->e_ident), &pEhdr->e_ident[0], pEhdr->e_type, pEhdr->e_version,
    739739          pEhdr->e_entry, pEhdr->e_phoff, pEhdr->e_shoff,pEhdr->e_flags, pEhdr->e_ehsize, pEhdr->e_phentsize,
    740740          pEhdr->e_phnum, pEhdr->e_shentsize, pEhdr->e_shnum, pEhdr->e_shstrndx));
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r8245 r13836  
    10761076
    10771077    /* DataDirectory */
    1078     if (pOptHdr->NumberOfRvaAndSizes != ELEMENTS(pOptHdr->DataDirectory))
     1078    if (pOptHdr->NumberOfRvaAndSizes != RT_ELEMENTS(pOptHdr->DataDirectory))
    10791079    {
    10801080        Log(("rtldrPEOpen: %s: NumberOfRvaAndSizes=%d!!!\n", pszLogName, pOptHdr->NumberOfRvaAndSizes));
    10811081        return VERR_BAD_EXE_FORMAT;
    10821082    }
    1083     for (unsigned i = 0; i < ELEMENTS(pOptHdr->DataDirectory); i++)
     1083    for (unsigned i = 0; i < RT_ELEMENTS(pOptHdr->DataDirectory); i++)
    10841084    {
    10851085        IMAGE_DATA_DIRECTORY const *pDir = &pOptHdr->DataDirectory[i];
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r13832 r13836  
    322322                        /* instruction. */
    323323                        unsigned i;
    324                         for (i = 0; i < ELEMENTS(aDest); i++)
     324                        for (i = 0; i < RT_ELEMENTS(aDest); i++)
    325325                        {
    326326                            size_t cchInstr = strlen(aDest[i].pszInstr);
     
    376376                        }
    377377                        /* unknown instruction? */
    378                         if (i >= ELEMENTS(aDest))
     378                        if (i >= RT_ELEMENTS(aDest))
    379379                        {
    380380                            AssertMsgFailed(("Invalid %s_DEST! unknown instruction %.20s\n", pszEnvVarBase, pszVar));
     
    11741174        bool        fFound = false;
    11751175        psz++;
    1176         for (i = 0; i < ELEMENTS(aFlags) && !fFound; i++)
     1176        for (i = 0; i < RT_ELEMENTS(aFlags) && !fFound; i++)
    11771177        {
    11781178            const char *psz1 = aFlags[i].pszFlag;
     
    13131313
    13141314        /* instruction. */
    1315         for (i = 0; i < ELEMENTS(aDest); i++)
     1315        for (i = 0; i < RT_ELEMENTS(aDest); i++)
    13161316        {
    13171317            if (!strncmp(pszVar, aDest[i].pszInstr, aDest[i].cchInstr))
     
    13271327
    13281328        /* unknown instruction? */
    1329         if (i >= ELEMENTS(aDest))
     1329        if (i >= RT_ELEMENTS(aDest))
    13301330        {
    13311331            AssertMsgFailed(("Invalid flags! unknown instruction %.20s\n", pszVar));
     
    14121412    {
    14131413        const RTNATIVETHREAD Self = RTThreadNativeSelf();
    1414         int32_t i = ELEMENTS(g_aPerThreadLoggers);
     1414        int32_t i = RT_ELEMENTS(g_aPerThreadLoggers);
    14151415        while (i-- > 0)
    14161416            if (g_aPerThreadLoggers[i].NativeThread == Self)
     
    14681468         * Iterate the table to see if there is already an entry for this thread.
    14691469         */
    1470         i = ELEMENTS(g_aPerThreadLoggers);
     1470        i = RT_ELEMENTS(g_aPerThreadLoggers);
    14711471        while (i-- > 0)
    14721472            if (g_aPerThreadLoggers[i].NativeThread == Self)
     
    14811481         */
    14821482        i = ASMAtomicIncS32(&g_cPerThreadLoggers);
    1483         if (i > (int32_t)ELEMENTS(g_aPerThreadLoggers))
     1483        if (i > (int32_t)RT_ELEMENTS(g_aPerThreadLoggers))
    14841484        {
    14851485            ASMAtomicDecS32(&g_cPerThreadLoggers);
     
    14891489        for (j = 0; j < 10; j++)
    14901490        {
    1491             i = ELEMENTS(g_aPerThreadLoggers);
     1491            i = RT_ELEMENTS(g_aPerThreadLoggers);
    14921492            while (i-- > 0)
    14931493            {
     
    15111511         * Search the array for the current thread.
    15121512         */
    1513         int32_t i = ELEMENTS(g_aPerThreadLoggers);
     1513        int32_t i = RT_ELEMENTS(g_aPerThreadLoggers);
    15141514        while (i-- > 0)
    15151515            if (    g_aPerThreadLoggers[i].NativeThread == Self
  • trunk/src/VBox/Runtime/common/misc/req.cpp

    r11601 r13836  
    406406        {
    407407            const uint32_t i = pQueue->iReqFree;
    408             vmr3ReqJoinFreeSub(&pQueue->apReqFree[(i + 2) % ELEMENTS(pQueue->apReqFree)], pTail->pNext);
     408            vmr3ReqJoinFreeSub(&pQueue->apReqFree[(i + 2) % RT_ELEMENTS(pQueue->apReqFree)], pTail->pNext);
    409409
    410410            pTail->pNext = NULL;
    411             vmr3ReqJoinFreeSub(&pQueue->apReqFree[(i + 2 + (i == pQueue->iReqFree)) % ELEMENTS(pQueue->apReqFree)], pTail->pNext);
     411            vmr3ReqJoinFreeSub(&pQueue->apReqFree[(i + 2 + (i == pQueue->iReqFree)) % RT_ELEMENTS(pQueue->apReqFree)], pTail->pNext);
    412412            return;
    413413        }
    414414        pTail = pTail->pNext;
    415415    }
    416     vmr3ReqJoinFreeSub(&pQueue->apReqFree[(pQueue->iReqFree + 2) % ELEMENTS(pQueue->apReqFree)], pList);
     416    vmr3ReqJoinFreeSub(&pQueue->apReqFree[(pQueue->iReqFree + 2) % RT_ELEMENTS(pQueue->apReqFree)], pList);
    417417}
    418418
     
    448448     * of mine to avoid locks.
    449449     */
    450     int cTries = ELEMENTS(pQueue->apReqFree) * 2;
     450    int cTries = RT_ELEMENTS(pQueue->apReqFree) * 2;
    451451    while (--cTries >= 0)
    452452    {
    453         PRTREQ volatile *ppHead = &pQueue->apReqFree[ASMAtomicIncU32(&pQueue->iReqFree) % ELEMENTS(pQueue->apReqFree)];
     453        PRTREQ volatile *ppHead = &pQueue->apReqFree[ASMAtomicIncU32(&pQueue->iReqFree) % RT_ELEMENTS(pQueue->apReqFree)];
    454454#if 0 /* sad, but this won't work safely because the reading of pReq->pNext. */
    455455        PRTREQ pNext = NULL;
     
    594594    {
    595595        ASMAtomicIncU32(&pQueue->cReqFree);
    596         PRTREQ volatile *ppHead = &pQueue->apReqFree[ASMAtomicIncU32(&pQueue->iReqFree) % ELEMENTS(pQueue->apReqFree)];
     596        PRTREQ volatile *ppHead = &pQueue->apReqFree[ASMAtomicIncU32(&pQueue->iReqFree) % RT_ELEMENTS(pQueue->apReqFree)];
    597597        PRTREQ pNext;
    598598        do
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r11596 r13836  
    721721
    722722/**
    723  * Create a new thread. 
    724  * 
     723 * Create a new thread.
     724 *
    725725 * Same as RTThreadCreate except the name is given in the RTStrPrintfV form.
    726726 *
     
    745745
    746746/**
    747  * Create a new thread. 
    748  * 
     747 * Create a new thread.
     748 *
    749749 * Same as RTThreadCreate except the name is given in the RTStrPrintf form.
    750750 *
     
    13821382        if (iEntry && pCur == pThread)
    13831383            break;
    1384         for (unsigned i = 0; i < ELEMENTS(apSeenThreads); i++)
     1384        for (unsigned i = 0; i < RT_ELEMENTS(apSeenThreads); i++)
    13851385            if (apSeenThreads[i] == pCur)
    13861386            {
     
    13931393         * Advance to the next thread.
    13941394         */
    1395         iSeenThread = (iSeenThread + 1) % ELEMENTS(apSeenThreads);
     1395        iSeenThread = (iSeenThread + 1) % RT_ELEMENTS(apSeenThreads);
    13961396        apSeenThreads[iSeenThread] = pCur;
    13971397        pCur = pNext;
  • trunk/src/VBox/Runtime/common/string/strformatrt.cpp

    r11413 r13836  
    271271                const char *pszType = *ppszFormat - 1;
    272272                int         iStart  = 0;
    273                 int         iEnd    = ELEMENTS(s_aTypes) - 1;
    274                 int         i       = ELEMENTS(s_aTypes) / 2;
     273                int         iEnd    = RT_ELEMENTS(s_aTypes) - 1;
     274                int         i       = RT_ELEMENTS(s_aTypes) / 2;
    275275
    276276                union
     
    765765                const char *pszType = *ppszFormat - 1;
    766766                int         iStart  = 0;
    767                 int         iEnd    = ELEMENTS(s_aTypes) - 1;
    768                 int         i       = ELEMENTS(s_aTypes) / 2;
     767                int         iEnd    = RT_ELEMENTS(s_aTypes) - 1;
     768                int         i       = RT_ELEMENTS(s_aTypes) / 2;
    769769
    770770                union
  • trunk/src/VBox/Runtime/common/string/uniread.cpp

    r8245 r13836  
    361361
    362362        RTUNICP CodePoint = ToNum(pszCodePoint);
    363         if (CodePoint >= ELEMENTS(g_aCPInfo))
     363        if (CodePoint >= RT_ELEMENTS(g_aCPInfo))
    364364            continue;
    365365
     
    394394    }
    395395    /* catchup? */
    396     while (i < ELEMENTS(g_aCPInfo))
     396    while (i < RT_ELEMENTS(g_aCPInfo))
    397397        NullEntry(i++);
    398398    fclose(pFile);
     
    410410static void ApplyProperty(RTUNICP StartCP, const char *pszProperty)
    411411{
    412     if (StartCP >= ELEMENTS(g_aCPInfo))
     412    if (StartCP >= RT_ELEMENTS(g_aCPInfo))
    413413        return;
    414414    struct CPINFO *pCPInfo = &g_aCPInfo[StartCP];
     
    649649    RTUNICP i = 0;
    650650    int iStart = -1;
    651     while (i < ELEMENTS(g_aCPInfo))
     651    while (i < RT_ELEMENTS(g_aCPInfo))
    652652    {
    653653        /* figure how far off the next chunk is */
     
    655655        unsigned iNonNull = i;
    656656        while (     (g_aCPInfo[iNonNull].fNullEntry || !CalcFlags(&g_aCPInfo[iNonNull], szFlags))
    657                &&   iNonNull < ELEMENTS(g_aCPInfo)
     657               &&   iNonNull < RT_ELEMENTS(g_aCPInfo)
    658658               &&   iNonNull >= 256)
    659659            iNonNull++;
    660         if (iNonNull - i > 4096 || iNonNull == ELEMENTS(g_aCPInfo))
     660        if (iNonNull - i > 4096 || iNonNull == RT_ELEMENTS(g_aCPInfo))
    661661        {
    662662            if (iStart >= 0)
     
    698698    RTUNICP i = 0;
    699699    int iStart = -1;
    700     while (i < ELEMENTS(g_aCPInfo))
     700    while (i < RT_ELEMENTS(g_aCPInfo))
    701701    {
    702702        /* figure how far off the next chunk is */
    703703        unsigned iSameCase = i;
    704704        while (     g_aCPInfo[iSameCase].SimpleUpperCaseMapping == g_aCPInfo[iSameCase].CodePoint
    705                &&   iSameCase < ELEMENTS(g_aCPInfo)
     705               &&   iSameCase < RT_ELEMENTS(g_aCPInfo)
    706706               &&   iSameCase >= 256)
    707707            iSameCase++;
    708         if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == ELEMENTS(g_aCPInfo))
     708        if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == RT_ELEMENTS(g_aCPInfo))
    709709        {
    710710            if (iStart >= 0)
     
    745745    RTUNICP i = 0;
    746746    int iStart = -1;
    747     while (i < ELEMENTS(g_aCPInfo))
     747    while (i < RT_ELEMENTS(g_aCPInfo))
    748748    {
    749749        /* figure how far off the next chunk is */
    750750        unsigned iSameCase = i;
    751751        while (     g_aCPInfo[iSameCase].SimpleLowerCaseMapping == g_aCPInfo[iSameCase].CodePoint
    752                &&   iSameCase < ELEMENTS(g_aCPInfo)
     752               &&   iSameCase < RT_ELEMENTS(g_aCPInfo)
    753753               &&   iSameCase >= 256)
    754754            iSameCase++;
    755         if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == ELEMENTS(g_aCPInfo))
     755        if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == RT_ELEMENTS(g_aCPInfo))
    756756        {
    757757            if (iStart >= 0)
  • trunk/src/VBox/Runtime/generic/semsrw-generic.cpp

    r12892 r13836  
    302302            if (pIntRWSem->cWriters == 0)
    303303            {
    304                 if (pIntRWSem->cReaders < ELEMENTS(pIntRWSem->aReaders))
     304                if (pIntRWSem->cReaders < RT_ELEMENTS(pIntRWSem->aReaders))
    305305                {
    306306                    /*
  • trunk/src/VBox/Runtime/r3/alloc-ef.cpp

    r13306 r13836  
    366366     * Check watch points.
    367367     */
    368     for (unsigned i = 0; i < ELEMENTS(gapvRTMemFreeWatch); i++)
     368    for (unsigned i = 0; i < RT_ELEMENTS(gapvRTMemFreeWatch); i++)
    369369        if (gapvRTMemFreeWatch[i] == pv)
    370370            RTAssertDoPanic();
  • trunk/src/VBox/Runtime/r3/darwin/mp-darwin.cpp

    r11810 r13836  
    6262    int cCpus = -1;
    6363    size_t cb = sizeof(cCpus);
    64     int rc = sysctl(aiMib, ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);
     64    int rc = sysctl(aiMib, RT_ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);
    6565    if (rc != -1 && cCpus >= 1)
    6666        return cCpus;
     
    191191    int cCpus = -1;
    192192    cb = sizeof(cCpus);
    193     rc = sysctl(aiMib, ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);
     193    rc = sysctl(aiMib, RT_ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);
    194194    if (rc != -1 && cCpus >= 1)
    195195        return cCpus;
  • trunk/src/VBox/Runtime/r3/linux/sched-linux.cpp

    r8245 r13836  
    566566         */
    567567        rc = VERR_FILE_NOT_FOUND;
    568         for (unsigned i = 0; i < ELEMENTS(g_aUnixConfigs); i++)
     568        for (unsigned i = 0; i < RT_ELEMENTS(g_aUnixConfigs); i++)
    569569        {
    570570            if (g_aUnixConfigs[i].enmPriority == enmPriority)
  • trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp

    r8245 r13836  
    666666            case OSPRIOSUP_PROCESS_AND_THREAD_LEVEL:
    667667                pa = g_aProcessAndThread;
    668                 c = ELEMENTS(g_aProcessAndThread);
     668                c = RT_ELEMENTS(g_aProcessAndThread);
    669669                break;
    670670            case OSPRIOSUP_THREAD_LEVEL:
    671671                pa = g_aUnixConfigs;
    672                 c = ELEMENTS(g_aUnixConfigs);
     672                c = RT_ELEMENTS(g_aUnixConfigs);
    673673                break;
    674674            default:
  • trunk/src/VBox/Runtime/r3/win/path-win.cpp

    r13104 r13836  
    6868    LPWSTR lpFile;
    6969    WCHAR  wsz[RTPATH_MAX];
    70     rc = GetFullPathNameW((LPCWSTR)pwszPath, ELEMENTS(wsz), &wsz[0], &lpFile);
    71     if (rc > 0 && rc < ELEMENTS(wsz))
     70    rc = GetFullPathNameW((LPCWSTR)pwszPath, RT_ELEMENTS(wsz), &wsz[0], &lpFile);
     71    if (rc > 0 && rc < RT_ELEMENTS(wsz))
    7272    {
    7373        /* Check that it exists. (Use RTPathAbs() to just resolve the name.) */
  • trunk/src/VBox/Runtime/testcase/tstAvl.cpp

    r8245 r13836  
    851851    s1.aNode[3].Key        = 0xfffe0000;
    852852    s1.aNode[3].KeyLast    = 0xfffe0ffe;
    853     for (i = 0; i < ELEMENTS(s1.aNode); i++)
     853    for (i = 0; i < RT_ELEMENTS(s1.aNode); i++)
    854854    {
    855855        PAVLROGCPHYSNODECORE pNode = &s1.aNode[i];
     
    893893    s3 = s1;
    894894    s1 = s2;
    895     for (i = 0; i < ELEMENTS(s3.aNode); i++)
     895    for (i = 0; i < RT_ELEMENTS(s3.aNode); i++)
    896896    {
    897897        PAVLROGCPHYSNODECORE pNode = &s3.aNode[i];
  • trunk/src/VBox/Runtime/testcase/tstErrUnique.cpp

    r8729 r13836  
    7070    RTPrintf("tstErrUnique: TESTING\n");
    7171
    72     for (uint32_t i = 0; i < ELEMENTS(g_aErrorMessages) - 1; i++)
     72    for (uint32_t i = 0; i < RT_ELEMENTS(g_aErrorMessages) - 1; i++)
    7373    {
    7474        if (strIsPermissibleDuplicate(&g_aErrorMessages[i]))
    7575            continue;
    7676
    77         for (uint32_t j = i + 1; j < ELEMENTS(g_aErrorMessages); j++)
     77        for (uint32_t j = i + 1; j < RT_ELEMENTS(g_aErrorMessages); j++)
    7878        {
    7979            if (strIsPermissibleDuplicate(&g_aErrorMessages[j]))
  • trunk/src/VBox/Runtime/testcase/tstHeapSimple.cpp

    r8245 r13836  
    106106
    107107    /* allocate */
    108     for (i = 0; i < ELEMENTS(aOps); i++)
     108    for (i = 0; i < RT_ELEMENTS(aOps); i++)
    109109    {
    110110        aOps[i].pvAlloc = RTHeapSimpleAlloc(Heap, aOps[i].cb, aOps[i].uAlignment);
     
    123123
    124124    /* free and allocate the same node again. */
    125     for (i = 0; i < ELEMENTS(aOps); i++)
     125    for (i = 0; i < RT_ELEMENTS(aOps); i++)
    126126    {
    127127        if (!aOps[i].pvAlloc)
     
    156156    /* free it in a specific order. */
    157157    int cFreed = 0;
    158     for (i = 0; i < ELEMENTS(aOps); i++)
     158    for (i = 0; i < RT_ELEMENTS(aOps); i++)
    159159    {
    160160        unsigned j;
    161         for (j = 0; j < ELEMENTS(aOps); j++)
     161        for (j = 0; j < RT_ELEMENTS(aOps); j++)
    162162        {
    163163            if (    aOps[j].iFreeOrder != i
  • trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp

    r8245 r13836  
    110110     * Load them.
    111111     */
    112     for (i = 0; i < ELEMENTS(aLoads); i++)
     112    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    113113    {
    114114        if (!strncmp(aLoads[i].pszName, "kLdr-", sizeof("kLdr-") - 1))
     
    158158    if (!cErrors)
    159159    {
    160         for (i = 0; i < ELEMENTS(aLoads); i += 1)
     160        for (i = 0; i < RT_ELEMENTS(aLoads); i += 1)
    161161        {
    162162            /* get the pointer. */
     
    188188     * Clean up.
    189189     */
    190     for (i = 0; i < ELEMENTS(aLoads); i++)
     190    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    191191    {
    192192        if (aLoads[i].pvBits)
  • trunk/src/VBox/Runtime/testcase/tstLdr.cpp

    r8245 r13836  
    102102     * Load them.
    103103     */
    104     for (i = 0; i < ELEMENTS(aLoads); i++)
     104    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    105105    {
    106106        int rc;
     
    185185        {
    186186            /* Compare all which are at the same address. */
    187             for (i = 0; i < ELEMENTS(aLoads) - 1; i++)
     187            for (i = 0; i < RT_ELEMENTS(aLoads) - 1; i++)
    188188            {
    189                 for (unsigned j = i + 1; j < ELEMENTS(aLoads); j++)
     189                for (unsigned j = i + 1; j < RT_ELEMENTS(aLoads); j++)
    190190                {
    191191                    if (aLoads[j].Addr == aLoads[i].Addr)
     
    206206
    207207            /* compare symbols. */
    208             for (i = 0; i < ELEMENTS(aLoads); i++)
     208            for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    209209            {
    210                 for (unsigned iSym = 0; iSym < ELEMENTS(aSyms); iSym++)
     210                for (unsigned iSym = 0; iSym < RT_ELEMENTS(aSyms); iSym++)
    211211                {
    212212                    RTUINTPTR Value;
     
    241241            }
    242242
    243             if (iRel >= ELEMENTS(aRels))
     243            if (iRel >= RT_ELEMENTS(aRels))
    244244                break;
    245245
     
    263263     * Clean up.
    264264     */
    265     for (i = 0; i < ELEMENTS(aLoads); i++)
     265    for (i = 0; i < RT_ELEMENTS(aLoads); i++)
    266266    {
    267267        if (aLoads[i].pvBits)
  • trunk/src/VBox/Runtime/testcase/tstPath.cpp

    r11836 r13836  
    7878        cErrors++;
    7979    }
    80    
     80
    8181
    8282    /*
     
    122122        };
    123123
    124     for (unsigned i = 0; i < ELEMENTS(aInput); i += 2)
     124    for (unsigned i = 0; i < RT_ELEMENTS(aInput); i += 2)
    125125    {
    126126        RTPrintf("tstPath: base={%s}, path={%s}, ", aInput[i], aInput[i + 1]);
  • trunk/src/VBox/Runtime/testcase/tstStrToNum.cpp

    r8279 r13836  
    8787    do \
    8888    { \
    89         for (unsigned iTest = 0; iTest < ELEMENTS(aTests); iTest++) \
     89        for (unsigned iTest = 0; iTest < RT_ELEMENTS(aTests); iTest++) \
    9090        { \
    9191            TEST(aTests[iTest], Type, Fmt, Fun, iTest); \
  • trunk/src/VBox/Runtime/testcase/tstTimer.cpp

    r10948 r13836  
    135135
    136136    unsigned i = 0;
    137     for (i = 0; i < ELEMENTS(aTests); i++)
     137    for (i = 0; i < RT_ELEMENTS(aTests); i++)
    138138    {
    139139        aTests[i].cLower = (aTests[i].uMilliesWait - aTests[i].uMilliesWait / 10) / aTests[i].uMilliesInterval;
  • trunk/src/VBox/Runtime/testcase/tstTimerLR.cpp

    r10944 r13836  
    132132
    133133    unsigned i = 0;
    134     for (i = 0; i < ELEMENTS(aTests); i++)
     134    for (i = 0; i < RT_ELEMENTS(aTests); i++)
    135135    {
    136136        //aTests[i].cLower = (aTests[i].uMilliesWait - aTests[i].uMilliesWait / 10) / aTests[i].uMilliesInterval;
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r12912 r13836  
    400400        g_uszAll[i++] = uc++;
    401401    g_uszAll[i++] = 0;
    402     Assert(ELEMENTS(g_uszAll) == i);
     402    Assert(RT_ELEMENTS(g_uszAll) == i);
    403403
    404404    /* the utf-16 one */
     
    422422    //RTPrintf(" %#x=%#x\n", i, uc);
    423423    g_wszAll[i++] = '\0';
    424     Assert(ELEMENTS(g_wszAll) == i);
     424    Assert(RT_ELEMENTS(g_wszAll) == i);
    425425
    426426    /*
     
    472472    //RTPrintf(" %#x=%#x\n", i, uc);
    473473    g_szAll[i++] = '\0';
    474     Assert(ELEMENTS(g_szAll) == i);
     474    Assert(RT_ELEMENTS(g_szAll) == i);
    475475}
    476476
     
    571571
    572572        size_t cCps;
    573         rc = RTStrToUniEx(g_szAll, RTSTR_MAX, &paCps, ELEMENTS(g_uszAll), &cCps);
     573        rc = RTStrToUniEx(g_szAll, RTSTR_MAX, &paCps, RT_ELEMENTS(g_uszAll), &cCps);
    574574        if (rc == VINF_SUCCESS)
    575575        {
    576             if (cCps != ELEMENTS(g_uszAll) - 1)
     576            if (cCps != RT_ELEMENTS(g_uszAll) - 1)
    577577            {
    578                 RTPrintf("tstUtf8: FAILURE - the full #3+: wrong Code Point count %zu, expected %zu\n", cCps, ELEMENTS(g_uszAll) - 1);
     578                RTPrintf("tstUtf8: FAILURE - the full #3+: wrong Code Point count %zu, expected %zu\n", cCps, RT_ELEMENTS(g_uszAll) - 1);
    579579                g_cErrors++;
    580580            }
     
    866866
    867867    PRTUTF16 pwsz = &s_Buf.wszBuf[0];
    868     int rc = RTStrToUtf16Ex(&g_szAll[0], RTSTR_MAX, &pwsz, ELEMENTS(s_Buf.wszBuf), NULL);
     868    int rc = RTStrToUtf16Ex(&g_szAll[0], RTSTR_MAX, &pwsz, RT_ELEMENTS(s_Buf.wszBuf), NULL);
    869869    if (RT_SUCCESS(rc))
    870870    {
     
    873873        for (i = 0; i < 100; i++)
    874874        {
    875             rc = RTStrToUtf16Ex(&g_szAll[0], RTSTR_MAX, &pwsz, ELEMENTS(s_Buf.wszBuf), NULL);
     875            rc = RTStrToUtf16Ex(&g_szAll[0], RTSTR_MAX, &pwsz, RT_ELEMENTS(s_Buf.wszBuf), NULL);
    876876            if (RT_FAILURE(rc))
    877877            {
     
    885885
    886886    char *psz = &s_Buf.szBuf[0];
    887     rc = RTUtf16ToUtf8Ex(&g_wszAll[0], RTSTR_MAX, &psz, ELEMENTS(s_Buf.szBuf), NULL);
     887    rc = RTUtf16ToUtf8Ex(&g_wszAll[0], RTSTR_MAX, &psz, RT_ELEMENTS(s_Buf.szBuf), NULL);
    888888    if (RT_SUCCESS(rc))
    889889    {
     
    892892        for (i = 0; i < 100; i++)
    893893        {
    894             rc = RTUtf16ToUtf8Ex(&g_wszAll[0], RTSTR_MAX, &psz, ELEMENTS(s_Buf.szBuf), NULL);
     894            rc = RTUtf16ToUtf8Ex(&g_wszAll[0], RTSTR_MAX, &psz, RT_ELEMENTS(s_Buf.szBuf), NULL);
    895895            if (RT_FAILURE(rc))
    896896            {
  • trunk/src/recompiler/VBoxRecompiler.c

    r13835 r13836  
    203203        .cArgsMax = 1,
    204204        .paArgDescs = &g_aArgRemStep[0],
    205         .cArgDescs = ELEMENTS(g_aArgRemStep),
     205        .cArgDescs = RT_ELEMENTS(g_aArgRemStep),
    206206        .pResultDesc = NULL,
    207207        .fFlags = 0,
     
    335335    if (!fRegisteredCmds)
    336336    {
    337         int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
     337        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
    338338        if (RT_SUCCESS(rc))
    339339            fRegisteredCmds = true;
     
    547547        if (RT_FAILURE(rc))
    548548            return rc;
    549         if (pRem->cInvalidatedPages > ELEMENTS(pRem->aGCPtrInvalidatedPages))
     549        if (pRem->cInvalidatedPages > RT_ELEMENTS(pRem->aGCPtrInvalidatedPages))
    550550        {
    551551            AssertMsgFailed(("cInvalidatedPages=%#x\n", pRem->cInvalidatedPages));
     
    46434643    {
    46444644        default:
    4645             if (uEAX < ELEMENTS(apsz))
     4645            if (uEAX < RT_ELEMENTS(apsz))
    46464646                Log(("REM: linux syscall %3d: %s (eip=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x ebp=%08x)\n",
    46474647                     uEAX, apsz[uEAX], CPUMGetGuestEIP(pVM), CPUMGetGuestEBX(pVM), CPUMGetGuestECX(pVM),
     
    49724972    {
    49734973        default:
    4974             if (uEAX < ELEMENTS(apsz))
     4974            if (uEAX < RT_ELEMENTS(apsz))
    49754975            {
    49764976                uint32_t au32Args[8] = {0};
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r13835 r13836  
    202202        .cArgsMax = 1,
    203203        .paArgDescs = &g_aArgRemStep[0],
    204         .cArgDescs = ELEMENTS(g_aArgRemStep),
     204        .cArgDescs = RT_ELEMENTS(g_aArgRemStep),
    205205        .pResultDesc = NULL,
    206206        .fFlags = 0,
     
    325325    if (!fRegisteredCmds)
    326326    {
    327         int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
     327        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
    328328        if (RT_SUCCESS(rc))
    329329            fRegisteredCmds = true;
     
    536536        if (RT_FAILURE(rc))
    537537            return rc;
    538         if (pRem->cInvalidatedPages > ELEMENTS(pRem->aGCPtrInvalidatedPages))
     538        if (pRem->cInvalidatedPages > RT_ELEMENTS(pRem->aGCPtrInvalidatedPages))
    539539        {
    540540            AssertMsgFailed(("cInvalidatedPages=%#x\n", pRem->cInvalidatedPages));
     
    47254725    {
    47264726        default:
    4727             if (uEAX < ELEMENTS(apsz))
     4727            if (uEAX < RT_ELEMENTS(apsz))
    47284728                Log(("REM: linux syscall %3d: %s (eip=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x ebp=%08x)\n",
    47294729                     uEAX, apsz[uEAX], CPUMGetGuestEIP(pVM), CPUMGetGuestEBX(pVM), CPUMGetGuestECX(pVM),
     
    50545054    {
    50555055        default:
    5056             if (uEAX < ELEMENTS(apsz))
     5056            if (uEAX < RT_ELEMENTS(apsz))
    50575057            {
    50585058                uint32_t au32Args[8] = {0};
  • trunk/src/testcase/tstRunTestcases.cpp

    r11822 r13836  
    113113    {
    114114        RTPathStripExt(pszDup);
    115         for (unsigned i = 0; i < ELEMENTS(g_apszExclude); i++)
     115        for (unsigned i = 0; i < RT_ELEMENTS(g_apszExclude); i++)
    116116        {
    117117            if (!strcmp(g_apszExclude[i], pszDup))
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