summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-09-08 10:38:54 +0200
committerSimon Ser <contact@emersion.fr>2022-09-13 18:01:57 +0000
commit2d5acfa5c3f4a184072171b0ed9673abd55a9496 (patch)
tree4727fc49ee9602cff24beaea2905c1ed8115c3ff
parent7d78ea5628d5da8f05bb279a06f8169151da4f9b (diff)
downloadwayland-2d5acfa5c3f4a184072171b0ed9673abd55a9496.tar.gz
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>
-rw-r--r--cursor/wayland-cursor.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/cursor/wayland-cursor.c b/cursor/wayland-cursor.c
index 3518aa4..156f0a8 100644
--- a/cursor/wayland-cursor.c
+++ b/cursor/wayland-cursor.c
@@ -151,32 +151,32 @@ struct cursor {
* the returned 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 wl_cursor_theme *theme = image->theme;
+ struct cursor_image *img = (struct cursor_image *) image;
+ struct wl_cursor_theme *theme = img->theme;
- if (!image->buffer) {
- image->buffer =
+ if (!img->buffer) {
+ img->buffer =
wl_shm_pool_create_buffer(theme->pool->pool,
- image->offset,
- _img->width, _img->height,
- _img->width * 4,
+ img->offset,
+ image->width, image->height,
+ image->width * 4,
WL_SHM_FORMAT_ARGB8888);
};
- return image->buffer;
+ return img->buffer;
}
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)
- wl_buffer_destroy(image->buffer);
+ if (img->buffer)
+ wl_buffer_destroy(img->buffer);
- free(image);
+ free(img);
}
static void
@@ -461,21 +461,21 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
* given time in the cursor animation.
*/
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)
{
- struct cursor *cursor = (struct cursor *) _cursor;
+ struct cursor *cur = (struct cursor *) cursor;
uint32_t t;
int i;
- if (cursor->cursor.image_count == 1 || cursor->total_delay == 0) {
+ if (cur->cursor.image_count == 1 || cur->total_delay == 0) {
if (duration)
*duration = 0;
return 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
* 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
* "fix" this.
*/
- while (t - cursor->cursor.images[i]->delay < t)
- t -= cursor->cursor.images[i++]->delay;
+ while (t - cur->cursor.images[i]->delay < t)
+ t -= cur->cursor.images[i++]->delay;
if (!duration)
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
* a static cursor image.
*/
- if (t >= cursor->cursor.images[i]->delay)
+ if (t >= cur->cursor.images[i]->delay)
*duration = 1;
else
- *duration = cursor->cursor.images[i]->delay - t;
+ *duration = cur->cursor.images[i]->delay - t;
return i;
}
@@ -510,7 +510,7 @@ wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time,
* given time in the cursor animation.
*/
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);
}