From patchwork Thu Jul 12 18:13:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 141832 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1828206ljj; Thu, 12 Jul 2018 11:14:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdbW7MP3fA3/2sDrn3OiZELOjUK+TtjD0r9WbpSLBOtNOJLaeqlopLTY8Jz8PpPvPHtOuCE X-Received: by 2002:a65:5288:: with SMTP id y8-v6mr3049396pgp.284.1531419250574; Thu, 12 Jul 2018 11:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531419250; cv=none; d=google.com; s=arc-20160816; b=zsPN8+ByaStR4dhinsZx+JE1mz6tx4CYL1N4c/GkEZx3vGoP0z1slXm+KTSkoPGtoh zsWshFNwd21U0x0gl1hE0j3FoEcrh0/mvRm/kmGzQ3C8QiHmL/NCwZNEDdZdR75lsrTt 4QHviQqX/ebELtGZ+ztdhhcjyMKvpKEXX0i5b0pQoybiGwyaU7e8sxhs36NiF9+YjKfZ UvNGmIxcEUcGqGxxhaDOMcun6eKP2/OzirNXueiUJw/pIpHXqg90ogOTZj9jlstfpQjX q9uvxS2Wi1jY4B25qOgKho+pUqEN0qoh8HJUO1UAvCfj1PVGBrj+IGtdNq7F1GywjeQT oHhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=svNNGssnKZmImBM1SyjZjUUKJrN4ICwlV0lDQfJSqeI=; b=NCRStbrkWVBD+OfaJDsZuxgfBUpiPCLDw8QeJgWG3a3zyEk+ws6CX4RYRpHuBbmQx1 SwMm7kfwA5dLLIBnScmrrQBOojiOvhI2AmP3zQDHQiZ47dNBMP8zdPgjPwVOe3I9B7Xd XefHdeOHZN2smQi9U7hjiGjBI1GEfgqWLex9dSb6q8i/aAXe9XP9ycM5SsuOqWb8UG9k V8WZSGfIk7PKC74CuScHUhsexigqG5puE8cGWe+1U5jrG1XIC9A3fMcD9mfI0IcPvJ87 YT15vindFXTk2RSmr1uB0YMaHGMAiYF/GuNyr3q+Hp9N9osG7Z1kgGjJLjHVE0zviK5O 5PhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Zj/esllA"; dkim=pass header.i=@linaro.org header.s=google header.b=W+Bv3GTY; spf=pass (google.com: domain of newlib-return-16086-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16086-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r25-v6si21032570pge.104.2018.07.12.11.14.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 11:14:10 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-16086-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Zj/esllA"; dkim=pass header.i=@linaro.org header.s=google header.b=W+Bv3GTY; spf=pass (google.com: domain of newlib-return-16086-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16086-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=sfhhfADb1q9kwZX9L0/yXPYH3GONG4vA6c7xva/gTWkME8pb51ooX O52osczCMkNtmC/tOfZUQa2hlaDdgloy8+ggyWb59ppHTpufc6BVz3/qkAkmEvf4 eDCsBS3ExuP/0mAmn7W3TEm0hXzBMn4OrjH+QXbNMtqsss2+RiYqH8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=vMhFJebKIfLgeZB0X6XK6Jn9z7Q=; b=Zj/esllAJl8fbJtaVzz64CygUZ3x eAsPGe4ird6OF91tngQvffDMjlgDPdGx7iWVQA8mgDsRgcvp11HM9UKFMcTfWClI atV4Vj2R2SjCZfTwqmovu1a+mFuHE27eRhJUrDskoYaAarsprvdR+LPqqSHxrFKN URpsvyro7Rbkm4Q= Received: (qmail 112672 invoked by alias); 12 Jul 2018 18:14:01 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 112347 invoked by uid 89); 12 Jul 2018 18:14:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:607, gala, pdata, NAN X-HELO: mail-oi0-f66.google.com Received: from mail-oi0-f66.google.com (HELO mail-oi0-f66.google.com) (209.85.218.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 18:13:59 +0000 Received: by mail-oi0-f66.google.com with SMTP id b15-v6so57459945oib.10 for ; Thu, 12 Jul 2018 11:13:59 -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=svNNGssnKZmImBM1SyjZjUUKJrN4ICwlV0lDQfJSqeI=; b=W+Bv3GTYE2r7LJoJvzAcaNapxEj+4GIci7tjYZ+ol2uD2Q51hlpp7uDtLxHqgVaVgr X2XwN0gikJ9LZHgurOYrP+KgWFVZ0mGNh6Ct79OKdBO8zkfQqlVI55r/KoU+kF0e1dwh iR72KaEHcLKZuZ0d5YKBI5PuY94TVEzhl3yn0= Return-Path: Received: from localhost.localdomain (108-248-84-146.lightspeed.austtx.sbcglobal.net. [108.248.84.146]) by smtp.gmail.com with ESMTPSA id q124-v6sm4925220oif.8.2018.07.12.11.13.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 11:13:57 -0700 (PDT) From: Kumar Gala To: newlib@sourceware.org Cc: Kumar Gala Subject: [PATCH] Print sign of NaN values to nano-vfprintf. Date: Thu, 12 Jul 2018 13:13:53 -0500 Message-Id: <20180712181353.125469-1-kumar.gala@linaro.org> Signed-off-by: Kumar Gala --- newlib/libc/stdio/nano-vfprintf_float.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.14.4 diff --git a/newlib/libc/stdio/nano-vfprintf_float.c b/newlib/libc/stdio/nano-vfprintf_float.c index 98893e97b..071a09edc 100644 --- a/newlib/libc/stdio/nano-vfprintf_float.c +++ b/newlib/libc/stdio/nano-vfprintf_float.c @@ -213,6 +213,8 @@ _printf_float (struct _reent *data, } if (isnan (_fpvalue)) { + if (_fpvalue < 0) + pdata->l_buf[0] = '-'; if (code <= 'G') /* 'A', 'E', 'F', or 'G'. */ cp = "NAN"; else