build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41963 )
Change subject: lib: Upgrade LZMA Decoder to version 19.0 ......................................................................
Patch Set 5:
(77 comments)
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.h File src/lib/lzmadecode.h:
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.h@25 PS5, Line 25: #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } Macros with flow control statements should be avoided
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.h@143 PS5, Line 143: finished without end mark */ line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c File src/lib/lzmadecode.c:
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@18 PS5, Line 18: #define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@20 PS5, Line 20: #define IF_BIT_0(p) ttt = *(p); NORMALIZE; \ Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@21 PS5, Line 21: bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@22 PS5, Line 22: #define UPDATE_0(p) range = bound; \ Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@22 PS5, Line 22: #define UPDATE_0(p) range = bound; \ macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@24 PS5, Line 24: #define UPDATE_1(p) range -= bound; code -= bound; \ Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@24 PS5, Line 24: #define UPDATE_1(p) range -= bound; code -= bound; \ macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@26 PS5, Line 26: #define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ Macros with complex values should be enclosed in parentheses
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@27 PS5, Line 27: {UPDATE_0(p); i = (i + i); A0; } else \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@28 PS5, Line 28: {UPDATE_1(p); i = (i + i) + 1; A1; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@32 PS5, Line 32: #define REV_BIT(p, i, A0, A1) IF_BIT_0(p + i) \ Macros with complex values should be enclosed in parentheses
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@33 PS5, Line 33: {UPDATE_0(p + i); A0; } else \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@34 PS5, Line 34: {UPDATE_1(p + i); A1; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@36 PS5, Line 36: #define REV_BIT_CONST(p, i, m) REV_BIT(p, i, i += m;, i += m * 2;) space required after that ';' (ctx:VxO)
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@40 PS5, Line 40: {i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@43 PS5, Line 43: {i = 1; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@44 PS5, Line 44: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@45 PS5, Line 45: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@46 PS5, Line 46: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@47 PS5, Line 47: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@48 PS5, Line 48: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@49 PS5, Line 49: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@50 PS5, Line 50: i -= 0x40; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@54 PS5, Line 54: matchByte += matchByte; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@55 PS5, Line 55: bit = offs; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@56 PS5, Line 56: offs &= matchByte; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@57 PS5, Line 57: probLit = prob + (offs + bit + symbol); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@58 PS5, Line 58: GET_BIT2(probLit, symbol, offs ^= bit;, ;) please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@58 PS5, Line 58: GET_BIT2(probLit, symbol, offs ^= bit;, ;) space required after that ';' (ctx:VxO)
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@60 PS5, Line 60: #define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; \ Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@60 PS5, Line 60: #define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; \ Macros with flow control statements should be avoided
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@63 PS5, Line 63: #define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; \ Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@64 PS5, Line 64: bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@65 PS5, Line 65: #define UPDATE_0_CHECK range = bound; Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@65 PS5, Line 65: #define UPDATE_0_CHECK range = bound; macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@66 PS5, Line 66: #define UPDATE_1_CHECK range -= bound; code -= bound; Macros with multiple statements should be enclosed in a do - while loop
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@66 PS5, Line 66: #define UPDATE_1_CHECK range -= bound; code -= bound; macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@67 PS5, Line 67: #define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ Macros with complex values should be enclosed in parentheses
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@68 PS5, Line 68: {UPDATE_0_CHECK; i = (i + i); A0; } else \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@69 PS5, Line 69: {UPDATE_1_CHECK; i = (i + i) + 1; A1; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@72 PS5, Line 72: {i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@75 PS5, Line 75: #define REV_BIT_CHECK(p, i, m) IF_BIT_0_CHECK(p + i) \ Macros with complex values should be enclosed in parentheses
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@76 PS5, Line 76: {UPDATE_0_CHECK; i += m; m += m; } else \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@77 PS5, Line 77: {UPDATE_1_CHECK; m += m; i += m; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@92 PS5, Line 92: unsigned int pbMask = ((unsigned int)1 << (p->prop.pb)) - 1; Unnecessary typecast of c90 int constant
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@94 PS5, Line 94: unsigned int lpMask = ((unsigned int)0x100 << p->prop.lp) - ((unsigned int)0x100 >> lc); Unnecessary typecast of c90 int constant
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@122 PS5, Line 122: dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@180 PS5, Line 180: dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@202 PS5, Line 202: } else { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@232 PS5, Line 232: probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@240 PS5, Line 240: TREE_DECODE(probLen, (1 << kLenNumHighBits), len); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@249 PS5, Line 249: len : kNumLenToPosStates - 1) << kNumPosSlotBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@253 PS5, Line 253: unsigned int numDirectBits = (unsigned int)(((distance >> 1) - 1)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@261 PS5, Line 261: do { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@263 PS5, Line 263: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@268 PS5, Line 268: do { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@274 PS5, Line 274: t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@275 PS5, Line 275: distance = (distance << 1) + (t + 1); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@286 PS5, Line 286: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@297 PS5, Line 297: if (distance == (UInt32)0xFFFFFFFF) { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@310 PS5, Line 310: if (distance >= (checkDicSize == 0 ? processedPos : checkDicSize)) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@344 PS5, Line 344: if (++pos == dicBufSize) Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@458 PS5, Line 458: ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@460 PS5, Line 460: p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@464 PS5, Line 464: do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@477 PS5, Line 477: GET_BIT2_CHECK(probLit, symbol, offs ^= bit; , ;) space prohibited before that ',' (ctx:WxW)
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@543 PS5, Line 543: probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@560 PS5, Line 560: ((len < kNumLenToPosStates - 1 ? len : kNumLenToPosStates - 1) << line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@569 PS5, Line 569: prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@575 PS5, Line 575: code -= range & (((code - range) >> 31) - 1); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@577 PS5, Line 577: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@586 PS5, Line 586: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@658 PS5, Line 658: while (p->remainLen != kMatchSpecLenStart) { suspect code indent for conditional statements (8, 24)
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@709 PS5, Line 709: int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, (SizeT)rem); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/5/src/lib/lzmadecode.c@752 PS5, Line 752: else else is not generally useful after a break or return