aboutsummaryrefslogtreecommitdiff
path: root/gdb/location.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-14 07:26:12 -0700
committerTom Tromey <tom@tromey.com>2022-01-18 10:00:00 -0700
commit7910e2dee3d8b5ea7f59973277baf95525c63be1 (patch)
tree2b62a86360968320c9e808e16eb2a9f068c97d46 /gdb/location.c
parentdab863ef408588aba1c396901e3e5070948d2047 (diff)
downloadgdb-7910e2dee3d8b5ea7f59973277baf95525c63be1.zip
gdb-7910e2dee3d8b5ea7f59973277baf95525c63be1.tar.gz
gdb-7910e2dee3d8b5ea7f59973277baf95525c63be1.tar.bz2
Boolify explicit_to_string_internal
This changes explicit_to_string_internal to use 'bool' rather than 'int'.
Diffstat (limited to 'gdb/location.c')
-rw-r--r--gdb/location.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/location.c b/gdb/location.c
index d4180cf..35ca2ac 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -228,14 +228,14 @@ get_explicit_location_const (const struct event_location *location)
/* This convenience function returns a malloc'd string which
represents the location in EXPLICIT_LOC.
- AS_LINESPEC is non-zero if this string should be a linespec.
+ AS_LINESPEC is true if this string should be a linespec.
Otherwise it will be output in explicit form. */
static gdb::unique_xmalloc_ptr<char>
-explicit_to_string_internal (int as_linespec,
+explicit_to_string_internal (bool as_linespec,
const struct explicit_location *explicit_loc)
{
- int need_space = 0;
+ bool need_space = false;
char space = as_linespec ? ':' : ' ';
string_file buf;
@@ -244,7 +244,7 @@ explicit_to_string_internal (int as_linespec,
if (!as_linespec)
buf.puts ("-source ");
buf.puts (explicit_loc->source_filename);
- need_space = 1;
+ need_space = true;
}
if (explicit_loc->function_name != NULL)
@@ -256,7 +256,7 @@ explicit_to_string_internal (int as_linespec,
if (!as_linespec)
buf.puts ("-function ");
buf.puts (explicit_loc->function_name);
- need_space = 1;
+ need_space = true;
}
if (explicit_loc->label_name != NULL)
@@ -266,7 +266,7 @@ explicit_to_string_internal (int as_linespec,
if (!as_linespec)
buf.puts ("-label ");
buf.puts (explicit_loc->label_name);
- need_space = 1;
+ need_space = true;
}
if (explicit_loc->line_offset.sign != LINE_OFFSET_UNKNOWN)
@@ -290,7 +290,7 @@ explicit_to_string_internal (int as_linespec,
static gdb::unique_xmalloc_ptr<char>
explicit_location_to_string (const struct explicit_location *explicit_loc)
{
- return explicit_to_string_internal (0, explicit_loc);
+ return explicit_to_string_internal (false, explicit_loc);
}
/* See description in location.h. */
@@ -298,7 +298,7 @@ explicit_location_to_string (const struct explicit_location *explicit_loc)
gdb::unique_xmalloc_ptr<char>
explicit_location_to_linespec (const struct explicit_location *explicit_loc)
{
- return explicit_to_string_internal (1, explicit_loc);
+ return explicit_to_string_internal (true, explicit_loc);
}
/* See description in location.h. */