mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
server: add const qualifier to function arguments where possible
Makes it possible to e.g. `call wl_client_get_credentials` with a `const struct wl_client *` from a global filter callback. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
parent
597a6b94f5
commit
bdba21ec92
3 changed files with 19 additions and 18 deletions
|
|
@ -227,7 +227,7 @@ typedef void (*wl_global_bind_func_t)(struct wl_client *client, void *data,
|
||||||
uint32_t version, uint32_t id);
|
uint32_t version, uint32_t id);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
wl_display_get_serial(struct wl_display *display);
|
wl_display_get_serial(const struct wl_display *display);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
wl_display_next_serial(struct wl_display *display);
|
wl_display_next_serial(struct wl_display *display);
|
||||||
|
|
@ -324,7 +324,7 @@ void
|
||||||
wl_client_flush(struct wl_client *client);
|
wl_client_flush(struct wl_client *client);
|
||||||
|
|
||||||
void
|
void
|
||||||
wl_client_get_credentials(struct wl_client *client,
|
wl_client_get_credentials(const struct wl_client *client,
|
||||||
pid_t *pid, uid_t *uid, gid_t *gid);
|
pid_t *pid, uid_t *uid, gid_t *gid);
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -586,7 +586,7 @@ void
|
||||||
wl_resource_destroy(struct wl_resource *resource);
|
wl_resource_destroy(struct wl_resource *resource);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
wl_resource_get_id(struct wl_resource *resource);
|
wl_resource_get_id(const struct wl_resource *resource);
|
||||||
|
|
||||||
struct wl_list *
|
struct wl_list *
|
||||||
wl_resource_get_link(struct wl_resource *resource);
|
wl_resource_get_link(struct wl_resource *resource);
|
||||||
|
|
@ -607,7 +607,7 @@ void *
|
||||||
wl_resource_get_user_data(struct wl_resource *resource);
|
wl_resource_get_user_data(struct wl_resource *resource);
|
||||||
|
|
||||||
int
|
int
|
||||||
wl_resource_get_version(struct wl_resource *resource);
|
wl_resource_get_version(const struct wl_resource *resource);
|
||||||
|
|
||||||
void
|
void
|
||||||
wl_resource_set_destructor(struct wl_resource *resource,
|
wl_resource_set_destructor(struct wl_resource *resource,
|
||||||
|
|
@ -617,8 +617,9 @@ int
|
||||||
wl_resource_instance_of(struct wl_resource *resource,
|
wl_resource_instance_of(struct wl_resource *resource,
|
||||||
const struct wl_interface *interface,
|
const struct wl_interface *interface,
|
||||||
const void *implementation);
|
const void *implementation);
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
wl_resource_get_class(struct wl_resource *resource);
|
wl_resource_get_class(const struct wl_resource *resource);
|
||||||
|
|
||||||
void
|
void
|
||||||
wl_resource_add_destroy_listener(struct wl_resource *resource,
|
wl_resource_add_destroy_listener(struct wl_resource *resource,
|
||||||
|
|
@ -654,16 +655,16 @@ void *
|
||||||
wl_shm_buffer_get_data(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_get_data(struct wl_shm_buffer *buffer);
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_get_stride(const struct wl_shm_buffer *buffer);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
wl_shm_buffer_get_format(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_get_format(const struct wl_shm_buffer *buffer);
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
wl_shm_buffer_get_width(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_get_width(const struct wl_shm_buffer *buffer);
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
wl_shm_buffer_get_height(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_get_height(const struct wl_shm_buffer *buffer);
|
||||||
|
|
||||||
struct wl_shm_pool *
|
struct wl_shm_pool *
|
||||||
wl_shm_buffer_ref_pool(struct wl_shm_buffer *buffer);
|
wl_shm_buffer_ref_pool(struct wl_shm_buffer *buffer);
|
||||||
|
|
|
||||||
|
|
@ -619,7 +619,7 @@ err_client:
|
||||||
* \memberof wl_client
|
* \memberof wl_client
|
||||||
*/
|
*/
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
wl_client_get_credentials(struct wl_client *client,
|
wl_client_get_credentials(const struct wl_client *client,
|
||||||
pid_t *pid, uid_t *uid, gid_t *gid)
|
pid_t *pid, uid_t *uid, gid_t *gid)
|
||||||
{
|
{
|
||||||
if (pid)
|
if (pid)
|
||||||
|
|
@ -799,7 +799,7 @@ wl_resource_destroy(struct wl_resource *resource)
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT uint32_t
|
WL_EXPORT uint32_t
|
||||||
wl_resource_get_id(struct wl_resource *resource)
|
wl_resource_get_id(const struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
return resource->object.id;
|
return resource->object.id;
|
||||||
}
|
}
|
||||||
|
|
@ -853,7 +853,7 @@ wl_resource_get_user_data(struct wl_resource *resource)
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT int
|
WL_EXPORT int
|
||||||
wl_resource_get_version(struct wl_resource *resource)
|
wl_resource_get_version(const struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
return resource->version;
|
return resource->version;
|
||||||
}
|
}
|
||||||
|
|
@ -900,7 +900,7 @@ wl_resource_get_destroy_listener(struct wl_resource *resource,
|
||||||
* \memberof wl_resource
|
* \memberof wl_resource
|
||||||
*/
|
*/
|
||||||
WL_EXPORT const char *
|
WL_EXPORT const char *
|
||||||
wl_resource_get_class(struct wl_resource *resource)
|
wl_resource_get_class(const struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
return resource->object.interface->name;
|
return resource->object.interface->name;
|
||||||
}
|
}
|
||||||
|
|
@ -1496,7 +1496,7 @@ wl_global_set_user_data(struct wl_global *global, void *data)
|
||||||
* \memberof wl_display
|
* \memberof wl_display
|
||||||
*/
|
*/
|
||||||
WL_EXPORT uint32_t
|
WL_EXPORT uint32_t
|
||||||
wl_display_get_serial(struct wl_display *display)
|
wl_display_get_serial(const struct wl_display *display)
|
||||||
{
|
{
|
||||||
return display->serial;
|
return display->serial;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ wl_shm_buffer_get(struct wl_resource *resource)
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT int32_t
|
WL_EXPORT int32_t
|
||||||
wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer)
|
wl_shm_buffer_get_stride(const struct wl_shm_buffer *buffer)
|
||||||
{
|
{
|
||||||
return buffer->stride;
|
return buffer->stride;
|
||||||
}
|
}
|
||||||
|
|
@ -479,19 +479,19 @@ wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT uint32_t
|
WL_EXPORT uint32_t
|
||||||
wl_shm_buffer_get_format(struct wl_shm_buffer *buffer)
|
wl_shm_buffer_get_format(const struct wl_shm_buffer *buffer)
|
||||||
{
|
{
|
||||||
return buffer->format;
|
return buffer->format;
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT int32_t
|
WL_EXPORT int32_t
|
||||||
wl_shm_buffer_get_width(struct wl_shm_buffer *buffer)
|
wl_shm_buffer_get_width(const struct wl_shm_buffer *buffer)
|
||||||
{
|
{
|
||||||
return buffer->width;
|
return buffer->width;
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT int32_t
|
WL_EXPORT int32_t
|
||||||
wl_shm_buffer_get_height(struct wl_shm_buffer *buffer)
|
wl_shm_buffer_get_height(const struct wl_shm_buffer *buffer)
|
||||||
{
|
{
|
||||||
return buffer->height;
|
return buffer->height;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue