From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: How to use a float value with either GLYPH_DEBUG or NSTRACE Date: Mon, 21 Aug 2017 21:30:21 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1503376378 32142 195.159.176.226 (22 Aug 2017 04:32:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2017 04:32:58 +0000 (UTC) Cc: Alan Third , Noam Postavsky , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 06:32:54 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dk0rw-0007i3-Mx for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 06:32:49 +0200 Original-Received: from localhost ([::1]:35975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk0s1-0007yB-Mb for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 00:32:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk0rk-0007mg-01 for emacs-devel@gnu.org; Tue, 22 Aug 2017 00:32:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk0rg-0003qG-NF for emacs-devel@gnu.org; Tue, 22 Aug 2017 00:32:35 -0400 Original-Received: from gateway33.websitewelcome.com ([192.185.145.239]:46860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dk0rg-0003pz-Ff for emacs-devel@gnu.org; Tue, 22 Aug 2017 00:32:32 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 90E4774C41A for ; Mon, 21 Aug 2017 23:30:23 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id k0oid9mpxdHTnk0oidX95s; Mon, 21 Aug 2017 23:29:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ASD3o9iJHVKHu6k93ffJeX+lFLdPgYq7pFwGbZ1TN0M=; b=OMBMS64cyeWLM8INDQYKBfpKls JE3PW3uhwiUJNs0XvZo6yn5rCyyW01O3RKBWAwjAIk3S0+7C8nwwdEx69+NA4k0IsR+ca4NR2uqwb d9w8mC1csHRT2mwHrb3d9aYOZoRR3GDgnMix9i95nrxNo29E/UFzp45fXi0+xzZj2EDYvMKezoEhd /eg81460ONdrQYiE7XurBm/x4bO9S6pP/vLRiozy6k8bs4DwNjHRUwvVWa0bkD+bI43c/vmpyQY5e sZx6agyehya3nJ9GQ3cpimjzw8Ys8FR1zzgdKB8CKFiAIYhJEQc83evAeXmlDJy3FsIQ6/CR3jtF7 9Gfko5AQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:57262 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dk0pa-00312w-Lw; Mon, 21 Aug 2017 23:30:22 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dk0pa-00312w-Lw X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:57262 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.145.239 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217675 Archived-At: Thank you, Paul, for the suggestion to use dtoastr. I tried that and a few variations, but got stuck because dtoastr returns an `int` and `%s` expects a `char` value. Substituting `%s` for `%d` did not yield the correct results. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [08-21-2017 16:55:08] <21 Aug 2017 16:55:08 -0700> FROM: Paul Eggert > > * * * > > E.g., something like the following (untested) C code. Although this > assumes CGFloat is 'double', and outputs excess precision on 32-bit > platforms where CGFloat is 'float', it would be easy to fix that if you > like the idea. > > #include > > void > example (CGFloat value) > { > char buf[DBL_BUFSIZE_BOUND]; > NSTRACE ("float: %s", dtoastr (buf, sizeof buf, 0, 0, value)); > }