儲存庫 vbox 的更動 37210
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/iprt/circbuf.h
r37208 r37210 42 42 RT_C_DECLS_BEGIN 43 43 44 /** @todo r=bird: this is missing docs and magic. uXPos should be offX. 45 * cbBufSize should be cbBuf. */ 46 typedef struct RTCIRCBUF 47 { 48 /** The current read position in the buffer. */ 49 size_t uReadPos; 50 /** The current write position in the buffer. */ 51 size_t uWritePos; 52 /** How much space of the buffer is currently in use. */ 53 volatile size_t cbBufUsed; 54 /** How big is the buffer. */ 55 size_t cbBufSize; 56 /** The buffer itself. */ 57 void *pvBuf; 58 } RTCIRCBUF; 59 /* Pointer to a circular buffer structure */ 60 typedef RTCIRCBUF* PRTCIRCBUF; 44 /** Pointer to a circular buffer (abstract). */ 45 typedef struct RTCIRCBUF *PRTCIRCBUF; 61 46 62 47 /** -
trunk/src/VBox/Runtime/common/misc/circbuf.cpp
r37209 r37210 36 36 37 37 38 /******************************************************************************* 39 * Structures and Typedefs * 40 *******************************************************************************/ 41 /** @todo r=bird: this is missing docs and magic. uXPos should be offX. 42 * cbBufSize should be cbBuf. */ 43 typedef struct RTCIRCBUF 44 { 45 /** The current read position in the buffer. */ 46 size_t uReadPos; 47 /** The current write position in the buffer. */ 48 size_t uWritePos; 49 /** How much space of the buffer is currently in use. */ 50 volatile size_t cbBufUsed; 51 /** How big is the buffer. */ 52 size_t cbBufSize; 53 /** The buffer itself. */ 54 void *pvBuf; 55 } RTCIRCBUF; 56 57 58 38 59 RTDECL(int) RTCircBufCreate(PRTCIRCBUF *ppBuf, size_t cbSize) 39 60 { -
trunk/src/VBox/Runtime/testcase/tstRTCircBuf.cpp
r33286 r37210 30 30 #include <iprt/circbuf.h> 31 31 32 #include <iprt/err.h> 32 33 #include <iprt/string.h> 33 #include <iprt/err.h>34 34 #include <iprt/test.h> 35 35 … … 40 40 static void tst1(void) 41 41 { 42 void *pvBuf = NULL;43 size_t cbSize = 0;42 void *pvBuf; 43 size_t cbSize; 44 44 45 45 char pcTestPattern1[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9 }; … … 62 62 RTTESTI_CHECK(RTCircBufFree(pBuf) == 0); 63 63 RTTESTI_CHECK(RTCircBufUsed(pBuf) == 10); 64 RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern1, 10) == 0); /* Check the internal state */64 // RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern1, 10) == 0); /* Check the internal state */ 65 65 66 66 /* Half read */ … … 81 81 RTTESTI_CHECK(RTCircBufFree(pBuf) == 3); 82 82 RTTESTI_CHECK(RTCircBufUsed(pBuf) == 7); 83 RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern2, 10) == 0); /* Check the internal state */83 // RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern2, 10) == 0); /* Check the internal state */ 84 84 85 85 /* Split tests */ … … 113 113 RTTESTI_CHECK(RTCircBufFree(pBuf) == 0); 114 114 RTTESTI_CHECK(RTCircBufUsed(pBuf) == 10); 115 RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern3, 10) == 0); /* Check the internal state */115 // RTTESTI_CHECK(memcmp(pBuf->pvBuf, pcTestPattern3, 10) == 0); /* Check the internal state */ 116 116 117 117 /* Destroy */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器