mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
ipc: Const correctness
This commit is contained in:
parent
d27044a18d
commit
f1432789ee
|
@ -367,7 +367,7 @@ ipc_handle_swapchain_import(volatile struct ipc_client_state *ics,
|
|||
const struct xrt_swapchain_create_info *info,
|
||||
struct ipc_arg_swapchain_from_native *args,
|
||||
uint32_t *out_id,
|
||||
xrt_graphics_buffer_handle_t *handles,
|
||||
const xrt_graphics_buffer_handle_t *handles,
|
||||
uint32_t num_handles)
|
||||
{
|
||||
xrt_result_t xret = XRT_SUCCESS;
|
||||
|
|
|
@ -149,6 +149,11 @@ class HandleType:
|
|||
self.count_arg_type + ' ')
|
||||
return (x + y for x, y in zip(types, self.arg_names))
|
||||
|
||||
@property
|
||||
def const_arg_decls(self):
|
||||
"""Get the const argument declarations for the client proxy."""
|
||||
return ("const {}".format(x) for x in self.arg_decls)
|
||||
|
||||
@property
|
||||
def handler_arg_names(self):
|
||||
"""Get the argument names for the server handler."""
|
||||
|
@ -185,7 +190,7 @@ class Call:
|
|||
args = ["struct ipc_connection *ipc_c"]
|
||||
args.extend(arg.get_func_argument_in() for arg in self.in_args)
|
||||
if self.in_handles:
|
||||
args.extend(self.in_handles.arg_decls)
|
||||
args.extend(self.in_handles.const_arg_decls)
|
||||
args.extend(arg.get_func_argument_out() for arg in self.out_args)
|
||||
if self.out_handles:
|
||||
args.extend(self.out_handles.arg_decls)
|
||||
|
@ -199,7 +204,7 @@ class Call:
|
|||
if self.out_handles:
|
||||
args.extend(self.out_handles.handler_arg_decls)
|
||||
if self.in_handles:
|
||||
args.extend(self.in_handles.arg_decls)
|
||||
args.extend(self.in_handles.const_arg_decls)
|
||||
write_decl(f, 'xrt_result_t', 'ipc_handle_' + self.name, args)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue