From: Laszlo Ersek Date: Sun, 14 Feb 2016 07:17:16 +0000 (+0100) Subject: BaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation" X-Git-Tag: edk2-stable201903~7844 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=6cc7ada465a7c5a6dab6e32abd5a4b6f1734c1d0;hp=730ffca1943d8965f68faa55216ba5857635bcd2 BaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation" The way the first use of the "_maxMode" variable is commented out (i.e., together with the enclosing "if" statement) in GetOptimum() triggers the "misleading-indentation" warning that is new in gcc-6.0, for the block of code that originally depended on the "if" statement. Gcc believes (mistakenly) that the programmer believes (mistakenly) that the block depends on (repIndex == 0) higher up. Restore the if statement, with a controlling expression that comprises the constant 1 and "_maxMode" commented out. Cc: Jordan Justen Cc: Cole Robinson Cc: Liming Gao Cc: Yonghong Zhu Reported-by: Cole Robinson Suggested-by: Jordan Justen Build-tested-by: Cole Robinson Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1307439 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c index 9b2dd16ffa..c6717eeea3 100644 --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c @@ -1367,7 +1367,7 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) if (repIndex == 0) startLen = lenTest + 1; - /* if (_maxMode) */ + if (1 /* _maxMode */) { UInt32 lenTest2 = lenTest + 1; UInt32 limit = lenTest2 + p->numFastBytes;