public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] StdLib: GCC 6 build fixes
@ 2017-04-26 21:49 Leif Lindholm
  2017-04-27 14:25 ` Carsey, Jaben
  0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2017-04-26 21:49 UTC (permalink / raw)
  To: edk2-devel; +Cc: Daryl McDaniel, Jaben Carsey

Resolve mainly 'misleading indentation', but also one 'defined but not used'
warning when building with GCC 6 (using GCC5 profile).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---

Encountered when attmpting to build AppPkg/Applications/Lua.

 StdLib/LibC/Math/k_rem_pio2.c |  3 ++-
 StdLib/LibC/Math/w_exp.c      |  2 ++
 StdLib/LibC/Time/Time.c       | 10 +++++-----
 StdLib/LibC/gdtoa/dtoa.c      |  8 ++++----
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/StdLib/LibC/Math/k_rem_pio2.c b/StdLib/LibC/Math/k_rem_pio2.c
index af2857778d..bceeb73cc5 100644
--- a/StdLib/LibC/Math/k_rem_pio2.c
+++ b/StdLib/LibC/Math/k_rem_pio2.c
@@ -174,7 +174,8 @@ __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t
 
     /* compute q[0],q[1],...q[jk] */
   for (i=0;i<=jk;i++) {
-      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+      q[i] = fw;
   }
 
   jz = jk;
diff --git a/StdLib/LibC/Math/w_exp.c b/StdLib/LibC/Math/w_exp.c
index 29a2bb2906..f2a0e39699 100644
--- a/StdLib/LibC/Math/w_exp.c
+++ b/StdLib/LibC/Math/w_exp.c
@@ -22,9 +22,11 @@ __RCSID("$NetBSD: w_exp.c,v 1.9 2002/05/26 22:02:00 wiz Exp $");
 #include "math.h"
 #include "math_private.h"
 
+#ifndef _IEEE_LIBM
 static const double
 o_threshold=  7.09782712893383973096e+02,  /* 0x40862E42, 0xFEFA39EF */
 u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
+#endif
 
 double
 exp(double x)   /* wrapper exp */
diff --git a/StdLib/LibC/Time/Time.c b/StdLib/LibC/Time/Time.c
index 0296a5dc93..6d83986fcb 100644
--- a/StdLib/LibC/Time/Time.c
+++ b/StdLib/LibC/Time/Time.c
@@ -464,11 +464,11 @@ time1(
   for (i = 0; i < sp->typecnt; ++i)
     seen[i] = FALSE;
   nseen = 0;
-  for (i = sp->timecnt - 1; i >= 0; --i)
-    if (!seen[sp->types[i]]) {
-    seen[sp->types[i]] = TRUE;
-    types[nseen++] = sp->types[i];
-    }
+    for (i = sp->timecnt - 1; i >= 0; --i)
+      if (!seen[sp->types[i]]) {
+        seen[sp->types[i]] = TRUE;
+        types[nseen++] = sp->types[i];
+      }
     for (sameind = 0; sameind < nseen; ++sameind) {
       samei = types[sameind];
       if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
diff --git a/StdLib/LibC/gdtoa/dtoa.c b/StdLib/LibC/gdtoa/dtoa.c
index 42098426fd..cd3b1c85d4 100644
--- a/StdLib/LibC/gdtoa/dtoa.c
+++ b/StdLib/LibC/gdtoa/dtoa.c
@@ -526,15 +526,15 @@ dtoa
         Bfree(b);
         b = b1;
         }
-      if (( j = b5 - m5 )!=0)
-        b = pow5mult(b, j);
+        if (( j = b5 - m5 )!=0)
+          b = pow5mult(b, j);
         if (b == NULL)
           return NULL;
       }
     else
       b = pow5mult(b, b5);
-      if (b == NULL)
-        return NULL;
+    if (b == NULL)
+      return NULL;
     }
   S = i2b(1);
   if (S == NULL)
-- 
2.11.0



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

* Re: [PATCH] StdLib: GCC 6 build fixes
  2017-04-26 21:49 [PATCH] StdLib: GCC 6 build fixes Leif Lindholm
@ 2017-04-27 14:25 ` Carsey, Jaben
  2017-04-28 16:07   ` Leif Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Carsey, Jaben @ 2017-04-27 14:25 UTC (permalink / raw)
  To: Leif Lindholm, edk2-devel@lists.01.org; +Cc: Daryl McDaniel

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Wednesday, April 26, 2017 2:49 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Daryl McDaniel <edk2-
> lists@mc2research.org>
> Subject: [edk2] [PATCH] StdLib: GCC 6 build fixes
> Importance: High
> 
> Resolve mainly 'misleading indentation', but also one 'defined but not used'
> warning when building with GCC 6 (using GCC5 profile).
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
> 
> Encountered when attmpting to build AppPkg/Applications/Lua.
> 
>  StdLib/LibC/Math/k_rem_pio2.c |  3 ++-
>  StdLib/LibC/Math/w_exp.c      |  2 ++
>  StdLib/LibC/Time/Time.c       | 10 +++++-----
>  StdLib/LibC/gdtoa/dtoa.c      |  8 ++++----
>  4 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/StdLib/LibC/Math/k_rem_pio2.c
> b/StdLib/LibC/Math/k_rem_pio2.c
> index af2857778d..bceeb73cc5 100644
> --- a/StdLib/LibC/Math/k_rem_pio2.c
> +++ b/StdLib/LibC/Math/k_rem_pio2.c
> @@ -174,7 +174,8 @@ __kernel_rem_pio2(double *x, double *y, int e0, int
> nx, int prec, const int32_t
> 
>      /* compute q[0],q[1],...q[jk] */
>    for (i=0;i<=jk;i++) {
> -      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
> +      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
> +      q[i] = fw;
>    }
> 
>    jz = jk;
> diff --git a/StdLib/LibC/Math/w_exp.c b/StdLib/LibC/Math/w_exp.c
> index 29a2bb2906..f2a0e39699 100644
> --- a/StdLib/LibC/Math/w_exp.c
> +++ b/StdLib/LibC/Math/w_exp.c
> @@ -22,9 +22,11 @@ __RCSID("$NetBSD: w_exp.c,v 1.9 2002/05/26 22:02:00
> wiz Exp $");
>  #include "math.h"
>  #include "math_private.h"
> 
> +#ifndef _IEEE_LIBM
>  static const double
>  o_threshold=  7.09782712893383973096e+02,  /* 0x40862E42, 0xFEFA39EF */
>  u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
> +#endif
> 
>  double
>  exp(double x)   /* wrapper exp */
> diff --git a/StdLib/LibC/Time/Time.c b/StdLib/LibC/Time/Time.c
> index 0296a5dc93..6d83986fcb 100644
> --- a/StdLib/LibC/Time/Time.c
> +++ b/StdLib/LibC/Time/Time.c
> @@ -464,11 +464,11 @@ time1(
>    for (i = 0; i < sp->typecnt; ++i)
>      seen[i] = FALSE;
>    nseen = 0;
> -  for (i = sp->timecnt - 1; i >= 0; --i)
> -    if (!seen[sp->types[i]]) {
> -    seen[sp->types[i]] = TRUE;
> -    types[nseen++] = sp->types[i];
> -    }
> +    for (i = sp->timecnt - 1; i >= 0; --i)
> +      if (!seen[sp->types[i]]) {
> +        seen[sp->types[i]] = TRUE;
> +        types[nseen++] = sp->types[i];
> +      }
>      for (sameind = 0; sameind < nseen; ++sameind) {
>        samei = types[sameind];
>        if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
> diff --git a/StdLib/LibC/gdtoa/dtoa.c b/StdLib/LibC/gdtoa/dtoa.c
> index 42098426fd..cd3b1c85d4 100644
> --- a/StdLib/LibC/gdtoa/dtoa.c
> +++ b/StdLib/LibC/gdtoa/dtoa.c
> @@ -526,15 +526,15 @@ dtoa
>          Bfree(b);
>          b = b1;
>          }
> -      if (( j = b5 - m5 )!=0)
> -        b = pow5mult(b, j);
> +        if (( j = b5 - m5 )!=0)
> +          b = pow5mult(b, j);
>          if (b == NULL)
>            return NULL;
>        }
>      else
>        b = pow5mult(b, b5);
> -      if (b == NULL)
> -        return NULL;
> +    if (b == NULL)
> +      return NULL;
>      }
>    S = i2b(1);
>    if (S == NULL)
> --
> 2.11.0
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH] StdLib: GCC 6 build fixes
  2017-04-27 14:25 ` Carsey, Jaben
@ 2017-04-28 16:07   ` Leif Lindholm
  0 siblings, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2017-04-28 16:07 UTC (permalink / raw)
  To: Carsey, Jaben; +Cc: edk2-devel@lists.01.org, Daryl McDaniel

On Thu, Apr 27, 2017 at 02:25:44PM +0000, Carsey, Jaben wrote:
> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

Thanks!

Pushed as 65ed9d7.

/
    Leif

> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Leif Lindholm
> > Sent: Wednesday, April 26, 2017 2:49 PM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; Daryl McDaniel <edk2-
> > lists@mc2research.org>
> > Subject: [edk2] [PATCH] StdLib: GCC 6 build fixes
> > Importance: High
> > 
> > Resolve mainly 'misleading indentation', but also one 'defined but not used'
> > warning when building with GCC 6 (using GCC5 profile).
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> > ---
> > 
> > Encountered when attmpting to build AppPkg/Applications/Lua.
> > 
> >  StdLib/LibC/Math/k_rem_pio2.c |  3 ++-
> >  StdLib/LibC/Math/w_exp.c      |  2 ++
> >  StdLib/LibC/Time/Time.c       | 10 +++++-----
> >  StdLib/LibC/gdtoa/dtoa.c      |  8 ++++----
> >  4 files changed, 13 insertions(+), 10 deletions(-)
> > 
> > diff --git a/StdLib/LibC/Math/k_rem_pio2.c
> > b/StdLib/LibC/Math/k_rem_pio2.c
> > index af2857778d..bceeb73cc5 100644
> > --- a/StdLib/LibC/Math/k_rem_pio2.c
> > +++ b/StdLib/LibC/Math/k_rem_pio2.c
> > @@ -174,7 +174,8 @@ __kernel_rem_pio2(double *x, double *y, int e0, int
> > nx, int prec, const int32_t
> > 
> >      /* compute q[0],q[1],...q[jk] */
> >    for (i=0;i<=jk;i++) {
> > -      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
> > +      for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
> > +      q[i] = fw;
> >    }
> > 
> >    jz = jk;
> > diff --git a/StdLib/LibC/Math/w_exp.c b/StdLib/LibC/Math/w_exp.c
> > index 29a2bb2906..f2a0e39699 100644
> > --- a/StdLib/LibC/Math/w_exp.c
> > +++ b/StdLib/LibC/Math/w_exp.c
> > @@ -22,9 +22,11 @@ __RCSID("$NetBSD: w_exp.c,v 1.9 2002/05/26 22:02:00
> > wiz Exp $");
> >  #include "math.h"
> >  #include "math_private.h"
> > 
> > +#ifndef _IEEE_LIBM
> >  static const double
> >  o_threshold=  7.09782712893383973096e+02,  /* 0x40862E42, 0xFEFA39EF */
> >  u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
> > +#endif
> > 
> >  double
> >  exp(double x)   /* wrapper exp */
> > diff --git a/StdLib/LibC/Time/Time.c b/StdLib/LibC/Time/Time.c
> > index 0296a5dc93..6d83986fcb 100644
> > --- a/StdLib/LibC/Time/Time.c
> > +++ b/StdLib/LibC/Time/Time.c
> > @@ -464,11 +464,11 @@ time1(
> >    for (i = 0; i < sp->typecnt; ++i)
> >      seen[i] = FALSE;
> >    nseen = 0;
> > -  for (i = sp->timecnt - 1; i >= 0; --i)
> > -    if (!seen[sp->types[i]]) {
> > -    seen[sp->types[i]] = TRUE;
> > -    types[nseen++] = sp->types[i];
> > -    }
> > +    for (i = sp->timecnt - 1; i >= 0; --i)
> > +      if (!seen[sp->types[i]]) {
> > +        seen[sp->types[i]] = TRUE;
> > +        types[nseen++] = sp->types[i];
> > +      }
> >      for (sameind = 0; sameind < nseen; ++sameind) {
> >        samei = types[sameind];
> >        if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
> > diff --git a/StdLib/LibC/gdtoa/dtoa.c b/StdLib/LibC/gdtoa/dtoa.c
> > index 42098426fd..cd3b1c85d4 100644
> > --- a/StdLib/LibC/gdtoa/dtoa.c
> > +++ b/StdLib/LibC/gdtoa/dtoa.c
> > @@ -526,15 +526,15 @@ dtoa
> >          Bfree(b);
> >          b = b1;
> >          }
> > -      if (( j = b5 - m5 )!=0)
> > -        b = pow5mult(b, j);
> > +        if (( j = b5 - m5 )!=0)
> > +          b = pow5mult(b, j);
> >          if (b == NULL)
> >            return NULL;
> >        }
> >      else
> >        b = pow5mult(b, b5);
> > -      if (b == NULL)
> > -        return NULL;
> > +    if (b == NULL)
> > +      return NULL;
> >      }
> >    S = i2b(1);
> >    if (S == NULL)
> > --
> > 2.11.0
> > 
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2017-04-28 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 21:49 [PATCH] StdLib: GCC 6 build fixes Leif Lindholm
2017-04-27 14:25 ` Carsey, Jaben
2017-04-28 16:07   ` Leif Lindholm

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