From patchwork Tue Jul 2 15:36:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33517 Received: (qmail 64942 invoked by alias); 2 Jul 2019 15:42:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 64828 invoked by uid 89); 2 Jul 2019 15:42:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, 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.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Jul 2019 15:42:05 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 74EED56092; Tue, 2 Jul 2019 11:36:05 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id f0+wiY0JSpqb; Tue, 2 Jul 2019 11:36:05 -0400 (EDT) Received: from murgatroyd.Home (174-29-48-143.hlrn.qwest.net [174.29.48.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 213865608B; Tue, 2 Jul 2019 11:36:05 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 4/4] Fix a FIXME in mi-out.c Date: Tue, 2 Jul 2019 09:36:02 -0600 Message-Id: <20190702153602.27637-5-tromey@adacore.com> In-Reply-To: <20190702153602.27637-1-tromey@adacore.com> References: <20190702153602.27637-1-tromey@adacore.com> MIME-Version: 1.0 This removes a FIXME comment from mi_ui_out::do_field_int, by replacing a printf with a use of plongest. gdb/ChangeLog 2019-07-02 Tom Tromey * mi/mi-out.c (mi_ui_out::do_field_int): Use plongest. --- gdb/ChangeLog | 4 ++++ gdb/mi/mi-out.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index dd99a2b7fb1..75e3f0313d8 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -98,10 +98,7 @@ void mi_ui_out::do_field_int (int fldno, int width, ui_align alignment, const char *fldname, int value) { - char buffer[20]; /* FIXME: how many chars long a %d can become? */ - - xsnprintf (buffer, sizeof (buffer), "%d", value); - do_field_string (fldno, width, alignment, fldname, buffer, + do_field_string (fldno, width, alignment, fldname, plongest (value), ui_out_style_kind::DEFAULT); }