From patchwork Tue May 22 05:07:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27388 Received: (qmail 11379 invoked by alias); 22 May 2018 05:07:39 -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 5083 invoked by uid 89); 22 May 2018 05:07:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=complain X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.144.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 May 2018 05:07:22 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 09966BC91B for ; Tue, 22 May 2018 00:07:09 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id KzVtff8eYBcCXKzVtfZqYM; Tue, 22 May 2018 00:07:09 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:36532 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fKzVs-003pV7-QL; Tue, 22 May 2018 00:07:08 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 6/9] Remove vcomplaint Date: Mon, 21 May 2018 23:07:01 -0600 Message-Id: <20180522050704.10845-7-tom@tromey.com> In-Reply-To: <20180522050704.10845-1-tom@tromey.com> References: <20180522050704.10845-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fKzVs-003pV7-QL X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya.Home) [174.29.44.154]:36532 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes vcomplaint now has a single caller, so merge it with that caller. gdb/ChangeLog 2018-05-21 Tom Tromey * complaints.c (vcomplaint): Remove. (complaint_internal) Merge in contents of vcomplaint. --- gdb/ChangeLog | 5 +++++ gdb/complaints.c | 25 ++++++++----------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/gdb/complaints.c b/gdb/complaints.c index eab7607deb..4b7532582f 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -100,22 +100,22 @@ find_complaint (struct complaints *complaints, const char *file, int stop_whining = 0; -/* Print a complaint, and link the complaint block into a chain for - later handling. */ +/* See complaints.h. */ -static void ATTRIBUTE_PRINTF (3, 0) -vcomplaint (const char *file, - int line, const char *fmt, - va_list args) +void +complaint_internal (const char *fmt, ...) { - struct complain *complaint = find_complaint (&symfile_complaint_book, file, - line, fmt); + va_list args; + + struct complain *complaint = find_complaint (&symfile_complaint_book, NULL, + 0, fmt); enum complaint_series series; complaint->counter++; if (complaint->counter > stop_whining) return; + va_start (args, fmt); series = symfile_complaint_book.series; /* Pass 'fmt' instead of 'complaint->fmt' to printf-like callees @@ -146,15 +146,6 @@ vcomplaint (const char *file, becomes a performance hog. */ gdb_flush (gdb_stderr); -} - -void -complaint_internal (const char *fmt, ...) -{ - va_list args; - - va_start (args, fmt); - vcomplaint (NULL/*file*/, 0/*line*/, fmt, args); va_end (args); }