Changeset 2962 in kBuild
- Timestamp:
- Sep 22, 2016 11:30:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kWorker/kWorker.c
r2961 r2962 7207 7207 { 7208 7208 /* Need to grow the line buffer? */ 7209 KU32 cwcNeeded = offLastIncompleteLine != 0 ? offLastIncompleteLine : cchLastIncompleteLine + pLineBuf->u.Con.cwcBuf; 7209 KU32 cwcNeeded = offLastIncompleteLine == 0 7210 ? pLineBuf->u.Con.cwcBuf + cchLastIncompleteLine /* incomplete line, append to line buffer */ 7211 : cchLastIncompleteLine; /* Only the final incomplete line (if any) goes to the line buffer. */ 7210 7212 if (cwcNeeded > pLineBuf->u.Con.cwcBufAlloc) 7211 7213 { … … 7255 7257 7256 7258 /* 7257 * If there is sufficient combined buffer to handle this request, this arerather simple.7259 * If there is sufficient combined buffer to handle this request, this is rather simple. 7258 7260 */ 7259 if (pLineBuf->u.Con.cwcBuf + cchLastIncompleteLine <= K_ELEMENTS(pSandbox->Combined.wszBuf)) 7261 kHlpAssert(pSandbox->Combined.cwcBuf <= K_ELEMENTS(pSandbox->Combined.wszBuf)); 7262 if (pSandbox->Combined.cwcBuf + pLineBuf->u.Con.cwcBuf + offLastIncompleteLine <= K_ELEMENTS(pSandbox->Combined.wszBuf)) 7260 7263 { 7261 7264 if (pLineBuf->u.Con.cwcBuf > 0) … … 7280 7283 KU32 offNextLine = 0; 7281 7284 7282 /* If there isbuffered chars, we handle the first line outside the7285 /* If there are buffered chars, we handle the first line outside the 7283 7286 main loop. We must try our best outputting it as a complete line. */ 7284 7287 if (pLineBuf->u.Con.cwcBuf > 0) … … 7289 7292 kHlpAssert(offNextLine <= offLastIncompleteLine); 7290 7293 7291 if (p LineBuf->u.Con.cwcBuf + offNextLine + pSandbox->Combined.cwcBuf<= K_ELEMENTS(pSandbox->Combined.wszBuf))7294 if (pSandbox->Combined.cwcBuf + pLineBuf->u.Con.cwcBuf + offNextLine <= K_ELEMENTS(pSandbox->Combined.wszBuf)) 7292 7295 { 7293 7296 kHlpMemCopy(&pSandbox->Combined.wszBuf[pSandbox->Combined.cwcBuf], … … 7336 7339 * Buffer any remaining incomplete line chars. 7337 7340 */ 7338 if ( offLastIncompleteLine < cwcToWrite)7341 if (cchLastIncompleteLine) 7339 7342 { 7340 7343 kHlpMemCopy(&pLineBuf->u.Con.pwcBuf[0], &pwcBuffer[offLastIncompleteLine], cchLastIncompleteLine * sizeof(wchar_t));
Note:
See TracChangeset
for help on using the changeset viewer.