Changeset 13836 in vbox
- Timestamp:
- Nov 5, 2008 2:42:54 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 38827
- Location:
- trunk
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r13832 r13836 1378 1378 * Converts an uint16_t value from network to host byte order. */ 1379 1379 #define RT_N2H_U16_C(u16) RT_BE2H_U16_C(u16) 1380 1381 1382 /** @def RT_NO_DEPRECATED_MACROS1383 * Define RT_NO_DEPRECATED_MACROS to not define deprecated macros.1384 */1385 #ifndef RT_NO_DEPRECATED_MACROS1386 /** @copydoc RT_ELEMENTS1387 * @deprecated use RT_ELEMENTS. */1388 # define ELEMENTS(aArray) RT_ELEMENTS(aArray)1389 #endif1390 1380 1391 1381 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/drv.c
r8155 r13836 87 87 { 88 88 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, 91 91 * and is either the screen device surface with handle = hsurfScreen, 92 92 * or a surface derived from DDRAW with address equal to the framebuffer. … … 302 302 303 303 STATPRINT; 304 304 305 305 #ifdef VBOX_VBVA_ADJUST_RECT 306 /* Experimental fix for too large bitmap updates. 306 /* Experimental fix for too large bitmap updates. 307 307 * 308 308 * Some application do a large bitmap update event if only … … 312 312 * the current framebuffer content with the source bitmap. 313 313 * 314 * The optimization is only active when: 314 * The optimization is only active when: 315 315 * - the VBVA extension is enabled; 316 316 * - the source bitmap is not cacheable; … … 597 597 DISPDBG((1, "DrvSaveScreenBits: SS_SAVE %d\n", ppdev->cSSB)); 598 598 599 if (ppdev->cSSB >= ELEMENTS(ppdev->aSSB))599 if (ppdev->cSSB >= RT_ELEMENTS(ppdev->aSSB)) 600 600 { 601 601 /* All slots are already in use. Fail. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdp.c
r8155 r13836 231 231 prcl->right = x + w; 232 232 prcl->bottom = y + h; 233 233 234 234 DISPDBG((1, "vrdpAdjustRect: result %d-%d %d-%d\n", prcl->left, prcl->right, prcl->top, prcl->bottom)); 235 235 } … … 1194 1194 ULONG ulForeRGB = pboFore? vrdpColor2RGB (pso, pboFore->iSolidColor): 0; 1195 1195 ULONG ulBackRGB = pboOpaque? vrdpColor2RGB (pso, pboOpaque->iSolidColor): 0; 1196 1196 1197 1197 DISPDBG((1, "VRDP::vrdpTextOut: calling vboxReportText fg %x bg %x\n", 1198 1198 ulForeRGB, ulBackRGB)); 1199 1199 1200 1200 if (!vboxReportText (ppdev, &clipRects, pstro, pfo, prclOpaque, ulForeRGB, ulBackRGB)) 1201 1201 { … … 1345 1345 static void vrdpPolyPointsAdd (VRDPORDERPOLYPOINTS *pPoints, const VRDPORDERPOINT *ppt) 1346 1346 { 1347 VBVA_ASSERT(pPoints->c < ELEMENTS(pPoints->a));1347 VBVA_ASSERT(pPoints->c < RT_ELEMENTS(pPoints->a)); 1348 1348 1349 1349 pPoints->a[pPoints->c] = *ppt; … … 1517 1517 vrdpExtendOrderBounds (&bounds, &pt); 1518 1518 1519 if (order.points.c == ELEMENTS(order.points.a))1519 if (order.points.c == RT_ELEMENTS(order.points.a)) 1520 1520 { 1521 1521 /* Flush the order and start a new order. */ … … 1538 1538 || ptStart.y != pt.y) 1539 1539 { 1540 VBVA_ASSERT(order.points.c < ELEMENTS(order.points.a));1540 VBVA_ASSERT(order.points.c < RT_ELEMENTS(order.points.a)); 1541 1541 1542 1542 vrdpPolyPointsAdd (&order.points, &ptStart); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdpbmp.c
r8155 r13836 144 144 /* Get the free entry to be used. Try tail, that should be */ 145 145 pEntry = pCache->tail; 146 146 147 147 if (pEntry == NULL) 148 148 { … … 221 221 222 222 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++) 226 226 { 227 227 VRDPBCENTRY *pEntry = &pCache->aEntries[i]; -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp
r10777 r13836 91 91 { 92 92 int i; 93 for (i = 0; i < ELEMENTS(parameters); i++)93 for (i = 0; i < RT_ELEMENTS(parameters); i++) 94 94 { 95 95 if (parameters[i].level > level) … … 99 99 */ 100 100 Log(("VBoxTray: vboxExperienceSet: Saving %s\n", parameters[i].name)); 101 101 102 102 /* Save the current value. */ 103 103 switch (parameters[i].type) … … 106 106 { 107 107 /* 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. 109 109 */ 110 110 SystemParametersInfo (parameters[i].uActionGet, … … 126 126 case VBOX_SPI_PTR: 127 127 { 128 /* The 3rd parameter points to the structure. 128 /* The 3rd parameter points to the structure. 129 129 * The cbSize member of this structure must be set. 130 130 * The uiParam parameter must alos be set. … … 135 135 break; 136 136 } 137 137 138 138 *(UINT *)¶meters[i].achSavedValue[0] = parameters[i].cbSavedValue; 139 139 140 140 SystemParametersInfo (parameters[i].uActionGet, 141 141 parameters[i].cbSavedValue, … … 147 147 break; 148 148 } 149 149 150 150 Log(("VBoxTray: vboxExperienceSet: Disabling %s\n", parameters[i].name)); 151 151 152 152 /* Disable the feature. */ 153 153 switch (parameters[i].type) … … 199 199 { 200 200 int i; 201 for (i = 0; i < ELEMENTS(parameters); i++)201 for (i = 0; i < RT_ELEMENTS(parameters); i++) 202 202 { 203 203 if (parameters[i].level > level) 204 204 { 205 205 Log(("VBoxTray: vboxExperienceRestore: Restoring %s\n", parameters[i].name)); 206 206 207 207 /* Restore the feature. */ 208 208 switch (parameters[i].type) … … 260 260 uint32_t level; 261 261 BOOL fSavedThemeEnabled; 262 262 263 263 HMODULE hModule; 264 264 … … 280 280 281 281 gCtx.hModule = LoadLibrary("UxTheme"); 282 282 283 283 if (gCtx.hModule) 284 284 { … … 290 290 gCtx.pfnEnableTheming = 0; 291 291 } 292 292 293 293 *pfStartThread = true; 294 294 *ppInstance = &gCtx; … … 318 318 VBoxGuestFilterMaskInfo maskInfo; 319 319 DWORD cbReturned; 320 320 321 321 maskInfo.u32OrMask = VMMDEV_EVENT_VRDP; 322 322 maskInfo.u32NotMask = 0; … … 352 352 /* Call the host to get VRDP status and the experience level. */ 353 353 VMMDevVRDPChangeRequest vrdpChangeRequest = {0}; 354 354 355 355 vrdpChangeRequest.header.size = sizeof(VMMDevVRDPChangeRequest); 356 356 vrdpChangeRequest.header.version = VMMDEV_REQUEST_HEADER_VERSION; … … 358 358 vrdpChangeRequest.u8VRDPActive = 0; 359 359 vrdpChangeRequest.u32VRDPExperienceLevel = 0; 360 360 361 361 if (DeviceIoControl (gVBoxDriver, 362 362 VBOXGUEST_IOCTL_VMMREQUEST(sizeof(VMMDevVRDPChangeRequest)), … … 368 368 { 369 369 Log(("VBoxTray: VBoxVRDPThread: u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel)); 370 370 371 371 if (vrdpChangeRequest.u8VRDPActive) 372 372 { 373 373 pCtx->level = vrdpChangeRequest.u32VRDPExperienceLevel; 374 374 vboxExperienceSet (pCtx->level); 375 375 376 376 if (pCtx->level == VRDP_EXPERIENCE_LEVEL_ZERO 377 377 && pCtx->pfnEnableTheming … … 379 379 { 380 380 pCtx->fSavedThemeEnabled = pCtx->pfnIsThemeActive (); 381 381 382 382 Log(("VBoxTray: VBoxVRDPThread: pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled)); 383 383 384 384 if (pCtx->fSavedThemeEnabled) 385 385 { … … 402 402 } 403 403 } 404 404 405 405 vboxExperienceRestore (pCtx->level); 406 406 407 407 pCtx->level = VRDP_EXPERIENCE_LEVEL_FULL; 408 408 } … … 420 420 } 421 421 } 422 } 422 } 423 423 else 424 424 { -
trunk/src/VBox/Additions/common/VBoxGuestLib/HGCM.cpp
r13835 r13836 81 81 */ 82 82 83 for (i = 0; i < ELEMENTS(g_vbgldata.aHGCMHandleData); i++)83 for (i = 0; i < RT_ELEMENTS(g_vbgldata.aHGCMHandleData); i++) 84 84 { 85 85 if (!g_vbgldata.aHGCMHandleData[i].fAllocated) -
trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
r13835 r13836 373 373 static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 374 374 int rc = RTLogCreate(&pLogger, 0, "all", 375 NULL, ELEMENTS(s_apszGroups), s_apszGroups,375 NULL, RT_ELEMENTS(s_apszGroups), s_apszGroups, 376 376 RTLOGDEST_STDOUT, NULL); 377 377 RTLogRelSetDefaultInstance(pLogger); -
trunk/src/VBox/Disassembler/DisasmCore.cpp
r13834 r13836 2369 2369 { 2370 2370 #if 0 //def DEBUG_Sander 2371 AssertMsg(idx < ELEMENTS(szModRMSegReg), ("idx=%d\n", idx));2371 AssertMsg(idx < RT_ELEMENTS(szModRMSegReg), ("idx=%d\n", idx)); 2372 2372 #endif 2373 2373 #ifdef IN_RING3 2374 if (idx >= ELEMENTS(szModRMSegReg))2374 if (idx >= RT_ELEMENTS(szModRMSegReg)) 2375 2375 { 2376 2376 Log(("disasmModRMSReg %d failed!!\n", idx)); … … 2379 2379 #endif 2380 2380 2381 idx = RT_MIN(idx, ELEMENTS(szModRMSegReg)-1);2381 idx = RT_MIN(idx, RT_ELEMENTS(szModRMSegReg)-1); 2382 2382 disasmAddString(pParam->szParam, szModRMSegReg[idx]); 2383 2383 pParam->flags |= USE_REG_SEG; -
trunk/src/VBox/Disassembler/DisasmReg.cpp
r13835 r13836 327 327 DISDECL(int) DISFetchReg8(PCCPUMCTXCORE pCtx, unsigned reg8, uint8_t *pVal) 328 328 { 329 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);329 AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER); 330 330 331 331 *pVal = DIS_READ_REG8(pCtx, reg8); … … 339 339 DISDECL(int) DISFetchReg16(PCCPUMCTXCORE pCtx, unsigned reg16, uint16_t *pVal) 340 340 { 341 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);341 AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER); 342 342 343 343 *pVal = DIS_READ_REG16(pCtx, reg16); … … 351 351 DISDECL(int) DISFetchReg32(PCCPUMCTXCORE pCtx, unsigned reg32, uint32_t *pVal) 352 352 { 353 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);353 AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER); 354 354 355 355 *pVal = DIS_READ_REG32(pCtx, reg32); … … 363 363 DISDECL(int) DISFetchReg64(PCCPUMCTXCORE pCtx, unsigned reg64, uint64_t *pVal) 364 364 { 365 AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);365 AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER); 366 366 367 367 *pVal = DIS_READ_REG64(pCtx, reg64); … … 375 375 DISDECL(int) DISPtrReg8(PCPUMCTXCORE pCtx, unsigned reg8, uint8_t **ppReg) 376 376 { 377 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);377 AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER); 378 378 379 379 *ppReg = DIS_PTR_REG8(pCtx, reg8); … … 387 387 DISDECL(int) DISPtrReg16(PCPUMCTXCORE pCtx, unsigned reg16, uint16_t **ppReg) 388 388 { 389 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);389 AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER); 390 390 391 391 *ppReg = DIS_PTR_REG16(pCtx, reg16); … … 399 399 DISDECL(int) DISPtrReg32(PCPUMCTXCORE pCtx, unsigned reg32, uint32_t **ppReg) 400 400 { 401 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);401 AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER); 402 402 403 403 *ppReg = DIS_PTR_REG32(pCtx, reg32); … … 411 411 DISDECL(int) DISPtrReg64(PCPUMCTXCORE pCtx, unsigned reg64, uint64_t **ppReg) 412 412 { 413 AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);413 AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER); 414 414 415 415 *ppReg = DIS_PTR_REG64(pCtx, reg64); … … 423 423 DISDECL(int) DISFetchRegSeg(PCCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL *pVal) 424 424 { 425 AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);425 AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER); 426 426 427 427 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL)); … … 436 436 DISDECL(int) DISFetchRegSegEx(PCCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL *pVal, CPUMSELREGHID **ppSelHidReg) 437 437 { 438 AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);438 AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER); 439 439 440 440 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL)); … … 450 450 DISDECL(int) DISWriteReg64(PCPUMCTXCORE pRegFrame, unsigned reg64, uint64_t val64) 451 451 { 452 AssertReturn(reg64 < ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER);452 AssertReturn(reg64 < RT_ELEMENTS(g_aReg64Index), VERR_INVALID_PARAMETER); 453 453 454 454 DIS_WRITE_REG64(pRegFrame, reg64, val64); … … 462 462 DISDECL(int) DISWriteReg32(PCPUMCTXCORE pRegFrame, unsigned reg32, uint32_t val32) 463 463 { 464 AssertReturn(reg32 < ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER);464 AssertReturn(reg32 < RT_ELEMENTS(g_aReg32Index), VERR_INVALID_PARAMETER); 465 465 466 466 DIS_WRITE_REG32(pRegFrame, reg32, val32); … … 474 474 DISDECL(int) DISWriteReg16(PCPUMCTXCORE pRegFrame, unsigned reg16, uint16_t val16) 475 475 { 476 AssertReturn(reg16 < ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER);476 AssertReturn(reg16 < RT_ELEMENTS(g_aReg16Index), VERR_INVALID_PARAMETER); 477 477 478 478 DIS_WRITE_REG16(pRegFrame, reg16, val16); … … 486 486 DISDECL(int) DISWriteReg8(PCPUMCTXCORE pRegFrame, unsigned reg8, uint8_t val8) 487 487 { 488 AssertReturn(reg8 < ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER);488 AssertReturn(reg8 < RT_ELEMENTS(g_aReg8Index), VERR_INVALID_PARAMETER); 489 489 490 490 DIS_WRITE_REG8(pRegFrame, reg8, val8); … … 498 498 DISDECL(int) DISWriteRegSeg(PCPUMCTXCORE pCtx, DIS_SELREG sel, RTSEL val) 499 499 { 500 AssertReturn((unsigned)sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);500 AssertReturn((unsigned)sel < RT_ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER); 501 501 502 502 AssertCompile(sizeof(uint16_t) == sizeof(RTSEL)); -
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r13835 r13836 1138 1138 PRTLOGGER pLogger; 1139 1139 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, 1141 1141 RTLOGDEST_FILE, szError, sizeof(szError), "./VBoxBFE.log"); 1142 1142 if (RT_SUCCESS(rc2)) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r13603 r13836 1704 1704 { 1705 1705 QStringList list; 1706 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1706 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1707 1707 list << comKnownPorts [i].name; 1708 1708 … … 1716 1716 { 1717 1717 QStringList list; 1718 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1718 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1719 1719 list << lptKnownPorts [i].name; 1720 1720 … … 1729 1729 QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const 1730 1730 { 1731 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1731 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1732 1732 if (comKnownPorts [i].IRQ == aIRQ && 1733 1733 comKnownPorts [i].IOBase == aIOBase) … … 1744 1744 QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const 1745 1745 { 1746 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1746 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1747 1747 if (lptKnownPorts [i].IRQ == aIRQ && 1748 1748 lptKnownPorts [i].IOBase == aIOBase) … … 1760 1760 ulong &aIOBase) const 1761 1761 { 1762 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1762 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1763 1763 if (strcmp (comKnownPorts [i].name, aName.utf8().data()) == 0) 1764 1764 { … … 1779 1779 ulong &aIOBase) const 1780 1780 { 1781 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1781 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1782 1782 if (strcmp (lptKnownPorts [i].name, aName.utf8().data()) == 0) 1783 1783 { … … 4455 4455 { "kfmclient:exec", "gnome-open", "x-www-browser", "firefox", "konqueror" }; 4456 4456 4457 for (size_t i = 0; i < ELEMENTS (commands); ++ i)4457 for (size_t i = 0; i < RT_ELEMENTS (commands); ++ i) 4458 4458 { 4459 4459 QStringList args = QStringList::split (':', commands [i]); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h
r13580 r13836 382 382 QString text (int aColumn) const 383 383 { 384 AssertReturn (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos),384 AssertReturn (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos), 385 385 QString::null); 386 386 … … 390 390 const QPixmap *pixmap (int aColumn) const 391 391 { 392 AssertReturn (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos),392 AssertReturn (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos), 393 393 NULL); 394 394 … … 412 412 if (mFocusColumn >= 0) 413 413 { 414 AssertReturnVoid ((size_t) mFocusColumn < ELEMENTS (mCombos));414 AssertReturnVoid ((size_t) mFocusColumn < RT_ELEMENTS (mCombos)); 415 415 416 416 if (mCombos [mFocusColumn]->count()) … … 469 469 const QUuid &aMachineId) 470 470 { 471 AssertReturnVoid (listView()->columns() == ELEMENTS (mCombos));471 AssertReturnVoid (listView()->columns() == RT_ELEMENTS (mCombos)); 472 472 473 473 setSelectable (false); … … 502 502 int aColumn, int aWidth, int aAlign) 503 503 { 504 AssertReturnVoid (aColumn >= 0 && (size_t) aColumn < ELEMENTS (mCombos));504 AssertReturnVoid (aColumn >= 0 && (size_t) aColumn < RT_ELEMENTS (mCombos)); 505 505 506 506 QComboBox *cb = mCombos [aColumn]; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r13835 r13836 1673 1673 { 1674 1674 QStringList list; 1675 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1675 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1676 1676 list << comKnownPorts [i].name; 1677 1677 … … 1685 1685 { 1686 1686 QStringList list; 1687 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1687 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1688 1688 list << lptKnownPorts [i].name; 1689 1689 … … 1698 1698 QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const 1699 1699 { 1700 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1700 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1701 1701 if (comKnownPorts [i].IRQ == aIRQ && 1702 1702 comKnownPorts [i].IOBase == aIOBase) … … 1713 1713 QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const 1714 1714 { 1715 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1715 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1716 1716 if (lptKnownPorts [i].IRQ == aIRQ && 1717 1717 lptKnownPorts [i].IOBase == aIOBase) … … 1729 1729 ulong &aIOBase) const 1730 1730 { 1731 for (size_t i = 0; i < ELEMENTS (comKnownPorts); ++ i)1731 for (size_t i = 0; i < RT_ELEMENTS (comKnownPorts); ++ i) 1732 1732 if (strcmp (comKnownPorts [i].name, aName.toUtf8().data()) == 0) 1733 1733 { … … 1748 1748 ulong &aIOBase) const 1749 1749 { 1750 for (size_t i = 0; i < ELEMENTS (lptKnownPorts); ++ i)1750 for (size_t i = 0; i < RT_ELEMENTS (lptKnownPorts); ++ i) 1751 1751 if (strcmp (lptKnownPorts [i].name, aName.toUtf8().data()) == 0) 1752 1752 { … … 4782 4782 { "kfmclient:exec", "gnome-open", "x-www-browser", "firefox", "konqueror" }; 4783 4783 4784 for (size_t i = 0; i < ELEMENTS (commands); ++ i)4784 for (size_t i = 0; i < RT_ELEMENTS (commands); ++ i) 4785 4785 { 4786 4786 QStringList args = QString(commands [i]).split (':'); -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r13471 r13836 4947 4947 * TSC History. 4948 4948 */ 4949 Assert( ELEMENTS(pGipCpu->au32TSCHistory) == 8);4949 Assert(RT_ELEMENTS(pGipCpu->au32TSCHistory) == 8); 4950 4950 4951 4951 iTSCHistoryHead = (pGipCpu->iTSCHistoryHead + 1) & 7; -
trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
r13835 r13836 59 59 void *pvPages0 = (void *)0x77777777; 60 60 memset(&aPages0[0], 0x8f, sizeof(aPages0)); 61 rc = SUPLowAlloc( ELEMENTS(aPages0), &pvPages0, NULL, aPages0);61 rc = SUPLowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0); 62 62 if (RT_SUCCESS(rc)) 63 63 { 64 64 /* 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++) 66 66 { 67 67 RTPrintf("%-4d: Phys=%VHp Reserved=%p\n", iPage, aPages0[iPage].Phys, aPages0[iPage].uReserved); … … 80 80 if (!rcRet) 81 81 { 82 for (unsigned iPage = 0; iPage < ELEMENTS(aPages0); iPage++)82 for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++) 83 83 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++) 85 85 for (uint8_t *pu8 = (uint8_t *)pvPages0 + iPage * PAGE_SIZE, *pu8End = pu8 + PAGE_SIZE; pu8 < pu8End; pu8++) 86 86 if (*pu8 != (uint8_t)iPage) … … 91 91 } 92 92 } 93 SUPLowFree(pvPages0, ELEMENTS(aPages0));93 SUPLowFree(pvPages0, RT_ELEMENTS(aPages0)); 94 94 } 95 95 else 96 96 { 97 RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Vrc\n", ELEMENTS(aPages0), rc);97 RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Vrc\n", RT_ELEMENTS(aPages0), rc); 98 98 rcRet++; 99 99 } -
trunk/src/VBox/Main/ConsoleImpl.cpp
r13782 r13836 274 274 275 275 #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++) 279 279 { 280 280 maTapFD[i] = NIL_RTFILE; … … 4182 4182 Utf8Str oldName, newName; 4183 4183 4184 for (unsigned int j = 0; j < ELEMENTS (files); ++ j)4184 for (unsigned int j = 0; j < RT_ELEMENTS (files); ++ j) 4185 4185 { 4186 4186 if (i > 0) -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r13835 r13836 1071 1071 1072 1072 unsigned i; 1073 for (i = 0; i < ELEMENTS(maFramebuffers); i++)1073 for (i = 0; i < RT_ELEMENTS(maFramebuffers); i++) 1074 1074 { 1075 1075 if (maFramebuffers[i]) … … 1972 1972 #undef DEFSYMENTRY 1973 1973 1974 for (unsigned i = 0; i < ELEMENTS(symbols); i++)1974 for (unsigned i = 0; i < RT_ELEMENTS(symbols); i++) 1975 1975 { 1976 1976 rc = RTLdrGetSymbol(mVRDPLibrary, symbols[i].name, symbols[i].ppfn); -
trunk/src/VBox/Main/MachineImpl.cpp
r13835 r13836 202 202 mBootOrder [1] = DeviceType_DVD; 203 203 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++) 205 205 mBootOrder [i] = DeviceType_Null; 206 206 … … 231 231 return false; 232 232 233 for (size_t i = 0; i < ELEMENTS (mBootOrder); ++ i)233 for (size_t i = 0; i < RT_ELEMENTS (mBootOrder); ++ i) 234 234 if (mBootOrder [i] != that.mBootOrder [i]) 235 235 return false; … … 2258 2258 if (!port) 2259 2259 return E_POINTER; 2260 if (slot >= ELEMENTS (mSerialPorts))2260 if (slot >= RT_ELEMENTS (mSerialPorts)) 2261 2261 return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot); 2262 2262 … … 2275 2275 if (!port) 2276 2276 return E_POINTER; 2277 if (slot >= ELEMENTS (mParallelPorts))2277 if (slot >= RT_ELEMENTS (mParallelPorts)) 2278 2278 return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot); 2279 2279 … … 2292 2292 if (!adapter) 2293 2293 return E_POINTER; 2294 if (slot >= ELEMENTS (mNetworkAdapters))2294 if (slot >= RT_ELEMENTS (mNetworkAdapters)) 2295 2295 return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot); 2296 2296 … … 4349 4349 4350 4350 /* create associated serial port objects */ 4351 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)4351 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 4352 4352 { 4353 4353 unconst (mSerialPorts [slot]).createObject(); … … 4356 4356 4357 4357 /* create associated parallel port objects */ 4358 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)4358 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 4359 4359 { 4360 4360 unconst (mParallelPorts [slot]).createObject(); … … 4375 4375 4376 4376 /* create associated network adapter objects */ 4377 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)4377 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 4378 4378 { 4379 4379 unconst (mNetworkAdapters [slot]).createObject(); … … 4406 4406 /* tell all our other child objects we've been uninitialized */ 4407 4407 4408 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)4408 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 4409 4409 { 4410 4410 if (mNetworkAdapters [slot]) … … 4433 4433 } 4434 4434 4435 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)4435 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 4436 4436 { 4437 4437 if (mParallelPorts [slot]) … … 4442 4442 } 4443 4443 4444 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)4444 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 4445 4445 { 4446 4446 if (mSerialPorts [slot]) … … 5000 5000 { 5001 5001 /* 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++) 5003 5003 mHWData->mBootOrder [i] = DeviceType_Null; 5004 5004 … … 5013 5013 uint32_t position = (*it).value <uint32_t> ("position"); 5014 5014 -- position; 5015 Assert (position < ELEMENTS (mHWData->mBootOrder));5015 Assert (position < RT_ELEMENTS (mHWData->mBootOrder)); 5016 5016 5017 5017 /* device (required) */ … … 5082 5082 /* slot unicity is guaranteed by XML Schema */ 5083 5083 uint32_t slot = (*it).value <uint32_t> ("slot"); 5084 AssertBreak (slot < ELEMENTS (mNetworkAdapters));5084 AssertBreak (slot < RT_ELEMENTS (mNetworkAdapters)); 5085 5085 5086 5086 rc = mNetworkAdapters [slot]->loadSettings (*it); … … 5102 5102 /* slot unicity is guaranteed by XML Schema */ 5103 5103 uint32_t slot = (*it).value <uint32_t> ("slot"); 5104 AssertBreak (slot < ELEMENTS (mSerialPorts));5104 AssertBreak (slot < RT_ELEMENTS (mSerialPorts)); 5105 5105 5106 5106 rc = mSerialPorts [slot]->loadSettings (*it); … … 5122 5122 /* slot unicity is guaranteed by XML Schema */ 5123 5123 uint32_t slot = (*it).value <uint32_t> ("slot"); 5124 AssertBreak (slot < ELEMENTS (mSerialPorts));5124 AssertBreak (slot < RT_ELEMENTS (mSerialPorts)); 5125 5125 5126 5126 rc = mParallelPorts [slot]->loadSettings (*it); … … 6373 6373 Key bootNode = aNode.createKey ("Boot"); 6374 6374 6375 for (ULONG pos = 0; pos < ELEMENTS (mHWData->mBootOrder); ++ pos)6375 for (ULONG pos = 0; pos < RT_ELEMENTS (mHWData->mBootOrder); ++ pos) 6376 6376 { 6377 6377 const char *device = NULL; … … 6437 6437 Key nwNode = aNode.createKey ("Network"); 6438 6438 6439 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); ++ slot)6439 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); ++ slot) 6440 6440 { 6441 6441 Key adapterNode = nwNode.appendKey ("Adapter"); … … 6452 6452 Key serialNode = aNode.createKey ("UART"); 6453 6453 6454 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); ++ slot)6454 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); ++ slot) 6455 6455 { 6456 6456 Key portNode = serialNode.appendKey ("Port"); … … 6467 6467 Key parallelNode = aNode.createKey ("LPT"); 6468 6468 6469 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); ++ slot)6469 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); ++ slot) 6470 6470 { 6471 6471 Key portNode = parallelNode.appendKey ("Port"); … … 7193 7193 AutoReadLock alock (this); 7194 7194 7195 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)7195 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 7196 7196 if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isModified()) 7197 7197 return true; 7198 7198 7199 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)7199 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 7200 7200 if (mSerialPorts [slot] && mSerialPorts [slot]->isModified()) 7201 7201 return true; 7202 7202 7203 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)7203 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 7204 7204 if (mParallelPorts [slot] && mParallelPorts [slot]->isModified()) 7205 7205 return true; … … 7235 7235 AutoReadLock alock (this); 7236 7236 7237 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)7237 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 7238 7238 if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isReallyModified()) 7239 7239 return true; 7240 7240 7241 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)7241 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 7242 7242 if (mSerialPorts [slot] && mSerialPorts [slot]->isReallyModified()) 7243 7243 return true; 7244 7244 7245 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)7245 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 7246 7246 if (mParallelPorts [slot] && mParallelPorts [slot]->isReallyModified()) 7247 7247 return true; … … 7320 7320 usbChanged = false, sataChanged = false; 7321 7321 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)]; 7325 7325 7326 7326 if (mBIOSSettings) … … 7347 7347 sataChanged = mSATAController->rollback(); 7348 7348 7349 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)7349 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 7350 7350 if (mNetworkAdapters [slot]) 7351 7351 if (mNetworkAdapters [slot]->rollback()) 7352 7352 networkAdapters [slot] = mNetworkAdapters [slot]; 7353 7353 7354 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)7354 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 7355 7355 if (mSerialPorts [slot]) 7356 7356 if (mSerialPorts [slot]->rollback()) 7357 7357 serialPorts [slot] = mSerialPorts [slot]; 7358 7358 7359 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)7359 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 7360 7360 if (mParallelPorts [slot]) 7361 7361 if (mParallelPorts [slot]->rollback()) … … 7383 7383 that->onSATAControllerChange(); 7384 7384 7385 for (ULONG slot = 0; slot < ELEMENTS (networkAdapters); slot ++)7385 for (ULONG slot = 0; slot < RT_ELEMENTS (networkAdapters); slot ++) 7386 7386 if (networkAdapters [slot]) 7387 7387 that->onNetworkAdapterChange (networkAdapters [slot]); 7388 for (ULONG slot = 0; slot < ELEMENTS (serialPorts); slot ++)7388 for (ULONG slot = 0; slot < RT_ELEMENTS (serialPorts); slot ++) 7389 7389 if (serialPorts [slot]) 7390 7390 that->onSerialPortChange (serialPorts [slot]); 7391 for (ULONG slot = 0; slot < ELEMENTS (parallelPorts); slot ++)7391 for (ULONG slot = 0; slot < RT_ELEMENTS (parallelPorts); slot ++) 7392 7392 if (parallelPorts [slot]) 7393 7393 that->onParallelPortChange (parallelPorts [slot]); … … 7430 7430 mSATAController->commit(); 7431 7431 7432 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)7432 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 7433 7433 mNetworkAdapters [slot]->commit(); 7434 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)7434 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 7435 7435 mSerialPorts [slot]->commit(); 7436 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)7436 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 7437 7437 mParallelPorts [slot]->commit(); 7438 7438 … … 7487 7487 mSATAController->copyFrom (aThat->mSATAController); 7488 7488 7489 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)7489 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 7490 7490 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 ++) 7492 7492 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 ++) 7494 7494 mParallelPorts [slot]->copyFrom (aThat->mParallelPorts [slot]); 7495 7495 } … … 7738 7738 mAudioAdapter->init (this, aMachine->mAudioAdapter); 7739 7739 /* 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 ++) 7741 7741 { 7742 7742 unconst (mSerialPorts [slot]).createObject(); … … 7744 7744 } 7745 7745 /* 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 ++) 7747 7747 { 7748 7748 unconst (mParallelPorts [slot]).createObject(); … … 7756 7756 mSATAController->init (this, aMachine->mSATAController); 7757 7757 /* 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 ++) 7759 7759 { 7760 7760 unconst (mNetworkAdapters [slot]).createObject(); … … 10578 10578 mSATAController->initCopy (this, mPeer->mSATAController); 10579 10579 10580 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)10580 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 10581 10581 { 10582 10582 unconst (mNetworkAdapters [slot]).createObject(); … … 10584 10584 } 10585 10585 10586 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)10586 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 10587 10587 { 10588 10588 unconst (mSerialPorts [slot]).createObject(); … … 10590 10590 } 10591 10591 10592 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)10592 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 10593 10593 { 10594 10594 unconst (mParallelPorts [slot]).createObject(); … … 10680 10680 mSATAController->init (this); 10681 10681 10682 for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)10682 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++) 10683 10683 { 10684 10684 unconst (mNetworkAdapters [slot]).createObject(); … … 10686 10686 } 10687 10687 10688 for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)10688 for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++) 10689 10689 { 10690 10690 unconst (mSerialPorts [slot]).createObject(); … … 10692 10692 } 10693 10693 10694 for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)10694 for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++) 10695 10695 { 10696 10696 unconst (mParallelPorts [slot]).createObject(); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r13835 r13836 3010 3010 const char *kMediaNodes[] = { "HardDisks", "DVDImages", "FloppyImages" }; 3011 3011 3012 for (size_t n = 0; n < ELEMENTS (kMediaNodes); ++ n)3012 for (size_t n = 0; n < RT_ELEMENTS (kMediaNodes); ++ n) 3013 3013 { 3014 3014 /* All three media nodes are optional */ -
trunk/src/VBox/Main/include/AutoLock.h
r13580 r13836 1115 1115 1116 1116 size_t i = 0; 1117 while (i < ELEMENTS (mOps))1117 while (i < RT_ELEMENTS (mOps)) 1118 1118 if (mOps [i]) 1119 1119 mOps [i ++]->lock(); … … 1132 1132 AssertReturnVoid (mIsLocked); 1133 1133 1134 AssertReturnVoid ( ELEMENTS (mOps) > 0);1135 size_t i = ELEMENTS (mOps);1134 AssertReturnVoid (RT_ELEMENTS (mOps) > 0); 1135 size_t i = RT_ELEMENTS (mOps); 1136 1136 do 1137 1137 if (mOps [-- i]) … … 1247 1247 { 1248 1248 size_t i = 0; 1249 while (i < ELEMENTS (mLocks))1249 while (i < RT_ELEMENTS (mLocks)) 1250 1250 mLocks [i ++].lock(); 1251 1251 } … … 1257 1257 void unlock() 1258 1258 { 1259 AssertReturnVoid ( ELEMENTS (mLocks) > 0);1260 size_t i = ELEMENTS (mLocks);1259 AssertReturnVoid (RT_ELEMENTS (mLocks) > 0); 1260 size_t i = RT_ELEMENTS (mLocks); 1261 1261 do 1262 1262 mLocks [-- i].unlock(); … … 1270 1270 void leave() 1271 1271 { 1272 AssertReturnVoid ( ELEMENTS (mLocks) > 0);1273 size_t i = ELEMENTS (mLocks);1272 AssertReturnVoid (RT_ELEMENTS (mLocks) > 0); 1273 size_t i = RT_ELEMENTS (mLocks); 1274 1274 do 1275 1275 mLocks [-- i].leave(); … … 1283 1283 void maybeLeave() 1284 1284 { 1285 AssertReturnVoid ( ELEMENTS (mLocks) > 0);1286 size_t i = ELEMENTS (mLocks);1285 AssertReturnVoid (RT_ELEMENTS (mLocks) > 0); 1286 size_t i = RT_ELEMENTS (mLocks); 1287 1287 do 1288 1288 mLocks [-- i].maybeLeave(); … … 1297 1297 { 1298 1298 size_t i = 0; 1299 while (i < ELEMENTS (mLocks))1299 while (i < RT_ELEMENTS (mLocks)) 1300 1300 mLocks [i ++].maybeEnter(); 1301 1301 } … … 1308 1308 { 1309 1309 size_t i = 0; 1310 while (i < ELEMENTS (mLocks))1310 while (i < RT_ELEMENTS (mLocks)) 1311 1311 mLocks [i ++].enter(); 1312 1312 } -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r13580 r13836 609 609 #endif 610 610 }; 611 for (size_t i = 0; i < ELEMENTS (Names); ++ i)611 for (size_t i = 0; i < RT_ELEMENTS (Names); ++ i) 612 612 { 613 613 Bstr src = Names [i]; -
trunk/src/VBox/Main/xml/Settings.cpp
r9703 r13836 202 202 uint16_t mm = 0, dd = 0, hh = 0, mi = 0, ss = 0; 203 203 char buf [256]; 204 if (strlen (aValue) > ELEMENTS (buf) - 1 ||204 if (strlen (aValue) > RT_ELEMENTS (buf) - 1 || 205 205 sscanf (aValue, "%d-%hu-%huT%hu:%hu:%hu%s", 206 206 &yyyy, &mm, &dd, &hh, &mi, &ss, buf) == 7) -
trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp
r13775 r13836 329 329 - sizeof(RTHEAPSIMPLEINTERNAL); 330 330 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++) 332 332 pHeapInt->auAlignment[i] = ~(size_t)0; 333 333 -
trunk/src/VBox/Runtime/common/err/errmsg.cpp
r13083 r13836 78 78 unsigned iFound = ~0; 79 79 unsigned i; 80 for (i = 0; i < ELEMENTS(g_aStatusMsgs); i++)80 for (i = 0; i < RT_ELEMENTS(g_aStatusMsgs); i++) 81 81 { 82 82 if (g_aStatusMsgs[i].iCode == rc) … … 99 99 * Need to use the temporary stuff. 100 100 */ 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)); 102 102 RTStrPrintf(&g_aszUnknownStr[iMsg][0], sizeof(g_aszUnknownStr[iMsg]), "Unknown Status 0x%X", rc); 103 103 return &g_aUnknownMsgs[iMsg]; -
trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
r8245 r13836 736 736 "RTLdrELF: e_shnum: " FMT_ELF_HALF "\n" 737 737 "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, 739 739 pEhdr->e_entry, pEhdr->e_phoff, pEhdr->e_shoff,pEhdr->e_flags, pEhdr->e_ehsize, pEhdr->e_phentsize, 740 740 pEhdr->e_phnum, pEhdr->e_shentsize, pEhdr->e_shnum, pEhdr->e_shstrndx)); -
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r8245 r13836 1076 1076 1077 1077 /* DataDirectory */ 1078 if (pOptHdr->NumberOfRvaAndSizes != ELEMENTS(pOptHdr->DataDirectory))1078 if (pOptHdr->NumberOfRvaAndSizes != RT_ELEMENTS(pOptHdr->DataDirectory)) 1079 1079 { 1080 1080 Log(("rtldrPEOpen: %s: NumberOfRvaAndSizes=%d!!!\n", pszLogName, pOptHdr->NumberOfRvaAndSizes)); 1081 1081 return VERR_BAD_EXE_FORMAT; 1082 1082 } 1083 for (unsigned i = 0; i < ELEMENTS(pOptHdr->DataDirectory); i++)1083 for (unsigned i = 0; i < RT_ELEMENTS(pOptHdr->DataDirectory); i++) 1084 1084 { 1085 1085 IMAGE_DATA_DIRECTORY const *pDir = &pOptHdr->DataDirectory[i]; -
trunk/src/VBox/Runtime/common/log/log.cpp
r13832 r13836 322 322 /* instruction. */ 323 323 unsigned i; 324 for (i = 0; i < ELEMENTS(aDest); i++)324 for (i = 0; i < RT_ELEMENTS(aDest); i++) 325 325 { 326 326 size_t cchInstr = strlen(aDest[i].pszInstr); … … 376 376 } 377 377 /* unknown instruction? */ 378 if (i >= ELEMENTS(aDest))378 if (i >= RT_ELEMENTS(aDest)) 379 379 { 380 380 AssertMsgFailed(("Invalid %s_DEST! unknown instruction %.20s\n", pszEnvVarBase, pszVar)); … … 1174 1174 bool fFound = false; 1175 1175 psz++; 1176 for (i = 0; i < ELEMENTS(aFlags) && !fFound; i++)1176 for (i = 0; i < RT_ELEMENTS(aFlags) && !fFound; i++) 1177 1177 { 1178 1178 const char *psz1 = aFlags[i].pszFlag; … … 1313 1313 1314 1314 /* instruction. */ 1315 for (i = 0; i < ELEMENTS(aDest); i++)1315 for (i = 0; i < RT_ELEMENTS(aDest); i++) 1316 1316 { 1317 1317 if (!strncmp(pszVar, aDest[i].pszInstr, aDest[i].cchInstr)) … … 1327 1327 1328 1328 /* unknown instruction? */ 1329 if (i >= ELEMENTS(aDest))1329 if (i >= RT_ELEMENTS(aDest)) 1330 1330 { 1331 1331 AssertMsgFailed(("Invalid flags! unknown instruction %.20s\n", pszVar)); … … 1412 1412 { 1413 1413 const RTNATIVETHREAD Self = RTThreadNativeSelf(); 1414 int32_t i = ELEMENTS(g_aPerThreadLoggers);1414 int32_t i = RT_ELEMENTS(g_aPerThreadLoggers); 1415 1415 while (i-- > 0) 1416 1416 if (g_aPerThreadLoggers[i].NativeThread == Self) … … 1468 1468 * Iterate the table to see if there is already an entry for this thread. 1469 1469 */ 1470 i = ELEMENTS(g_aPerThreadLoggers);1470 i = RT_ELEMENTS(g_aPerThreadLoggers); 1471 1471 while (i-- > 0) 1472 1472 if (g_aPerThreadLoggers[i].NativeThread == Self) … … 1481 1481 */ 1482 1482 i = ASMAtomicIncS32(&g_cPerThreadLoggers); 1483 if (i > (int32_t) ELEMENTS(g_aPerThreadLoggers))1483 if (i > (int32_t)RT_ELEMENTS(g_aPerThreadLoggers)) 1484 1484 { 1485 1485 ASMAtomicDecS32(&g_cPerThreadLoggers); … … 1489 1489 for (j = 0; j < 10; j++) 1490 1490 { 1491 i = ELEMENTS(g_aPerThreadLoggers);1491 i = RT_ELEMENTS(g_aPerThreadLoggers); 1492 1492 while (i-- > 0) 1493 1493 { … … 1511 1511 * Search the array for the current thread. 1512 1512 */ 1513 int32_t i = ELEMENTS(g_aPerThreadLoggers);1513 int32_t i = RT_ELEMENTS(g_aPerThreadLoggers); 1514 1514 while (i-- > 0) 1515 1515 if ( g_aPerThreadLoggers[i].NativeThread == Self -
trunk/src/VBox/Runtime/common/misc/req.cpp
r11601 r13836 406 406 { 407 407 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); 409 409 410 410 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); 412 412 return; 413 413 } 414 414 pTail = pTail->pNext; 415 415 } 416 vmr3ReqJoinFreeSub(&pQueue->apReqFree[(pQueue->iReqFree + 2) % ELEMENTS(pQueue->apReqFree)], pList);416 vmr3ReqJoinFreeSub(&pQueue->apReqFree[(pQueue->iReqFree + 2) % RT_ELEMENTS(pQueue->apReqFree)], pList); 417 417 } 418 418 … … 448 448 * of mine to avoid locks. 449 449 */ 450 int cTries = ELEMENTS(pQueue->apReqFree) * 2;450 int cTries = RT_ELEMENTS(pQueue->apReqFree) * 2; 451 451 while (--cTries >= 0) 452 452 { 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)]; 454 454 #if 0 /* sad, but this won't work safely because the reading of pReq->pNext. */ 455 455 PRTREQ pNext = NULL; … … 594 594 { 595 595 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)]; 597 597 PRTREQ pNext; 598 598 do -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r11596 r13836 721 721 722 722 /** 723 * Create a new thread. 724 * 723 * Create a new thread. 724 * 725 725 * Same as RTThreadCreate except the name is given in the RTStrPrintfV form. 726 726 * … … 745 745 746 746 /** 747 * Create a new thread. 748 * 747 * Create a new thread. 748 * 749 749 * Same as RTThreadCreate except the name is given in the RTStrPrintf form. 750 750 * … … 1382 1382 if (iEntry && pCur == pThread) 1383 1383 break; 1384 for (unsigned i = 0; i < ELEMENTS(apSeenThreads); i++)1384 for (unsigned i = 0; i < RT_ELEMENTS(apSeenThreads); i++) 1385 1385 if (apSeenThreads[i] == pCur) 1386 1386 { … … 1393 1393 * Advance to the next thread. 1394 1394 */ 1395 iSeenThread = (iSeenThread + 1) % ELEMENTS(apSeenThreads);1395 iSeenThread = (iSeenThread + 1) % RT_ELEMENTS(apSeenThreads); 1396 1396 apSeenThreads[iSeenThread] = pCur; 1397 1397 pCur = pNext; -
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r11413 r13836 271 271 const char *pszType = *ppszFormat - 1; 272 272 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; 275 275 276 276 union … … 765 765 const char *pszType = *ppszFormat - 1; 766 766 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; 769 769 770 770 union -
trunk/src/VBox/Runtime/common/string/uniread.cpp
r8245 r13836 361 361 362 362 RTUNICP CodePoint = ToNum(pszCodePoint); 363 if (CodePoint >= ELEMENTS(g_aCPInfo))363 if (CodePoint >= RT_ELEMENTS(g_aCPInfo)) 364 364 continue; 365 365 … … 394 394 } 395 395 /* catchup? */ 396 while (i < ELEMENTS(g_aCPInfo))396 while (i < RT_ELEMENTS(g_aCPInfo)) 397 397 NullEntry(i++); 398 398 fclose(pFile); … … 410 410 static void ApplyProperty(RTUNICP StartCP, const char *pszProperty) 411 411 { 412 if (StartCP >= ELEMENTS(g_aCPInfo))412 if (StartCP >= RT_ELEMENTS(g_aCPInfo)) 413 413 return; 414 414 struct CPINFO *pCPInfo = &g_aCPInfo[StartCP]; … … 649 649 RTUNICP i = 0; 650 650 int iStart = -1; 651 while (i < ELEMENTS(g_aCPInfo))651 while (i < RT_ELEMENTS(g_aCPInfo)) 652 652 { 653 653 /* figure how far off the next chunk is */ … … 655 655 unsigned iNonNull = i; 656 656 while ( (g_aCPInfo[iNonNull].fNullEntry || !CalcFlags(&g_aCPInfo[iNonNull], szFlags)) 657 && iNonNull < ELEMENTS(g_aCPInfo)657 && iNonNull < RT_ELEMENTS(g_aCPInfo) 658 658 && iNonNull >= 256) 659 659 iNonNull++; 660 if (iNonNull - i > 4096 || iNonNull == ELEMENTS(g_aCPInfo))660 if (iNonNull - i > 4096 || iNonNull == RT_ELEMENTS(g_aCPInfo)) 661 661 { 662 662 if (iStart >= 0) … … 698 698 RTUNICP i = 0; 699 699 int iStart = -1; 700 while (i < ELEMENTS(g_aCPInfo))700 while (i < RT_ELEMENTS(g_aCPInfo)) 701 701 { 702 702 /* figure how far off the next chunk is */ 703 703 unsigned iSameCase = i; 704 704 while ( g_aCPInfo[iSameCase].SimpleUpperCaseMapping == g_aCPInfo[iSameCase].CodePoint 705 && iSameCase < ELEMENTS(g_aCPInfo)705 && iSameCase < RT_ELEMENTS(g_aCPInfo) 706 706 && iSameCase >= 256) 707 707 iSameCase++; 708 if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == ELEMENTS(g_aCPInfo))708 if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == RT_ELEMENTS(g_aCPInfo)) 709 709 { 710 710 if (iStart >= 0) … … 745 745 RTUNICP i = 0; 746 746 int iStart = -1; 747 while (i < ELEMENTS(g_aCPInfo))747 while (i < RT_ELEMENTS(g_aCPInfo)) 748 748 { 749 749 /* figure how far off the next chunk is */ 750 750 unsigned iSameCase = i; 751 751 while ( g_aCPInfo[iSameCase].SimpleLowerCaseMapping == g_aCPInfo[iSameCase].CodePoint 752 && iSameCase < ELEMENTS(g_aCPInfo)752 && iSameCase < RT_ELEMENTS(g_aCPInfo) 753 753 && iSameCase >= 256) 754 754 iSameCase++; 755 if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == ELEMENTS(g_aCPInfo))755 if (iSameCase - i > 4096/sizeof(RTUNICP) || iSameCase == RT_ELEMENTS(g_aCPInfo)) 756 756 { 757 757 if (iStart >= 0) -
trunk/src/VBox/Runtime/generic/semsrw-generic.cpp
r12892 r13836 302 302 if (pIntRWSem->cWriters == 0) 303 303 { 304 if (pIntRWSem->cReaders < ELEMENTS(pIntRWSem->aReaders))304 if (pIntRWSem->cReaders < RT_ELEMENTS(pIntRWSem->aReaders)) 305 305 { 306 306 /* -
trunk/src/VBox/Runtime/r3/alloc-ef.cpp
r13306 r13836 366 366 * Check watch points. 367 367 */ 368 for (unsigned i = 0; i < ELEMENTS(gapvRTMemFreeWatch); i++)368 for (unsigned i = 0; i < RT_ELEMENTS(gapvRTMemFreeWatch); i++) 369 369 if (gapvRTMemFreeWatch[i] == pv) 370 370 RTAssertDoPanic(); -
trunk/src/VBox/Runtime/r3/darwin/mp-darwin.cpp
r11810 r13836 62 62 int cCpus = -1; 63 63 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); 65 65 if (rc != -1 && cCpus >= 1) 66 66 return cCpus; … … 191 191 int cCpus = -1; 192 192 cb = sizeof(cCpus); 193 rc = sysctl(aiMib, ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);193 rc = sysctl(aiMib, RT_ELEMENTS(aiMib), &cCpus, &cb, NULL, 0); 194 194 if (rc != -1 && cCpus >= 1) 195 195 return cCpus; -
trunk/src/VBox/Runtime/r3/linux/sched-linux.cpp
r8245 r13836 566 566 */ 567 567 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++) 569 569 { 570 570 if (g_aUnixConfigs[i].enmPriority == enmPriority) -
trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp
r8245 r13836 666 666 case OSPRIOSUP_PROCESS_AND_THREAD_LEVEL: 667 667 pa = g_aProcessAndThread; 668 c = ELEMENTS(g_aProcessAndThread);668 c = RT_ELEMENTS(g_aProcessAndThread); 669 669 break; 670 670 case OSPRIOSUP_THREAD_LEVEL: 671 671 pa = g_aUnixConfigs; 672 c = ELEMENTS(g_aUnixConfigs);672 c = RT_ELEMENTS(g_aUnixConfigs); 673 673 break; 674 674 default: -
trunk/src/VBox/Runtime/r3/win/path-win.cpp
r13104 r13836 68 68 LPWSTR lpFile; 69 69 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)) 72 72 { 73 73 /* Check that it exists. (Use RTPathAbs() to just resolve the name.) */ -
trunk/src/VBox/Runtime/testcase/tstAvl.cpp
r8245 r13836 851 851 s1.aNode[3].Key = 0xfffe0000; 852 852 s1.aNode[3].KeyLast = 0xfffe0ffe; 853 for (i = 0; i < ELEMENTS(s1.aNode); i++)853 for (i = 0; i < RT_ELEMENTS(s1.aNode); i++) 854 854 { 855 855 PAVLROGCPHYSNODECORE pNode = &s1.aNode[i]; … … 893 893 s3 = s1; 894 894 s1 = s2; 895 for (i = 0; i < ELEMENTS(s3.aNode); i++)895 for (i = 0; i < RT_ELEMENTS(s3.aNode); i++) 896 896 { 897 897 PAVLROGCPHYSNODECORE pNode = &s3.aNode[i]; -
trunk/src/VBox/Runtime/testcase/tstErrUnique.cpp
r8729 r13836 70 70 RTPrintf("tstErrUnique: TESTING\n"); 71 71 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++) 73 73 { 74 74 if (strIsPermissibleDuplicate(&g_aErrorMessages[i])) 75 75 continue; 76 76 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++) 78 78 { 79 79 if (strIsPermissibleDuplicate(&g_aErrorMessages[j])) -
trunk/src/VBox/Runtime/testcase/tstHeapSimple.cpp
r8245 r13836 106 106 107 107 /* allocate */ 108 for (i = 0; i < ELEMENTS(aOps); i++)108 for (i = 0; i < RT_ELEMENTS(aOps); i++) 109 109 { 110 110 aOps[i].pvAlloc = RTHeapSimpleAlloc(Heap, aOps[i].cb, aOps[i].uAlignment); … … 123 123 124 124 /* free and allocate the same node again. */ 125 for (i = 0; i < ELEMENTS(aOps); i++)125 for (i = 0; i < RT_ELEMENTS(aOps); i++) 126 126 { 127 127 if (!aOps[i].pvAlloc) … … 156 156 /* free it in a specific order. */ 157 157 int cFreed = 0; 158 for (i = 0; i < ELEMENTS(aOps); i++)158 for (i = 0; i < RT_ELEMENTS(aOps); i++) 159 159 { 160 160 unsigned j; 161 for (j = 0; j < ELEMENTS(aOps); j++)161 for (j = 0; j < RT_ELEMENTS(aOps); j++) 162 162 { 163 163 if ( aOps[j].iFreeOrder != i -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r8245 r13836 110 110 * Load them. 111 111 */ 112 for (i = 0; i < ELEMENTS(aLoads); i++)112 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 113 113 { 114 114 if (!strncmp(aLoads[i].pszName, "kLdr-", sizeof("kLdr-") - 1)) … … 158 158 if (!cErrors) 159 159 { 160 for (i = 0; i < ELEMENTS(aLoads); i += 1)160 for (i = 0; i < RT_ELEMENTS(aLoads); i += 1) 161 161 { 162 162 /* get the pointer. */ … … 188 188 * Clean up. 189 189 */ 190 for (i = 0; i < ELEMENTS(aLoads); i++)190 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 191 191 { 192 192 if (aLoads[i].pvBits) -
trunk/src/VBox/Runtime/testcase/tstLdr.cpp
r8245 r13836 102 102 * Load them. 103 103 */ 104 for (i = 0; i < ELEMENTS(aLoads); i++)104 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 105 105 { 106 106 int rc; … … 185 185 { 186 186 /* 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++) 188 188 { 189 for (unsigned j = i + 1; j < ELEMENTS(aLoads); j++)189 for (unsigned j = i + 1; j < RT_ELEMENTS(aLoads); j++) 190 190 { 191 191 if (aLoads[j].Addr == aLoads[i].Addr) … … 206 206 207 207 /* compare symbols. */ 208 for (i = 0; i < ELEMENTS(aLoads); i++)208 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 209 209 { 210 for (unsigned iSym = 0; iSym < ELEMENTS(aSyms); iSym++)210 for (unsigned iSym = 0; iSym < RT_ELEMENTS(aSyms); iSym++) 211 211 { 212 212 RTUINTPTR Value; … … 241 241 } 242 242 243 if (iRel >= ELEMENTS(aRels))243 if (iRel >= RT_ELEMENTS(aRels)) 244 244 break; 245 245 … … 263 263 * Clean up. 264 264 */ 265 for (i = 0; i < ELEMENTS(aLoads); i++)265 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 266 266 { 267 267 if (aLoads[i].pvBits) -
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r11836 r13836 78 78 cErrors++; 79 79 } 80 80 81 81 82 82 /* … … 122 122 }; 123 123 124 for (unsigned i = 0; i < ELEMENTS(aInput); i += 2)124 for (unsigned i = 0; i < RT_ELEMENTS(aInput); i += 2) 125 125 { 126 126 RTPrintf("tstPath: base={%s}, path={%s}, ", aInput[i], aInput[i + 1]); -
trunk/src/VBox/Runtime/testcase/tstStrToNum.cpp
r8279 r13836 87 87 do \ 88 88 { \ 89 for (unsigned iTest = 0; iTest < ELEMENTS(aTests); iTest++) \89 for (unsigned iTest = 0; iTest < RT_ELEMENTS(aTests); iTest++) \ 90 90 { \ 91 91 TEST(aTests[iTest], Type, Fmt, Fun, iTest); \ -
trunk/src/VBox/Runtime/testcase/tstTimer.cpp
r10948 r13836 135 135 136 136 unsigned i = 0; 137 for (i = 0; i < ELEMENTS(aTests); i++)137 for (i = 0; i < RT_ELEMENTS(aTests); i++) 138 138 { 139 139 aTests[i].cLower = (aTests[i].uMilliesWait - aTests[i].uMilliesWait / 10) / aTests[i].uMilliesInterval; -
trunk/src/VBox/Runtime/testcase/tstTimerLR.cpp
r10944 r13836 132 132 133 133 unsigned i = 0; 134 for (i = 0; i < ELEMENTS(aTests); i++)134 for (i = 0; i < RT_ELEMENTS(aTests); i++) 135 135 { 136 136 //aTests[i].cLower = (aTests[i].uMilliesWait - aTests[i].uMilliesWait / 10) / aTests[i].uMilliesInterval; -
trunk/src/VBox/Runtime/testcase/tstUtf8.cpp
r12912 r13836 400 400 g_uszAll[i++] = uc++; 401 401 g_uszAll[i++] = 0; 402 Assert( ELEMENTS(g_uszAll) == i);402 Assert(RT_ELEMENTS(g_uszAll) == i); 403 403 404 404 /* the utf-16 one */ … … 422 422 //RTPrintf(" %#x=%#x\n", i, uc); 423 423 g_wszAll[i++] = '\0'; 424 Assert( ELEMENTS(g_wszAll) == i);424 Assert(RT_ELEMENTS(g_wszAll) == i); 425 425 426 426 /* … … 472 472 //RTPrintf(" %#x=%#x\n", i, uc); 473 473 g_szAll[i++] = '\0'; 474 Assert( ELEMENTS(g_szAll) == i);474 Assert(RT_ELEMENTS(g_szAll) == i); 475 475 } 476 476 … … 571 571 572 572 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); 574 574 if (rc == VINF_SUCCESS) 575 575 { 576 if (cCps != ELEMENTS(g_uszAll) - 1)576 if (cCps != RT_ELEMENTS(g_uszAll) - 1) 577 577 { 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); 579 579 g_cErrors++; 580 580 } … … 866 866 867 867 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); 869 869 if (RT_SUCCESS(rc)) 870 870 { … … 873 873 for (i = 0; i < 100; i++) 874 874 { 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); 876 876 if (RT_FAILURE(rc)) 877 877 { … … 885 885 886 886 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); 888 888 if (RT_SUCCESS(rc)) 889 889 { … … 892 892 for (i = 0; i < 100; i++) 893 893 { 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); 895 895 if (RT_FAILURE(rc)) 896 896 { -
trunk/src/recompiler/VBoxRecompiler.c
r13835 r13836 203 203 .cArgsMax = 1, 204 204 .paArgDescs = &g_aArgRemStep[0], 205 .cArgDescs = ELEMENTS(g_aArgRemStep),205 .cArgDescs = RT_ELEMENTS(g_aArgRemStep), 206 206 .pResultDesc = NULL, 207 207 .fFlags = 0, … … 335 335 if (!fRegisteredCmds) 336 336 { 337 int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));337 int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds)); 338 338 if (RT_SUCCESS(rc)) 339 339 fRegisteredCmds = true; … … 547 547 if (RT_FAILURE(rc)) 548 548 return rc; 549 if (pRem->cInvalidatedPages > ELEMENTS(pRem->aGCPtrInvalidatedPages))549 if (pRem->cInvalidatedPages > RT_ELEMENTS(pRem->aGCPtrInvalidatedPages)) 550 550 { 551 551 AssertMsgFailed(("cInvalidatedPages=%#x\n", pRem->cInvalidatedPages)); … … 4643 4643 { 4644 4644 default: 4645 if (uEAX < ELEMENTS(apsz))4645 if (uEAX < RT_ELEMENTS(apsz)) 4646 4646 Log(("REM: linux syscall %3d: %s (eip=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x ebp=%08x)\n", 4647 4647 uEAX, apsz[uEAX], CPUMGetGuestEIP(pVM), CPUMGetGuestEBX(pVM), CPUMGetGuestECX(pVM), … … 4972 4972 { 4973 4973 default: 4974 if (uEAX < ELEMENTS(apsz))4974 if (uEAX < RT_ELEMENTS(apsz)) 4975 4975 { 4976 4976 uint32_t au32Args[8] = {0}; -
trunk/src/recompiler_new/VBoxRecompiler.c
r13835 r13836 202 202 .cArgsMax = 1, 203 203 .paArgDescs = &g_aArgRemStep[0], 204 .cArgDescs = ELEMENTS(g_aArgRemStep),204 .cArgDescs = RT_ELEMENTS(g_aArgRemStep), 205 205 .pResultDesc = NULL, 206 206 .fFlags = 0, … … 325 325 if (!fRegisteredCmds) 326 326 { 327 int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));327 int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds)); 328 328 if (RT_SUCCESS(rc)) 329 329 fRegisteredCmds = true; … … 536 536 if (RT_FAILURE(rc)) 537 537 return rc; 538 if (pRem->cInvalidatedPages > ELEMENTS(pRem->aGCPtrInvalidatedPages))538 if (pRem->cInvalidatedPages > RT_ELEMENTS(pRem->aGCPtrInvalidatedPages)) 539 539 { 540 540 AssertMsgFailed(("cInvalidatedPages=%#x\n", pRem->cInvalidatedPages)); … … 4725 4725 { 4726 4726 default: 4727 if (uEAX < ELEMENTS(apsz))4727 if (uEAX < RT_ELEMENTS(apsz)) 4728 4728 Log(("REM: linux syscall %3d: %s (eip=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x ebp=%08x)\n", 4729 4729 uEAX, apsz[uEAX], CPUMGetGuestEIP(pVM), CPUMGetGuestEBX(pVM), CPUMGetGuestECX(pVM), … … 5054 5054 { 5055 5055 default: 5056 if (uEAX < ELEMENTS(apsz))5056 if (uEAX < RT_ELEMENTS(apsz)) 5057 5057 { 5058 5058 uint32_t au32Args[8] = {0}; -
trunk/src/testcase/tstRunTestcases.cpp
r11822 r13836 113 113 { 114 114 RTPathStripExt(pszDup); 115 for (unsigned i = 0; i < ELEMENTS(g_apszExclude); i++)115 for (unsigned i = 0; i < RT_ELEMENTS(g_apszExclude); i++) 116 116 { 117 117 if (!strcmp(g_apszExclude[i], pszDup))
Note:
See TracChangeset
for help on using the changeset viewer.