public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] ada-lang.c::advance_wild_match improve doc and parameter+temporaries types
@ 2020-10-09 20:33 Joel Brobecker
  0 siblings, 0 replies; only message in thread
From: Joel Brobecker @ 2020-10-09 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

Hello,

This commit fixes the type of one of the parameters as well as a couple
of temporaries.

While at it, the function's description is slightly rewritten to make it
a little clearer what the function does.

gdb/ChangeLog:

        * ada-lang.c (advance_wild_match): Rewrite the function's
        description.  Change the type of target0, t0 and t1 to char.

Reviewed internally at AdaCore by Tom.
Tested on x86_64-linux.

Thanks,
-- 
Joel

---
 gdb/ChangeLog  |  5 +++++
 gdb/ada-lang.c | 12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 80a1d28015a..de66f5aae79 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-10-09  Joel Brobecker  <brobecker@adacore.com>
+
+	* ada-lang.c (advance_wild_match): Rewrite the function's
+	description.  Change the type of target0, t0 and t1 to char.
+
 2020-10-09  Tom Tromey  <tromey@adacore.com>
 
 	* dwarf2/read.c (dwarf2_add_field): Handle signed offsets.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index fbce14bbe42..be6d0e1d019 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -186,7 +186,7 @@ static int equiv_types (struct type *, struct type *);
 
 static int is_name_suffix (const char *);
 
-static int advance_wild_match (const char **, const char *, int);
+static int advance_wild_match (const char **, const char *, char);
 
 static bool wild_match (const char *name, const char *patn);
 
@@ -5921,18 +5921,18 @@ is_valid_name_for_wild_match (const char *name0)
   return 1;
 }
 
-/* Advance *NAMEP to next occurrence of TARGET0 in the string NAME0
-   that could start a simple name.  Assumes that *NAMEP points into
-   the string beginning at NAME0.  */
+/* Advance *NAMEP to next occurrence in the string NAME0 of the TARGET0
+   character which could start a simple name.  Assumes that *NAMEP points
+   somewhere inside the string beginning at NAME0.  */
 
 static int
-advance_wild_match (const char **namep, const char *name0, int target0)
+advance_wild_match (const char **namep, const char *name0, char target0)
 {
   const char *name = *namep;
 
   while (1)
     {
-      int t0, t1;
+      char t0, t1;
 
       t0 = *name;
       if (t0 == '_')
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-09 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 20:33 [pushed] ada-lang.c::advance_wild_match improve doc and parameter+temporaries types Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).