On 02/15/16 19:47, Laszlo Ersek wrote:
> The "_maxMode" variable doesn't exist in edk2's variant of LzmaCompress,
> but the way one of the old uses of the variable is commented out (i.e.,
> together with the enclosing "if" statement) 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.
> 
> Remove the commented out uses of "_maxMode", and unindent the block in
> question.
> 
> This patch is best viewed with "git show -b".
> 
> Cc: Cole Robinson <[email protected]>
> Cc: Yonghong Zhu <[email protected]>
> Cc: Liming Gao <[email protected]>
> Reported-by: Cole Robinson <[email protected]>
> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1307439
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <[email protected]>
> ---
>  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 81 
> ++++++++++++-------------
>  1 file changed, 40 insertions(+), 41 deletions(-)

This is what "git show -b", mentioned above, prints for the patch:

> diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 
> b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> index 9b2dd16ffa48..1eb9898b5291 100644
> --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> @@ -1367,7 +1367,6 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, 
> UInt32 *backRes)
>        if (repIndex == 0)
>          startLen = lenTest + 1;
>
> -      /* if (_maxMode) */
>        {
>          UInt32 lenTest2 = lenTest + 1;
>          UInt32 limit = lenTest2 + p->numFastBytes;
> @@ -1456,7 +1455,7 @@ static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, 
> UInt32 *backRes)
>            opt->prev1IsChar = False;
>          }
>
> -        if (/*_maxMode && */lenTest == matches[offs])
> +        if (lenTest == matches[offs])
>          {
>            /* Try Match + Literal + Rep0 */
>            const Byte *data2 = data - (curBack + 1);

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to