Changeset 13836
- Timestamp:
- 11/05/08 03:42:54 (2 months ago)
- Files:
-
- trunk/include/iprt/cdefs.h (modified) (1 diff)
- trunk/src/VBox/Additions/WINNT/Graphics/Display/drv.c (modified) (4 diffs)
- trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdp.c (modified) (5 diffs)
- trunk/src/VBox/Additions/WINNT/Graphics/Display/vrdpbmp.c (modified) (2 diffs)
- trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp (modified) (17 diffs)
- trunk/src/VBox/Additions/common/VBoxGuestLib/HGCM.cpp (modified) (1 diff)
- trunk/src/VBox/Devices/Storage/testcase/vditool.cpp (modified) (1 diff)
- trunk/src/VBox/Disassembler/DisasmCore.cpp (modified) (2 diffs)
- trunk/src/VBox/Disassembler/DisasmReg.cpp (modified) (15 diffs)
- trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp (modified) (1 diff)
- trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp (modified) (7 diffs)
- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h (modified) (5 diffs)
- trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp (modified) (7 diffs)
- trunk/src/VBox/HostDrivers/Support/SUPDrv.c (modified) (1 diff)
- trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp (modified) (3 diffs)
- trunk/src/VBox/Main/ConsoleImpl.cpp (modified) (2 diffs)
- trunk/src/VBox/Main/ConsoleVRDPServer.cpp (modified) (2 diffs)
- trunk/src/VBox/Main/MachineImpl.cpp (modified) (36 diffs)
- trunk/src/VBox/Main/VirtualBoxImpl.cpp (modified) (1 diff)
- trunk/src/VBox/Main/include/AutoLock.h (modified) (8 diffs)
- trunk/src/VBox/Main/testcase/tstAPI.cpp (modified) (1 diff)
- trunk/src/VBox/Main/xml/Settings.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/common/err/errmsg.cpp (modified) (2 diffs)
- trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h (modified) (1 diff)
- trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/common/log/log.cpp (modified) (10 diffs)
- trunk/src/VBox/Runtime/common/misc/req.cpp (modified) (3 diffs)
- trunk/src/VBox/Runtime/common/misc/thread.cpp (modified) (4 diffs)
- trunk/src/VBox/Runtime/common/string/strformatrt.cpp (modified) (2 diffs)
- trunk/src/VBox/Runtime/common/string/uniread.cpp (modified) (7 diffs)
- trunk/src/VBox/Runtime/generic/semsrw-generic.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/r3/alloc-ef.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/r3/darwin/mp-darwin.cpp (modified) (2 diffs)
- trunk/src/VBox/Runtime/r3/linux/sched-linux.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/r3/win/path-win.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/testcase/tstAvl.cpp (modified) (2 diffs)
- trunk/src/VBox/Runtime/testcase/tstErrUnique.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/testcase/tstHeapSimple.cpp (modified) (3 diffs)
- trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp (modified) (3 diffs)
- trunk/src/VBox/Runtime/testcase/tstLdr.cpp (modified) (5 diffs)
- trunk/src/VBox/Runtime/testcase/tstPath.cpp (modified) (2 diffs)
- trunk/src/VBox/Runtime/testcase/tstStrToNum.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/testcase/tstTimer.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/testcase/tstTimerLR.cpp (modified) (1 diff)
- trunk/src/VBox/Runtime/testcase/tstUtf8.cpp (modified) (8 diffs)
- trunk/src/recompiler/VBoxRecompiler.c (modified) (5 diffs)
- trunk/src/recompiler_new/VBoxRecompiler.c (modified) (5 diffs)
- trunk/src/testcase/tstRunTestcases.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
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

