cursor: make param names match with documentation

There was a mismatch here.

Use a good-looking function param name because that's what will
show up in docs. Use an abbreviation inside the function.

Fixes the following warnings:

    cursor/wayland-cursor.c:504: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time)
    cursor/wayland-cursor.c:504: warning: The following parameter of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time) is not documented:
      parameter '_cursor'
    cursor/wayland-cursor.c:452: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration)
    cursor/wayland-cursor.c:452: warning: The following parameter of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration) is not documented:
      parameter '_cursor'
    cursor/wayland-cursor.c:147: warning: argument 'image' of command @param is not found in the argument list of wl_cursor_image_get_buffer(struct wl_cursor_image *_img)
    cursor/wayland-cursor.c:147: warning: The following parameter of wl_cursor_image_get_buffer(struct wl_cursor_image *_img) is not documented:
      parameter '_img'
    cursor/wayland-cursor.c:504: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time)
    cursor/wayland-cursor.c:504: warning: The following parameter of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time) is not documented:
      parameter '_cursor'
    cursor/wayland-cursor.c:452: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration)
    cursor/wayland-cursor.c:452: warning: The following parameter of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration) is not documented:
      parameter '_cursor'
    cursor/wayland-cursor.c:147: warning: argument 'image' of command @param is not found in the argument list of wl_cursor_image_get_buffer(struct wl_cursor_image *_img)
    cursor/wayland-cursor.c:147: warning: The following parameter of wl_cursor_image_get_buffer(struct wl_cursor_image *_img) is not documented:
      parameter '_img'

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2022-09-08 10:38:54 +02:00
parent 7d78ea5628
commit 2d5acfa5c3

View File

@ -151,32 +151,32 @@ struct cursor {
* the returned buffer. * the returned buffer.
*/ */
WL_EXPORT struct wl_buffer * WL_EXPORT struct wl_buffer *
wl_cursor_image_get_buffer(struct wl_cursor_image *_img) wl_cursor_image_get_buffer(struct wl_cursor_image *image)
{ {
struct cursor_image *image = (struct cursor_image *) _img; struct cursor_image *img = (struct cursor_image *) image;
struct wl_cursor_theme *theme = image->theme; struct wl_cursor_theme *theme = img->theme;
if (!image->buffer) { if (!img->buffer) {
image->buffer = img->buffer =
wl_shm_pool_create_buffer(theme->pool->pool, wl_shm_pool_create_buffer(theme->pool->pool,
image->offset, img->offset,
_img->width, _img->height, image->width, image->height,
_img->width * 4, image->width * 4,
WL_SHM_FORMAT_ARGB8888); WL_SHM_FORMAT_ARGB8888);
}; };
return image->buffer; return img->buffer;
} }
static void static void
wl_cursor_image_destroy(struct wl_cursor_image *_img) wl_cursor_image_destroy(struct wl_cursor_image *image)
{ {
struct cursor_image *image = (struct cursor_image *) _img; struct cursor_image *img = (struct cursor_image *) image;
if (image->buffer) if (img->buffer)
wl_buffer_destroy(image->buffer); wl_buffer_destroy(img->buffer);
free(image); free(img);
} }
static void static void
@ -461,21 +461,21 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
* given time in the cursor animation. * given time in the cursor animation.
*/ */
WL_EXPORT int WL_EXPORT int
wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, wl_cursor_frame_and_duration(struct wl_cursor *cursor, uint32_t time,
uint32_t *duration) uint32_t *duration)
{ {
struct cursor *cursor = (struct cursor *) _cursor; struct cursor *cur = (struct cursor *) cursor;
uint32_t t; uint32_t t;
int i; int i;
if (cursor->cursor.image_count == 1 || cursor->total_delay == 0) { if (cur->cursor.image_count == 1 || cur->total_delay == 0) {
if (duration) if (duration)
*duration = 0; *duration = 0;
return 0; return 0;
} }
i = 0; i = 0;
t = time % cursor->total_delay; t = time % cur->total_delay;
/* If there is a 0 delay in the image set then this /* If there is a 0 delay in the image set then this
* loop breaks on it and we display that cursor until * loop breaks on it and we display that cursor until
@ -484,8 +484,8 @@ wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time,
* seen one in a cursor file, we haven't bothered to * seen one in a cursor file, we haven't bothered to
* "fix" this. * "fix" this.
*/ */
while (t - cursor->cursor.images[i]->delay < t) while (t - cur->cursor.images[i]->delay < t)
t -= cursor->cursor.images[i++]->delay; t -= cur->cursor.images[i++]->delay;
if (!duration) if (!duration)
return i; return i;
@ -493,10 +493,10 @@ wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time,
/* Make sure we don't accidentally tell the caller this is /* Make sure we don't accidentally tell the caller this is
* a static cursor image. * a static cursor image.
*/ */
if (t >= cursor->cursor.images[i]->delay) if (t >= cur->cursor.images[i]->delay)
*duration = 1; *duration = 1;
else else
*duration = cursor->cursor.images[i]->delay - t; *duration = cur->cursor.images[i]->delay - t;
return i; return i;
} }
@ -510,7 +510,7 @@ wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time,
* given time in the cursor animation. * given time in the cursor animation.
*/ */
WL_EXPORT int WL_EXPORT int
wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time) wl_cursor_frame(struct wl_cursor *cursor, uint32_t time)
{ {
return wl_cursor_frame_and_duration(_cursor, time, NULL); return wl_cursor_frame_and_duration(cursor, time, NULL);
} }