public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: boolify 'should_print_thread'
@ 2023-04-04 19:12 Tankut Baris Aktemur
  2023-04-04 19:28 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tankut Baris Aktemur @ 2023-04-04 19:12 UTC (permalink / raw)
  To: gdb-patches

Convert the return type of 'should_print_thread' from int to bool.
---
 gdb/thread.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/thread.c b/gdb/thread.c
index 25d97cd6072..5d5298331bf 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -986,7 +986,7 @@ pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
    and PID is not -1, then the thread is printed if it belongs to the
    specified process.  Otherwise, an error is raised.  */
 
-static int
+static bool
 should_print_thread (const char *requested_threads, int default_inf_num,
 		     int global_ids, int pid, struct thread_info *thr)
 {
@@ -1000,20 +1000,20 @@ should_print_thread (const char *requested_threads, int default_inf_num,
 	in_list = tid_is_in_list (requested_threads, default_inf_num,
 				  thr->inf->num, thr->per_inf_num);
       if (!in_list)
-	return 0;
+	return false;
     }
 
   if (pid != -1 && thr->ptid.pid () != pid)
     {
       if (requested_threads != NULL && *requested_threads != '\0')
 	error (_("Requested thread not found in requested process"));
-      return 0;
+      return false;
     }
 
   if (thr->state == THREAD_EXITED)
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 /* Return the string to display in "info threads"'s "Target Id"
-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb: boolify 'should_print_thread'
  2023-04-04 19:12 [PATCH] gdb: boolify 'should_print_thread' Tankut Baris Aktemur
@ 2023-04-04 19:28 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-04-04 19:28 UTC (permalink / raw)
  To: Tankut Baris Aktemur via Gdb-patches; +Cc: Tankut Baris Aktemur

>>>>> Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org> writes:

> Convert the return type of 'should_print_thread' from int to bool.

Thank you, this is ok.
Reviewed-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-04 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 19:12 [PATCH] gdb: boolify 'should_print_thread' Tankut Baris Aktemur
2023-04-04 19:28 ` Tom Tromey

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).