From patchwork Thu Jul 12 20:51:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28347 Received: (qmail 56034 invoked by alias); 12 Jul 2018 20:52:32 -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 55894 invoked by uid 89); 12 Jul 2018 20:52:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.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_HELO_PASS autolearn=ham version=3.3.2 spammy=scm, SCM X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 20:52:30 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway31.websitewelcome.com (Postfix) with ESMTP id AF35A1A9FAE6 for ; Thu, 12 Jul 2018 15:52:28 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id diZQf0mHVBcCXdiZZfhqgX; Thu, 12 Jul 2018 15:52:28 -0500 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=fA1flVmF6s2CH/A5Py6C02nVK3V/WXvw3PhAPoHEFog=; b=kWOfFodGx/ewIEqWcm0MQdxayu 2ZQFaQVVDkGts5ILx9KWsGC004t9HjJ9q10q4pjKDLZFjFV3h2EOsQ3iv3l98ejkLKZBFaUWySFzg mW1SiyT6ZBeUAEUyRtwMqXiXF; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:49432 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fdiZP-001ZuD-S5; Thu, 12 Jul 2018 15:52:11 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 04/13] Call some functions in guile/ for effect Date: Thu, 12 Jul 2018 14:51:59 -0600 Message-Id: <20180712205208.32646-5-tom@tromey.com> In-Reply-To: <20180712205208.32646-1-tom@tromey.com> References: <20180712205208.32646-1-tom@tromey.com> This changes a few spots in guile/ to remove a variable declaration but to still call a function for effect. gdb/ChangeLog 2018-07-12 Tom Tromey * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Call value_contents_for_printing for effect. * guile/scm-cmd.c (gdbscm_dont_repeat): Call cmdscm_get_valid_command_smob_arg_unsafe for effect. * guile/scm-block.c (gdbscm_make_block_syms_iter): Call bkscm_get_valid_block_smob_arg_unsafe for effect. --- gdb/ChangeLog | 9 +++++++++ gdb/guile/scm-block.c | 5 ++--- gdb/guile/scm-cmd.c | 6 +++--- gdb/guile/scm-pretty-print.c | 4 +++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index d4566fc1ffe..9caff799dc1 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -613,9 +613,8 @@ bkscm_block_syms_progress_p (SCM scm) static SCM gdbscm_make_block_syms_iter (SCM self) { - block_smob *b_smob - = bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); - const struct block *block = b_smob->block; + /* Call for side effects. */ + bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); SCM progress, iter; progress = bkscm_make_block_syms_progress_smob (); diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c index 64243d1ba2e..9e5ff8f2636 100644 --- a/gdb/guile/scm-cmd.c +++ b/gdb/guile/scm-cmd.c @@ -267,9 +267,9 @@ gdbscm_command_valid_p (SCM self) static SCM gdbscm_dont_repeat (SCM self) { - /* We currently don't need anything from SELF, but still verify it. */ - command_smob *c_smob - = cmdscm_get_valid_command_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); + /* We currently don't need anything from SELF, but still verify it. + Call for side effects. */ + cmdscm_get_valid_command_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); dont_repeat (); diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c index da1b7d2be15..8c96e7e3f8b 100644 --- a/gdb/guile/scm-pretty-print.c +++ b/gdb/guile/scm-pretty-print.c @@ -970,7 +970,9 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang, struct cleanup *cleanups; enum ext_lang_rc result = EXT_LANG_RC_NOP; enum string_repr_result print_result; - const gdb_byte *valaddr = value_contents_for_printing (val); + + /* Call for side effects. */ + value_contents_for_printing (val); /* No pretty-printer support for unavailable values. */ if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type)))