Return unique_xmalloc_ptr from gdbscm_scm_to_string

This changes gdbscm_scm_to_string to return a unique_xmalloc_ptr and
then fixes all the callers.  This allows for the removal of some
cleanups.

gdb/ChangeLog
2018-07-17  Tom Tromey  <tom@tromey.com>

	* guile/scm-param.c (pascm_set_func, pascm_show_func)
	(compute_enum_list, pascm_set_param_value_x)
	(gdbscm_parameter_value): Update.
	* guile/guile-internal.h (gdbscm_scm_to_string): Update.
	(gdbscm_scm_to_host_string): Update.
	* guile/scm-math.c (vlscm_convert_typed_value_from_scheme):
	Update.
	* guile/scm-cmd.c (cmdscm_add_completion): Update.
	* guile/scm-pretty-print.c (ppscm_print_string_repr): Update.
	* guile/scm-string.c (gdbscm_scm_to_string): Return
	unique_xmalloc_ptr.
	(gdbscm_scm_to_host_string): Likewise.
This commit is contained in:
Tom Tromey 2018-05-26 23:34:02 -06:00
parent a1a31cb8dc
commit c6c6149af4
7 changed files with 51 additions and 53 deletions

View file

@ -526,14 +526,14 @@ extern SCM gdbscm_scm_from_c_string (const char *string);
extern SCM gdbscm_scm_from_printf (const char *format, ...)
ATTRIBUTE_PRINTF (1, 2);
extern char *gdbscm_scm_to_string (SCM string, size_t *lenp,
const char *charset,
int strict, SCM *except_scmp);
extern gdb::unique_xmalloc_ptr<char> gdbscm_scm_to_string
(SCM string, size_t *lenp, const char *charset, int strict, SCM *except_scmp);
extern SCM gdbscm_scm_from_string (const char *string, size_t len,
const char *charset, int strict);
extern char *gdbscm_scm_to_host_string (SCM string, size_t *lenp, SCM *except);
extern gdb::unique_xmalloc_ptr<char> gdbscm_scm_to_host_string
(SCM string, size_t *lenp, SCM *except);
extern SCM gdbscm_scm_from_host_string (const char *string, size_t len);