From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 893013858C20; Thu, 29 Sep 2022 20:42:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 893013858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664484121; bh=S/d9rNGnAsIpcygJMBsR/oAENvlDhamE2uh82r6hdCk=; h=From:To:Subject:Date:From; b=yqYPuiigettm7yYE+Dnm09xGjiutyQ+QbDcr7IRzXZeSbUYKuNNNR9+KblT45lVgX CN0bOCrmnAdRlu8UqDRjm0qsypTjGoRxBdwdv7f4pyBylxvTeFZgJDqXY3Z12xp6Iu xJ3lroiC6S8+8oiLpfM/rOUia+6IhI7L//NI0h2k= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: constify target_stack::is_pushed X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: ac9b8c676e9f52c5238bbc61a2cdd27e3d59db10 X-Git-Newrev: 31282a849107d95d3cfe115ba160f976dd99844c Message-Id: <20220929204201.893013858C20@sourceware.org> Date: Thu, 29 Sep 2022 20:42:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D31282a849107= d95d3cfe115ba160f976dd99844c commit 31282a849107d95d3cfe115ba160f976dd99844c Author: Simon Marchi Date: Thu Sep 29 16:39:13 2022 -0400 gdb: constify target_stack::is_pushed =20 The target_ops parameters here can be made const. =20 Change-Id: Ibc18b17d6b21d06145251a03e68aca90538117d6 Diff: --- gdb/inferior.h | 2 +- gdb/target.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/inferior.h b/gdb/inferior.h index 017800165b4..bb3aec1e8f8 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -369,7 +369,7 @@ public: int unpush_target (struct target_ops *t); =20 /* Returns true if T is pushed in this inferior's target stack. */ - bool target_is_pushed (target_ops *t) + bool target_is_pushed (const target_ops *t) { return m_target_stack.is_pushed (t); } =20 /* Find the target beneath T in this inferior's target stack. */ diff --git a/gdb/target.h b/gdb/target.h index 0b784278c4f..8e13ada07b6 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1385,7 +1385,7 @@ public: bool unpush (target_ops *t); =20 /* Returns true if T is pushed on the target stack. */ - bool is_pushed (target_ops *t) const + bool is_pushed (const target_ops *t) const { return at (t->stratum ()) =3D=3D t; } =20 /* Return the target at STRATUM. */