mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-31 07:11:27 -04:00
cursor: convert macros to functions
Improves readability since there's no need for so many parentheses anymore, adds type safety. The compiler will inline the function automatically as necessary. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
bcfcd49232
commit
963014459c
1 changed files with 16 additions and 3 deletions
|
|
@ -379,7 +379,11 @@ xcursor_file_read_chunk_header(struct xcursor_file *file,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define dist(a,b) ((a) > (b) ? (a) - (b) : (b) - (a))
|
static uint32_t
|
||||||
|
dist(uint32_t a, uint32_t b)
|
||||||
|
{
|
||||||
|
return a > b ? a - b : b - a;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
xcursor_file_best_size(struct xcursor_file_header *fileHeader,
|
xcursor_file_best_size(struct xcursor_file_header *fileHeader,
|
||||||
|
|
@ -728,8 +732,17 @@ xcursor_next_path(const char *path)
|
||||||
return colon + 1;
|
return colon + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define xcursor_white(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
|
static bool
|
||||||
#define xcursor_sep(c) ((c) == ';' || (c) == ',')
|
xcursor_white(char c)
|
||||||
|
{
|
||||||
|
return c == ' ' || c == '\t' || c == '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
xcursor_sep(char c)
|
||||||
|
{
|
||||||
|
return c == ';' || c == ',';
|
||||||
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
xcursor_theme_inherits(const char *full)
|
xcursor_theme_inherits(const char *full)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue