From patchwork Wed Apr 26 21:49:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 98276 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp529553qgf; Wed, 26 Apr 2017 14:49:22 -0700 (PDT) X-Received: by 10.84.131.129 with SMTP id d1mr2678105pld.16.1493243362177; Wed, 26 Apr 2017 14:49:22 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id u188si522898pgc.270.2017.04.26.14.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Apr 2017 14:49:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3AE5121951C80; Wed, 26 Apr 2017 14:49:21 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2499D2195406C for ; Wed, 26 Apr 2017 14:49:20 -0700 (PDT) Received: by mail-wm0-x236.google.com with SMTP id r190so1747620wme.1 for ; Wed, 26 Apr 2017 14:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OVaNRFBaGzlOFcYqyFKhaxHjmyMc7bms8dIY0IILeUM=; b=evumnoRf+nsjOYVKXpla8IVmn7sGhOI6KMsyfnxqidQXcnrVUXk6wWi2qGcGwRufkK g3rD4+Lyoq4j0vGnBX6Af2ZAoRyl/lPalYPboQrwDFW5OuEntJH3qV8UCke7Oc0HgtKY KubgEJxYHNRXWHyqAsn3reg1Hb0VwVeLOr5F0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OVaNRFBaGzlOFcYqyFKhaxHjmyMc7bms8dIY0IILeUM=; b=jtkXZcOjdBlQZQCJZn8s8YG1YKSKltuJ1TupKgxj/ExZTHsn3ih/D30LLM9XafSjP9 K02BZjw9tRQ14kxgvAv4Nex47IrxlVLCYqPGiJ4jfl9OqEDWJuWOdoKoMPbrkM602HqI zcvKfoSoVjVricX8GDzw56GHteP5Cl/PuZHfNkdugn4I+PGxXP4gOlKmy5gN2PKeU7w0 mSc96tEmuN6ccJWvQbS6Y3cB/i6L6oHUgSC4Hud1f6B7F153EIHBwJs3vlFTRfTEcRyY Bh6X9RDeB3ykVzPA20rYnS7HpsA9o4iymmhOah0MpFfR2XhPp8yET/JLzxGcWYPD5tgd dEKQ== X-Gm-Message-State: AN3rC/6uJ7VlnSelHjW+5J5FjBeONL4aOQz6+m959xzRcvY1ZTjyLb2k PuaZbIfYURTct/fU X-Received: by 10.28.238.211 with SMTP id j80mr23676wmi.97.1493243357739; Wed, 26 Apr 2017 14:49:17 -0700 (PDT) Received: from mohikan.hemma.eciton.net ([2a01:348:6:8735:e23f:49ff:fe6d:9d26]) by smtp.gmail.com with ESMTPSA id u4sm754981wmu.0.2017.04.26.14.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Apr 2017 14:49:17 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Wed, 26 Apr 2017 22:49:16 +0100 Message-Id: <20170426214916.20784-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] StdLib: GCC 6 build fixes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Daryl McDaniel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Jaben Carsey 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)