Make internal generated marshaller functions static

This commit is contained in:
Alexander Larsson 2010-06-22 16:03:02 +02:00 committed by Marc-André Lureau
parent 2523cec8c4
commit 9f3a36f3f9
2 changed files with 4 additions and 4 deletions

View File

@ -149,7 +149,7 @@ def write_validate_struct_function(writer, struct):
writer.set_is_generated("validator", validate_function)
writer = writer.function_helper()
scope = writer.function(validate_function, "intptr_t", "uint8_t *message_start, uint8_t *message_end, SPICE_ADDRESS offset, int minor")
scope = writer.function(validate_function, "static intptr_t", "uint8_t *message_start, uint8_t *message_end, SPICE_ADDRESS offset, int minor")
scope.variable_def("uint8_t *", "start = message_start + offset")
scope.variable_def("SPICE_GNUC_UNUSED uint8_t *", "pos");
scope.variable_def("size_t", "mem_size", "nw_size");
@ -661,7 +661,7 @@ def write_parse_ptr_function(writer, target_type):
writer.set_is_generated("parser", parse_function)
writer = writer.function_helper()
scope = writer.function(parse_function, "uint8_t *", "uint8_t *message_start, uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info, int minor")
scope = writer.function(parse_function, "static uint8_t *", "uint8_t *message_start, uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info, int minor")
scope.variable_def("uint8_t *", "in = message_start + this_ptr_info->offset")
scope.variable_def("uint8_t *", "end")
@ -932,7 +932,7 @@ def write_channel_parser(writer, channel, server):
function_name = "parse_%s_msgc" % channel.name
writer.newline()
scope = writer.function(function_name,
"uint8_t *",
"static uint8_t *",
"uint8_t *message_start, uint8_t *message_end, uint16_t message_type, int minor, size_t *size_out, message_destructor_t *free_message")
helpers = writer.function_helper()

View File

@ -115,7 +115,7 @@ def write_marshal_ptr_function(writer, target_type):
writer.header = header
writer.out_prefix = ""
if target_type.is_array():
scope = writer.function(marshal_function, "void *", "SpiceMarshaller *m, %s_t *ptr, int count" % target_type.element_type.primitive_type() + names_args)
scope = writer.function(marshal_function, "SPICE_GNUC_UNUSED static void *", "SpiceMarshaller *m, %s_t *ptr, int count" % target_type.element_type.primitive_type() + names_args)
else:
scope = writer.function(marshal_function, "void *", "SpiceMarshaller *m, %s *ptr" % target_type.c_type() + names_args)
header.writeln("void *" + marshal_function + "(SpiceMarshaller *m, %s *msg" % target_type.c_type() + names_args + ");")