guile: Add as_a_scm_t_subr

Building GDB in C++ mode on Fedora 20, the gdb/guile/ code shows ~280
errors like:

 src/gdb/guile/guile.c:515:1: error: invalid conversion from ‘scm_unused_struct* (*)(SCM, SCM) {aka scm_unused_struct* (*)(scm_unused_struct*, scm_unused_struct*)}’ to ‘scm_t_subr {aka void*}’ [-fpermissive]

This commit fixes them all.

gdb/ChangeLog:
2015-09-07  Pedro Alves  <palves@redhat.com>

	* guile/guile-internal.h (as_a_scm_t_subr): New.
	* guile/guile.c (misc_guile_functions): Use it.
	* guile/scm-arch.c (arch_functions): Use it.
	* guile/scm-block.c (block_functions, gdbscm_initialize_blocks):
	Use it.
	* guile/scm-breakpoint.c (breakpoint_functions): Use it.
	* guile/scm-cmd.c (command_functions): Use it.
	* guile/scm-disasm.c (disasm_functions): Use it.
	* guile/scm-exception.c (exception_functions)
	(private_exception_functions): Use it.
	* guile/scm-frame.c (frame_functions)
	* guile/scm-gsmob.c (gsmob_functions): Use it.
	* guile/scm-iterator.c (iterator_functions): Use it.
	* guile/scm-lazy-string.c (lazy_string_functions): Use it.
	* guile/scm-math.c (math_functions): Use it.
	* guile/scm-objfile.c (objfile_functions): Use it.
	* guile/scm-param.c (parameter_functions): Use it.
	* guile/scm-ports.c (port_functions, private_port_functions): Use
	it.
	* guile/scm-pretty-print.c (pretty_printer_functions): Use it.
	* guile/scm-progspace.c (pspace_functions): Use it.
	* guile/scm-string.c (string_functions): Use it.
	* guile/scm-symbol.c (symbol_functions): Use it.
	* guile/scm-symtab.c (symtab_functions): Use it.
	* guile/scm-type.c (type_functions, gdbscm_initialize_types): Use
	it.
	* guile/scm-value.c (value_functions): Use it.
This commit is contained in:
Pedro Alves
2015-09-07 19:34:31 +01:00
parent 3d4fde6974
commit 72e0248351
24 changed files with 401 additions and 280 deletions

View File

@@ -1341,42 +1341,43 @@ static const scheme_integer_constant type_integer_constants[] =
static const scheme_function type_functions[] =
{
{ "type?", 1, 0, 0, gdbscm_type_p,
{ "type?", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_p),
"\
Return #t if the object is a <gdb:type> object." },
{ "lookup-type", 1, 0, 1, gdbscm_lookup_type,
{ "lookup-type", 1, 0, 1, as_a_scm_t_subr (gdbscm_lookup_type),
"\
Return the <gdb:type> object representing string or #f if not found.\n\
If block is given then the type is looked for in that block.\n\
\n\
Arguments: string [#:block <gdb:block>]" },
{ "type-code", 1, 0, 0, gdbscm_type_code,
{ "type-code", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_code),
"\
Return the code of the type" },
{ "type-tag", 1, 0, 0, gdbscm_type_tag,
{ "type-tag", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_tag),
"\
Return the tag name of the type, or #f if there isn't one." },
{ "type-name", 1, 0, 0, gdbscm_type_name,
{ "type-name", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_name),
"\
Return the name of the type as a string, or #f if there isn't one." },
{ "type-print-name", 1, 0, 0, gdbscm_type_print_name,
{ "type-print-name", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_print_name),
"\
Return the print name of the type as a string." },
{ "type-sizeof", 1, 0, 0, gdbscm_type_sizeof,
{ "type-sizeof", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_sizeof),
"\
Return the size of the type, in bytes." },
{ "type-strip-typedefs", 1, 0, 0, gdbscm_type_strip_typedefs,
{ "type-strip-typedefs", 1, 0, 0,
as_a_scm_t_subr (gdbscm_type_strip_typedefs),
"\
Return a type formed by stripping the type of all typedefs." },
{ "type-array", 2, 1, 0, gdbscm_type_array,
{ "type-array", 2, 1, 0, as_a_scm_t_subr (gdbscm_type_array),
"\
Return a type representing an array of objects of the type.\n\
\n\
@@ -1386,7 +1387,7 @@ Return a type representing an array of objects of the type.\n\
the array size.\n\
Valid bounds for array indices are [low-bound,high-bound]." },
{ "type-vector", 2, 1, 0, gdbscm_type_vector,
{ "type-vector", 2, 1, 0, as_a_scm_t_subr (gdbscm_type_vector),
"\
Return a type representing a vector of objects of the type.\n\
Vectors differ from arrays in that if the current language has C-style\n\
@@ -1399,87 +1400,88 @@ They are first class values.\n\
the array size.\n\
Valid bounds for array indices are [low-bound,high-bound]." },
{ "type-pointer", 1, 0, 0, gdbscm_type_pointer,
{ "type-pointer", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_pointer),
"\
Return a type of pointer to the type." },
{ "type-range", 1, 0, 0, gdbscm_type_range,
{ "type-range", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_range),
"\
Return (low high) representing the range for the type." },
{ "type-reference", 1, 0, 0, gdbscm_type_reference,
{ "type-reference", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_reference),
"\
Return a type of reference to the type." },
{ "type-target", 1, 0, 0, gdbscm_type_target,
{ "type-target", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_target),
"\
Return the target type of the type." },
{ "type-const", 1, 0, 0, gdbscm_type_const,
{ "type-const", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_const),
"\
Return a const variant of the type." },
{ "type-volatile", 1, 0, 0, gdbscm_type_volatile,
{ "type-volatile", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_volatile),
"\
Return a volatile variant of the type." },
{ "type-unqualified", 1, 0, 0, gdbscm_type_unqualified,
{ "type-unqualified", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_unqualified),
"\
Return a variant of the type without const or volatile attributes." },
{ "type-num-fields", 1, 0, 0, gdbscm_type_num_fields,
{ "type-num-fields", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_num_fields),
"\
Return the number of fields of the type." },
{ "type-fields", 1, 0, 0, gdbscm_type_fields,
{ "type-fields", 1, 0, 0, as_a_scm_t_subr (gdbscm_type_fields),
"\
Return the list of <gdb:field> objects of fields of the type." },
{ "make-field-iterator", 1, 0, 0, gdbscm_make_field_iterator,
{ "make-field-iterator", 1, 0, 0,
as_a_scm_t_subr (gdbscm_make_field_iterator),
"\
Return a <gdb:iterator> object for iterating over the fields of the type." },
{ "type-field", 2, 0, 0, gdbscm_type_field,
{ "type-field", 2, 0, 0, as_a_scm_t_subr (gdbscm_type_field),
"\
Return the field named by string of the type.\n\
\n\
Arguments: <gdb:type> string" },
{ "type-has-field?", 2, 0, 0, gdbscm_type_has_field_p,
{ "type-has-field?", 2, 0, 0, as_a_scm_t_subr (gdbscm_type_has_field_p),
"\
Return #t if the type has field named string.\n\
\n\
Arguments: <gdb:type> string" },
{ "field?", 1, 0, 0, gdbscm_field_p,
{ "field?", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_p),
"\
Return #t if the object is a <gdb:field> object." },
{ "field-name", 1, 0, 0, gdbscm_field_name,
{ "field-name", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_name),
"\
Return the name of the field." },
{ "field-type", 1, 0, 0, gdbscm_field_type,
{ "field-type", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_type),
"\
Return the type of the field." },
{ "field-enumval", 1, 0, 0, gdbscm_field_enumval,
{ "field-enumval", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_enumval),
"\
Return the enum value represented by the field." },
{ "field-bitpos", 1, 0, 0, gdbscm_field_bitpos,
{ "field-bitpos", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_bitpos),
"\
Return the offset in bits of the field in its containing type." },
{ "field-bitsize", 1, 0, 0, gdbscm_field_bitsize,
{ "field-bitsize", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_bitsize),
"\
Return the size of the field in bits." },
{ "field-artificial?", 1, 0, 0, gdbscm_field_artificial_p,
{ "field-artificial?", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_artificial_p),
"\
Return #t if the field is artificial." },
{ "field-baseclass?", 1, 0, 0, gdbscm_field_baseclass_p,
{ "field-baseclass?", 1, 0, 0, as_a_scm_t_subr (gdbscm_field_baseclass_p),
"\
Return #t if the field is a baseclass." },
@@ -1504,7 +1506,7 @@ gdbscm_initialize_types (void)
/* This function is "private". */
tyscm_next_field_x_proc
= scm_c_define_gsubr ("%type-next-field!", 1, 0, 0,
gdbscm_type_next_field_x);
as_a_scm_t_subr (gdbscm_type_next_field_x));
scm_set_procedure_property_x (tyscm_next_field_x_proc,
gdbscm_documentation_symbol,
gdbscm_scm_from_c_string ("\