Changeset 26824 in vbox for trunk/src/VBox/Runtime/r3/posix/poll-posix.cpp
- Timestamp:
- Feb 26, 2010 10:36:08 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/poll-posix.cpp
r26805 r26824 41 41 #include <iprt/mem.h> 42 42 #include <iprt/pipe.h> 43 #include <iprt/string.h> 43 44 #include <iprt/thread.h> 44 45 #include <iprt/time.h> … … 234 235 RTDECL(int) RTPollSetCreate(PRTPOLLSET phPollSet) 235 236 { 236 AssertPtr (phPollSet);237 AssertPtrReturn(phPollSet, VERR_INVALID_POINTER); 237 238 RTPOLLSETINTERNAL *pThis = (RTPOLLSETINTERNAL *)RTMemAlloc(sizeof(RTPOLLSETINTERNAL)); 238 239 if (!pThis) … … 279 280 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 280 281 AssertReturn(pThis->u32Magic == RTPOLLSET_MAGIC, VERR_INVALID_HANDLE); 281 AssertReturn(!(fEvents & (RTPOLL_EVT_VALID_MASK)), VERR_INVALID_PARAMETER);282 AssertReturn(!(fEvents & ~RTPOLL_EVT_VALID_MASK), VERR_INVALID_PARAMETER); 282 283 AssertReturn(fEvents, VERR_INVALID_PARAMETER); 283 284 AssertReturn(id != UINT32_MAX, VERR_INVALID_PARAMETER); … … 413 414 { 414 415 pThis->cHandles--; 415 if (i != pThis->cHandles) 416 { 417 pThis->paHandles[i] = pThis->paHandles[pThis->cHandles]; 418 pThis->paPollFds[i] = pThis->paPollFds[pThis->cHandles]; 416 size_t const cToMove = pThis->cHandles - i; 417 if (cToMove) 418 { 419 memmove(&pThis->paHandles[i], &pThis->paHandles[i + 1], cToMove * sizeof(pThis->paHandles[i])); 420 memmove(&pThis->paPollFds[i], &pThis->paPollFds[i + 1], cToMove * sizeof(pThis->paPollFds[i])); 419 421 } 420 422 rc = VINF_SUCCESS; … … 436 438 AssertReturn(pThis->u32Magic == RTPOLLSET_MAGIC, VERR_INVALID_HANDLE); 437 439 AssertReturn(id != UINT32_MAX, VERR_INVALID_PARAMETER); 438 AssertPtr Return(pHandle, VERR_INVALID_POINTER);440 AssertPtrNullReturn(pHandle, VERR_INVALID_POINTER); 439 441 440 442 /*
Note:
See TracChangeset
for help on using the changeset viewer.