public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
@ 2018-10-09  7:06 Liming Gao
  2018-10-09  7:07 ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Liming Gao @ 2018-10-09  7:06 UTC (permalink / raw)
  To: edk2-devel

GCC 6 or above reports the warning misleading-indentation.
This patch fixes it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
index bebe664..e281716 100644
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
+++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
@@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
         unsigned limit = p->numFastBytes + 1;
         if (limit > numAvailFull)
           limit = numAvailFull;
-        for (len = 3; len < limit && data[len] == data2[len]; len++);
+        for (len = 3; len < limit && data[len] == data2[len]; len++)
+        {
+        }
         
         {
           unsigned state2 = kLiteralNextStates[state];
-- 
2.10.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09  7:06 [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation Liming Gao
@ 2018-10-09  7:07 ` Ard Biesheuvel
  2018-10-09  7:11   ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2018-10-09  7:07 UTC (permalink / raw)
  To: Liming Gao; +Cc: edk2-devel@lists.01.org

On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
> GCC 6 or above reports the warning misleading-indentation.
> This patch fixes it.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> index bebe664..e281716 100644
> --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
>          unsigned limit = p->numFastBytes + 1;
>          if (limit > numAvailFull)
>            limit = numAvailFull;
> -        for (len = 3; len < limit && data[len] == data2[len]; len++);
> +        for (len = 3; len < limit && data[len] == data2[len]; len++)
> +        {
> +        }
>
>          {
>            unsigned state2 = kLiteralNextStates[state];

Thanks Liming.

Don't we need this change in all copies of the LZMA SDK?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09  7:07 ` Ard Biesheuvel
@ 2018-10-09  7:11   ` Gao, Liming
  2018-10-09  7:12     ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Gao, Liming @ 2018-10-09  7:11 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel@lists.01.org

This issue in LzmaEnc.c is for encode. The copy SDK in MdeModulePkg and IntelFrameworkModulepkg is for decode. So, other copy SDK has no this issue. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
> Sent: Tuesday, October 9, 2018 3:08 PM
> To: Gao, Liming <liming.gao@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
> 
> On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
> > GCC 6 or above reports the warning misleading-indentation.
> > This patch fixes it.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Liming Gao <liming.gao@intel.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > ---
> >  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> > index bebe664..e281716 100644
> > --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> > +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> > @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
> >          unsigned limit = p->numFastBytes + 1;
> >          if (limit > numAvailFull)
> >            limit = numAvailFull;
> > -        for (len = 3; len < limit && data[len] == data2[len]; len++);
> > +        for (len = 3; len < limit && data[len] == data2[len]; len++)
> > +        {
> > +        }
> >
> >          {
> >            unsigned state2 = kLiteralNextStates[state];
> 
> Thanks Liming.
> 
> Don't we need this change in all copies of the LZMA SDK?
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09  7:11   ` Gao, Liming
@ 2018-10-09  7:12     ` Ard Biesheuvel
  2018-10-09  8:24       ` Zeng, Star
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2018-10-09  7:12 UTC (permalink / raw)
  To: Gao, Liming; +Cc: edk2-devel@lists.01.org

On 9 October 2018 at 09:11, Gao, Liming <liming.gao@intel.com> wrote:
> This issue in LzmaEnc.c is for encode. The copy SDK in MdeModulePkg and IntelFrameworkModulepkg is for decode. So, other copy SDK has no this issue.
>

I understand.

Thanks for the fix

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
>> Sent: Tuesday, October 9, 2018 3:08 PM
>> To: Gao, Liming <liming.gao@intel.com>
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
>>
>> On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
>> > GCC 6 or above reports the warning misleading-indentation.
>> > This patch fixes it.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.1
>> > Signed-off-by: Liming Gao <liming.gao@intel.com>
>> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> > ---
>> >  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > index bebe664..e281716 100644
>> > --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
>> >          unsigned limit = p->numFastBytes + 1;
>> >          if (limit > numAvailFull)
>> >            limit = numAvailFull;
>> > -        for (len = 3; len < limit && data[len] == data2[len]; len++);
>> > +        for (len = 3; len < limit && data[len] == data2[len]; len++)
>> > +        {
>> > +        }
>> >
>> >          {
>> >            unsigned state2 = kLiteralNextStates[state];
>>
>> Thanks Liming.
>>
>> Don't we need this change in all copies of the LZMA SDK?
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09  7:12     ` Ard Biesheuvel
@ 2018-10-09  8:24       ` Zeng, Star
  2018-10-09 10:13         ` Laszlo Ersek
  0 siblings, 1 reply; 7+ messages in thread
From: Zeng, Star @ 2018-10-09  8:24 UTC (permalink / raw)
  To: Ard Biesheuvel, Gao, Liming; +Cc: edk2-devel@lists.01.org, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
Sent: Tuesday, October 9, 2018 3:13 PM
To: Gao, Liming <liming.gao@intel.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation

On 9 October 2018 at 09:11, Gao, Liming <liming.gao@intel.com> wrote:
> This issue in LzmaEnc.c is for encode. The copy SDK in MdeModulePkg and IntelFrameworkModulepkg is for decode. So, other copy SDK has no this issue.
>

I understand.

Thanks for the fix

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
>> Sent: Tuesday, October 9, 2018 3:08 PM
>> To: Gao, Liming <liming.gao@intel.com>
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
>>
>> On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
>> > GCC 6 or above reports the warning misleading-indentation.
>> > This patch fixes it.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.1
>> > Signed-off-by: Liming Gao <liming.gao@intel.com>
>> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> > ---
>> >  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > index bebe664..e281716 100644
>> > --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>> > @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
>> >          unsigned limit = p->numFastBytes + 1;
>> >          if (limit > numAvailFull)
>> >            limit = numAvailFull;
>> > -        for (len = 3; len < limit && data[len] == data2[len]; len++);
>> > +        for (len = 3; len < limit && data[len] == data2[len]; len++)
>> > +        {
>> > +        }
>> >
>> >          {
>> >            unsigned state2 = kLiteralNextStates[state];
>>
>> Thanks Liming.
>>
>> Don't we need this change in all copies of the LZMA SDK?
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09  8:24       ` Zeng, Star
@ 2018-10-09 10:13         ` Laszlo Ersek
  2018-10-09 10:24           ` Gao, Liming
  0 siblings, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2018-10-09 10:13 UTC (permalink / raw)
  To: Zeng, Star, Ard Biesheuvel, Gao, Liming; +Cc: edk2-devel@lists.01.org

On 10/09/18 10:24, Zeng, Star wrote:
> Reviewed-by: Star Zeng <star.zeng@intel.com>
> 
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
> Sent: Tuesday, October 9, 2018 3:13 PM
> To: Gao, Liming <liming.gao@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
> 
> On 9 October 2018 at 09:11, Gao, Liming <liming.gao@intel.com> wrote:
>> This issue in LzmaEnc.c is for encode. The copy SDK in MdeModulePkg and IntelFrameworkModulepkg is for decode. So, other copy SDK has no this issue.
>>
> 
> I understand.
> 
> Thanks for the fix
> 
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

In the commit message, I referenced
<https://bugzilla.tianocore.org/show_bug.cgi?id=1234>, which got
reported meanwhile.

Pushed as commit 50431b9cc70c.

Thanks
Laszlo

>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
>>> Sent: Tuesday, October 9, 2018 3:08 PM
>>> To: Gao, Liming <liming.gao@intel.com>
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
>>>
>>> On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
>>>> GCC 6 or above reports the warning misleading-indentation.
>>>> This patch fixes it.
>>>>
>>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>>> Signed-off-by: Liming Gao <liming.gao@intel.com>
>>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>> ---
>>>>  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>>>> index bebe664..e281716 100644
>>>> --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>>>> +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
>>>> @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
>>>>          unsigned limit = p->numFastBytes + 1;
>>>>          if (limit > numAvailFull)
>>>>            limit = numAvailFull;
>>>> -        for (len = 3; len < limit && data[len] == data2[len]; len++);
>>>> +        for (len = 3; len < limit && data[len] == data2[len]; len++)
>>>> +        {
>>>> +        }
>>>>
>>>>          {
>>>>            unsigned state2 = kLiteralNextStates[state];
>>>
>>> Thanks Liming.
>>>
>>> Don't we need this change in all copies of the LZMA SDK?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
  2018-10-09 10:13         ` Laszlo Ersek
@ 2018-10-09 10:24           ` Gao, Liming
  0 siblings, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2018-10-09 10:24 UTC (permalink / raw)
  To: Laszlo Ersek, Zeng, Star, Ard Biesheuvel; +Cc: edk2-devel@lists.01.org

Thanks!

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Laszlo Ersek
> Sent: Tuesday, October 9, 2018 6:14 PM
> To: Zeng, Star <star.zeng@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>; Gao, Liming <liming.gao@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
> 
> On 10/09/18 10:24, Zeng, Star wrote:
> > Reviewed-by: Star Zeng <star.zeng@intel.com>
> >
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
> > Sent: Tuesday, October 9, 2018 3:13 PM
> > To: Gao, Liming <liming.gao@intel.com>
> > Cc: edk2-devel@lists.01.org
> > Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
> >
> > On 9 October 2018 at 09:11, Gao, Liming <liming.gao@intel.com> wrote:
> >> This issue in LzmaEnc.c is for encode. The copy SDK in MdeModulePkg and IntelFrameworkModulepkg is for decode. So, other copy
> SDK has no this issue.
> >>
> >
> > I understand.
> >
> > Thanks for the fix
> >
> > Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> In the commit message, I referenced
> <https://bugzilla.tianocore.org/show_bug.cgi?id=1234>, which got
> reported meanwhile.
> 
> Pushed as commit 50431b9cc70c.
> 
> Thanks
> Laszlo
> 
> >>> -----Original Message-----
> >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
> >>> Sent: Tuesday, October 9, 2018 3:08 PM
> >>> To: Gao, Liming <liming.gao@intel.com>
> >>> Cc: edk2-devel@lists.01.org
> >>> Subject: Re: [edk2] [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation
> >>>
> >>> On 9 October 2018 at 09:06, Liming Gao <liming.gao@intel.com> wrote:
> >>>> GCC 6 or above reports the warning misleading-indentation.
> >>>> This patch fixes it.
> >>>>
> >>>> Contributed-under: TianoCore Contribution Agreement 1.1
> >>>> Signed-off-by: Liming Gao <liming.gao@intel.com>
> >>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>>> ---
> >>>>  BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 4 +++-
> >>>>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> >>>> index bebe664..e281716 100644
> >>>> --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> >>>> +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
> >>>> @@ -1464,7 +1464,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
> >>>>          unsigned limit = p->numFastBytes + 1;
> >>>>          if (limit > numAvailFull)
> >>>>            limit = numAvailFull;
> >>>> -        for (len = 3; len < limit && data[len] == data2[len]; len++);
> >>>> +        for (len = 3; len < limit && data[len] == data2[len]; len++)
> >>>> +        {
> >>>> +        }
> >>>>
> >>>>          {
> >>>>            unsigned state2 = kLiteralNextStates[state];
> >>>
> >>> Thanks Liming.
> >>>
> >>> Don't we need this change in all copies of the LZMA SDK?
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-09 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-09  7:06 [Patch] BaseTools LzmaCompress: Fix GCC warning misleading-indentation Liming Gao
2018-10-09  7:07 ` Ard Biesheuvel
2018-10-09  7:11   ` Gao, Liming
2018-10-09  7:12     ` Ard Biesheuvel
2018-10-09  8:24       ` Zeng, Star
2018-10-09 10:13         ` Laszlo Ersek
2018-10-09 10:24           ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox