From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114806 invoked by alias); 27 Feb 2019 20:18:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 114648 invoked by uid 89); 27 Feb 2019 20:18:59 -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_HELO_PASS autolearn=ham version=3.3.2 spammy=*ptr X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.194.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Feb 2019 20:18:57 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 1A384400C7833 for ; Wed, 27 Feb 2019 13:33:59 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id z5fMgrfpB2qH7z5fMgMvsw; Wed, 27 Feb 2019 14:18:56 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jdWmB8WQtn6LZOwMJEv7ZuHbhd8pJQbq5/5RQ7cKJcw=; b=DPn40yxGDZ1pYJrun2Y8iZIwvN jvMk6JgXwJYPF2n3VBdMD17dMTuy5W96BdvDyuu5uIVI6iZhu5JlK78YQqbaNIXN0zztM3VtGaRK/ QpDHUE04+tDLzm09iLfDJ0Fb+; Received: from 75-166-85-218.hlrn.qwest.net ([75.166.85.218]:36364 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gz5fM-004Fi1-Bx; Wed, 27 Feb 2019 14:18:56 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 13/22] Remove free_current_contents Date: Wed, 27 Feb 2019 20:19:00 -0000 Message-Id: <20190227201849.32210-14-tom@tromey.com> In-Reply-To: <20190227201849.32210-1-tom@tromey.com> References: <20190227201849.32210-1-tom@tromey.com> X-SW-Source: 2019-02/txt/msg00522.txt.bz2 free_current_contents is no longer used, so this patch removes it. gdb/ChangeLog 2019-02-27 Tom Tromey * utils.h (free_current_contents): Don't declare. * utils.c (free_current_contents): Remove. --- gdb/ChangeLog | 5 +++++ gdb/utils.c | 29 ----------------------------- gdb/utils.h | 2 -- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/gdb/utils.c b/gdb/utils.c index 60af31f2e4f..9334860a9a0 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -127,35 +127,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty, } -/* Cleanup utilities. - - These are not defined in cleanups.c (nor declared in cleanups.h) - because while they use the "cleanup API" they are not part of the - "cleanup API". */ - -/* This function is useful for cleanups. - Do - - foo = xmalloc (...); - old_chain = make_cleanup (free_current_contents, &foo); - - to arrange to free the object thus allocated. */ - -void -free_current_contents (void *ptr) -{ - void **location = (void **) ptr; - - if (location == NULL) - internal_error (__FILE__, __LINE__, - _("free_current_contents: NULL pointer")); - if (*location != NULL) - { - xfree (*location); - *location = NULL; - } -} - /* Print a warning message. The first argument STRING is the warning diff --git a/gdb/utils.h b/gdb/utils.h index 896feb973c9..30cf02f16c4 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -260,8 +260,6 @@ struct htab_deleter /* A unique_ptr wrapper for htab_t. */ typedef std::unique_ptr htab_up; -extern void free_current_contents (void *); - extern void init_page_info (void); /* Temporarily set BATCH_FLAG and the associated unlimited terminal size. -- 2.17.2