Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/7] Change completion_tracker to use char type
Date: Wed, 08 Aug 2018 23:20:00 -0000	[thread overview]
Message-ID: <20180808232016.12777-2-tom@tromey.com> (raw)
In-Reply-To: <20180808232016.12777-1-tom@tromey.com>

This changes completion_tracker to use the char type for the quote
char.  This avoids some narrowing warnings at the places where
quote_char() is called.

gdb/ChangeLog
2018-08-08  Tom Tromey  <tom@tromey.com>

	* completer.h (completion_tracker::set_quote_char): Change
	parameter type to "char".
	(completion_tracker::quote_char): Return "char".  Now const.
	(completion_tracker::m_quote_char): Now "char".
---
 gdb/ChangeLog   | 7 +++++++
 gdb/completer.h | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gdb/completer.h b/gdb/completer.h
index 2bdfa26f6c..9f10bf0ea8 100644
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -329,13 +329,13 @@ public:
   /* Set the quote char to be appended after a unique completion is
      added to the input line.  Set to '\0' to clear.  See
      m_quote_char's description.  */
-  void set_quote_char (int quote_char)
+  void set_quote_char (char quote_char)
   { m_quote_char = quote_char; }
 
   /* The quote char to be appended after a unique completion is added
      to the input line.  Returns '\0' if no quote char has been set.
      See m_quote_char's description.  */
-  int quote_char () { return m_quote_char; }
+  char quote_char () const { return m_quote_char; }
 
   /* Tell the tracker that the current completer wants to provide a
      custom word point instead of a list of a break chars, in the
@@ -450,7 +450,7 @@ private:
       before tab: "b 'function("
       after tab:  "b 'function()' "
   */
-  int m_quote_char = '\0';
+  char m_quote_char = '\0';
 
   /* If true, the completer has its own idea of "word" point, and
      doesn't want to rely on readline computing it based on brkchars.
-- 
2.13.6


  parent reply	other threads:[~2018-08-08 23:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 23:20 [PATCH 0/7] Remove -Wno-narrowing Tom Tromey
2018-08-08 23:20 ` [PATCH 3/7] Avoid -Wnarrowing warnings in struct tramp_frame instances Tom Tromey
2018-08-09 18:08   ` Pedro Alves
2018-08-09 18:17     ` Tom Tromey
2018-08-08 23:20 ` Tom Tromey [this message]
2018-08-09 17:38   ` [PATCH 1/7] Change completion_tracker to use char type Pedro Alves
2018-08-09 18:42     ` Tom Tromey
2018-08-09 18:50       ` Pedro Alves
2018-08-08 23:20 ` [PATCH 4/7] Fix two -Wnarrowing warnings in xtensa-tdep.h Tom Tromey
2018-08-09 18:09   ` Pedro Alves
2018-08-08 23:20 ` [PATCH 7/7] Remove -Wno-narrowing from warnings.m4 Tom Tromey
2018-08-09 18:10   ` Pedro Alves
2018-08-27 17:46     ` Tom Tromey
2018-08-27 18:00       ` Tom Tromey
2018-08-08 23:20 ` [PATCH 2/7] Use CORE_ADDR_MAX in various "breaks" arrays Tom Tromey
2018-08-09 18:08   ` Pedro Alves
2018-08-08 23:20 ` [PATCH 5/7] Avoid -Wnarrowing warnings in ppc64-tdep.c Tom Tromey
2018-08-08 23:20 ` [PATCH 6/7] Avoid -Wnarrowing warnings in gdbserver Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180808232016.12777-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox