Make ada-lang.c::add_angle_brackets return an std::string
This removes the need for manual memory management. It may also be a bit more efficient, since the returned string can be moved all the way into the destination, in ada_lookup_name_info::matches. gdb/ChangeLog: * ada-lang.c (add_angle_brackets): Return std::string.
This commit is contained in:
parent
3d9c8f6b3f
commit
39e7af3e4b
2 changed files with 7 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2018-08-26 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
|
* ada-lang.c (add_angle_brackets): Return std::string.
|
||||||
|
|
||||||
2018-08-25 Simon Marchi <simon.marchi@polymtl.ca>
|
2018-08-25 Simon Marchi <simon.marchi@polymtl.ca>
|
||||||
|
|
||||||
* python/py-threadevent.c (py_get_event_thread): Initialize
|
* python/py-threadevent.c (py_get_event_thread): Initialize
|
||||||
|
|
|
@ -541,17 +541,12 @@ ada_unqualified_name (const char *decoded_name)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a string starting with '<', followed by STR, and '>'.
|
/* Return a string starting with '<', followed by STR, and '>'. */
|
||||||
The result is good until the next call. */
|
|
||||||
|
|
||||||
static char *
|
static std::string
|
||||||
add_angle_brackets (const char *str)
|
add_angle_brackets (const char *str)
|
||||||
{
|
{
|
||||||
static char *result = NULL;
|
return string_printf ("<%s>", str);
|
||||||
|
|
||||||
xfree (result);
|
|
||||||
result = xstrprintf ("<%s>", str);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue