[binutils-gdb] Use bool for "warn_if_slow"
Tom Tromey
tromey@sourceware.org
Fri Feb 27 21:00:08 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aa7796b08500ca7416f59a87bb704ad3f5d684f3
commit aa7796b08500ca7416f59a87bb704ad3f5d684f3
Author: Tom Tromey <tromey@adacore.com>
Date: Thu Feb 26 13:57:59 2026 -0700
Use bool for "warn_if_slow"
A few places still used int for the type of the 'warn_if_slow' flag.
This fixes all these spots.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diff:
---
gdb/inf-child.c | 2 +-
gdb/inf-child.h | 2 +-
gdb/linux-nat.c | 2 +-
gdb/linux-nat.h | 2 +-
gdb/remote.c | 8 ++++----
gdb/target.c | 2 +-
gdb/target.h | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 22e52686d5e..7983ecb0d92 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -234,7 +234,7 @@ inf_child_target::pid_to_exec_file (int pid)
int
inf_child_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
int nat_flags;
mode_t nat_mode;
diff --git a/gdb/inf-child.h b/gdb/inf-child.h
index 7d2d4eab68e..9fa62664b36 100644
--- a/gdb/inf-child.h
+++ b/gdb/inf-child.h
@@ -75,7 +75,7 @@ public:
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno) override;
+ bool warn_if_slow, fileio_error *target_errno) override;
int fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
ULONGEST offset, fileio_error *target_errno) override;
int fileio_pread (int fd, gdb_byte *read_buf, int len,
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 22dbfbc31f9..1d0a4609a3a 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4573,7 +4573,7 @@ linux_nat_fileio_pid_of (struct inferior *inf)
int
linux_nat_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
int nat_flags;
mode_t nat_mode;
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 2d2ccbc2371..0f128892735 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -101,7 +101,7 @@ public:
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno) override;
+ bool warn_if_slow, fileio_error *target_errno) override;
std::optional<std::string>
fileio_readlink (struct inferior *inf,
diff --git a/gdb/remote.c b/gdb/remote.c
index e5b6942287f..88b06e688bc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1115,7 +1115,7 @@ public:
int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow,
+ bool warn_if_slow,
fileio_error *target_errno) override;
int fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
@@ -1291,7 +1291,7 @@ public: /* Remote specific methods. */
/* We should get rid of this and use fileio_open directly. */
int remote_hostio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *remote_errno);
+ bool warn_if_slow, fileio_error *remote_errno);
int remote_hostio_close (int fd, fileio_error *remote_errno);
int remote_hostio_unlink (inferior *inf, const char *filename,
@@ -13403,7 +13403,7 @@ int
remote_target::remote_hostio_open (inferior *inf, const char *filename,
fileio_open_flags flags,
fileio_mode_flags mode,
- int warn_if_slow,
+ bool warn_if_slow,
fileio_error *remote_errno)
{
struct remote_state *rs = get_remote_state ();
@@ -13450,7 +13450,7 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename,
int
remote_target::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *remote_errno)
+ bool warn_if_slow, fileio_error *remote_errno)
{
return remote_hostio_open (inf, filename, flags, mode, warn_if_slow,
remote_errno);
diff --git a/gdb/target.c b/gdb/target.c
index 611f37c9730..66672f3ca38 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3177,7 +3177,7 @@ fileio_fd_to_fh (target_fd fd)
int
target_ops::fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno)
+ bool warn_if_slow, fileio_error *target_errno)
{
*target_errno = FILEIO_ENOSYS;
return -1;
diff --git a/gdb/target.h b/gdb/target.h
index 1679a2c9750..01fce1d9bad 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -992,7 +992,7 @@ struct target_ops
*TARGET_ERRNO). */
virtual int fileio_open (struct inferior *inf, const char *filename,
fileio_open_flags flags, fileio_mode_flags mode,
- int warn_if_slow, fileio_error *target_errno);
+ bool warn_if_slow, fileio_error *target_errno);
/* Write up to LEN bytes from WRITE_BUF to FD on the target.
Return the number of bytes written, or -1 if an error occurs
More information about the Gdb-cvs
mailing list