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 4:
(83 comments)
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.h File src/lib/lzmadecode.h:
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.h@25 PS4, 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/4/src/lib/lzmadecode.h@142 PS4, Line 142: LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.h@143 PS4, Line 143: finished without end mark */ line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c File src/lib/lzmadecode.c:
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@18 PS4, 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/4/src/lib/lzmadecode.c@20 PS4, 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/4/src/lib/lzmadecode.c@21 PS4, Line 21: bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@22 PS4, 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/4/src/lib/lzmadecode.c@22 PS4, Line 22: #define UPDATE_0(p) range = bound; \ macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@24 PS4, 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/4/src/lib/lzmadecode.c@24 PS4, Line 24: #define UPDATE_1(p) range -= bound; code -= bound; \ macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@26 PS4, 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/4/src/lib/lzmadecode.c@27 PS4, 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/4/src/lib/lzmadecode.c@28 PS4, 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/4/src/lib/lzmadecode.c@32 PS4, 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/4/src/lib/lzmadecode.c@33 PS4, Line 33: {UPDATE_0(p + i); A0; } else \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@34 PS4, Line 34: {UPDATE_1(p + i); A1; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@36 PS4, 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/4/src/lib/lzmadecode.c@40 PS4, 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/4/src/lib/lzmadecode.c@43 PS4, Line 43: {i = 1; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@44 PS4, Line 44: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@45 PS4, Line 45: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@46 PS4, Line 46: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@47 PS4, Line 47: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@48 PS4, Line 48: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@49 PS4, Line 49: TREE_GET_BIT(probs, i); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@50 PS4, Line 50: i -= 0x40; } please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@54 PS4, Line 54: matchByte += matchByte; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@55 PS4, Line 55: bit = offs; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@56 PS4, Line 56: offs &= matchByte; \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@57 PS4, Line 57: probLit = prob + (offs + bit + symbol); \ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@58 PS4, Line 58: GET_BIT2(probLit, symbol, offs ^= bit;, ;) please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@58 PS4, Line 58: GET_BIT2(probLit, symbol, offs ^= bit;, ;) space required after that ';' (ctx:VxO)
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@60 PS4, 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/4/src/lib/lzmadecode.c@60 PS4, 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/4/src/lib/lzmadecode.c@63 PS4, 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/4/src/lib/lzmadecode.c@64 PS4, Line 64: bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@65 PS4, 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/4/src/lib/lzmadecode.c@65 PS4, Line 65: #define UPDATE_0_CHECK range = bound; macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@66 PS4, 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/4/src/lib/lzmadecode.c@66 PS4, Line 66: #define UPDATE_1_CHECK range -= bound; code -= bound; macros should not use a trailing semicolon
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@67 PS4, 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/4/src/lib/lzmadecode.c@68 PS4, 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/4/src/lib/lzmadecode.c@69 PS4, 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/4/src/lib/lzmadecode.c@72 PS4, 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/4/src/lib/lzmadecode.c@75 PS4, 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/4/src/lib/lzmadecode.c@76 PS4, 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/4/src/lib/lzmadecode.c@77 PS4, 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/4/src/lib/lzmadecode.c@92 PS4, 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/4/src/lib/lzmadecode.c@94 PS4, 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/4/src/lib/lzmadecode.c@122 PS4, Line 122: dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@137 PS4, Line 137: unsigned int matchByte = dic[dicPos - rep0 + trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@180 PS4, Line 180: dic[dicPos] = dic[dicPos - rep0 + trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@203 PS4, Line 203: } else { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@233 PS4, Line 233: probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@241 PS4, Line 241: TREE_DECODE(probLen, (1 << kLenNumHighBits), len); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@249 PS4, Line 249: ((len < kNumLenToPosStates ? trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@250 PS4, Line 250: len : kNumLenToPosStates - 1) << kNumPosSlotBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@254 PS4, Line 254: unsigned int numDirectBits = (unsigned int)(((distance >> 1) - 1)); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@262 PS4, Line 262: do { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@264 PS4, Line 264: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@269 PS4, Line 269: do { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@275 PS4, Line 275: t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@276 PS4, Line 276: distance = (distance << 1) + (t + 1); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@287 PS4, Line 287: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@298 PS4, Line 298: if (distance == (UInt32)0xFFFFFFFF) { Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@309 PS4, Line 309: state = (state < kNumStates + kNumLitStates) ? trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@311 PS4, Line 311: if (distance >= (checkDicSize == 0 ? processedPos : checkDicSize)) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@345 PS4, Line 345: if (++pos == dicBufSize) Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@459 PS4, Line 459: ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@460 PS4, Line 460: (p->dic[(p->dicPos == 0 ? trailing whitespace
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@461 PS4, Line 461: p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@465 PS4, Line 465: do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@478 PS4, Line 478: GET_BIT2_CHECK(probLit, symbol, offs ^= bit; , ;) space prohibited before that ',' (ctx:WxW)
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@544 PS4, Line 544: probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@561 PS4, Line 561: ((len < kNumLenToPosStates - 1 ? len : kNumLenToPosStates - 1) << line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@570 PS4, Line 570: prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@576 PS4, Line 576: code -= range & (((code - range) >> 31) - 1); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@578 PS4, Line 578: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@587 PS4, Line 587: } while (--numDirectBits); Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@659 PS4, Line 659: while (p->remainLen != kMatchSpecLenStart) { suspect code indent for conditional statements (8, 24)
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@710 PS4, Line 710: int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, (SizeT)rem); line over 96 characters
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@753 PS4, Line 753: else else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/41963/4/src/lib/lzmadecode.c@754 PS4, Line 754: dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | trailing whitespace