Use struct initializers instead of memset()

This is a bit more type-safe.
This commit is contained in:
Simon Ser 2023-07-07 14:34:56 +02:00
parent 4966857f21
commit 7a9f8d8d6b
34 changed files with 134 additions and 113 deletions

View file

@ -86,8 +86,9 @@ bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
}
void wlr_drm_format_init(struct wlr_drm_format *fmt, uint32_t format) {
memset(fmt, 0, sizeof(*fmt));
fmt->format = format;
*fmt = (struct wlr_drm_format){
.format = format,
};
}
bool wlr_drm_format_has(const struct wlr_drm_format *fmt, uint64_t modifier) {