public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Change int to bool for the relocate_* functions
@ 2019-09-06 19:35 Christian Biesinger
0 siblings, 0 replies; only message in thread
From: Christian Biesinger @ 2019-09-06 19:35 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ead0e69a4ab34d0c689f0c4c310b8d788867da32
commit ead0e69a4ab34d0c689f0c4c310b8d788867da32
Author: Christian Biesinger <cbiesinger@google.com>
Date: Fri Sep 6 14:19:40 2019 -0500
Change int to bool for the relocate_* functions
These parameters are only used as bools. This also
renames "flag" to "relocatable" to make it clearer
what it does.
gdb/ChangeLog:
2019-09-06 Christian Biesinger <cbiesinger@google.com>
* defs.h (relocate_gdb_directory): Change int to bool in
signature and rename flag to relocatable.
* main.c (relocate_path): Likewise.
(relocate_gdb_directory): Likewise.
Diff:
---
gdb/ChangeLog | 7 +++++++
gdb/defs.h | 2 +-
gdb/main.c | 14 +++++++-------
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 40bd4d0..acfc888 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2019-09-06 Christian Biesinger <cbiesinger@google.com>
+
+ * defs.h (relocate_gdb_directory): Change int to bool in
+ signature and rename flag to relocatable.
+ * main.c (relocate_path): Likewise.
+ (relocate_gdb_directory): Likewise.
+
2019-09-06 Alan Modra <amodra@gmail.com>
* coffread.c (coff_symfile_read): Constify filename variable.
diff --git a/gdb/defs.h b/gdb/defs.h
index ece3006..14e0a3e 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -282,7 +282,7 @@ struct value;
/* This really belong in utils.c (path-utils.c?), but it references some
globals that are currently only available to main.c. */
-extern char *relocate_gdb_directory (const char *initial, int flag);
+extern char *relocate_gdb_directory (const char *initial, bool relocatable);
\f
/* Annotation stuff. */
diff --git a/gdb/main.c b/gdb/main.c
index 678c413..129c57c 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -139,14 +139,14 @@ set_gdb_data_directory (const char *new_datadir)
/* Relocate a file or directory. PROGNAME is the name by which gdb
was invoked (i.e., argv[0]). INITIAL is the default value for the
- file or directory. FLAG is true if the value is relocatable, false
- otherwise. Returns a newly allocated string; this may return NULL
- under the same conditions as make_relative_prefix. */
+ file or directory. RELOCATABLE is true if the value is relocatable,
+ false otherwise. Returns a newly allocated string; this may return
+ NULL under the same conditions as make_relative_prefix. */
static char *
-relocate_path (const char *progname, const char *initial, int flag)
+relocate_path (const char *progname, const char *initial, bool relocatable)
{
- if (flag)
+ if (relocatable)
return make_relative_prefix (progname, BINDIR, initial);
return xstrdup (initial);
}
@@ -158,11 +158,11 @@ relocate_path (const char *progname, const char *initial, int flag)
function always returns a newly-allocated string. */
char *
-relocate_gdb_directory (const char *initial, int flag)
+relocate_gdb_directory (const char *initial, bool relocatable)
{
char *dir;
- dir = relocate_path (gdb_program_name, initial, flag);
+ dir = relocate_path (gdb_program_name, initial, relocatable);
if (dir)
{
struct stat s;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-06 19:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 19:35 [binutils-gdb] Change int to bool for the relocate_* functions Christian Biesinger
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).