aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-05-04 18:17:55 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-05-11 03:51:01 -0400
commite427e019c46bc1d04cbe75e00106e4c96785bf68 (patch)
treea8b21e37ab38cface69276751b652a037d415431
parente6879616e731e6bc2109fbe50610c8c606e8228a (diff)
wlr_drm_format: Don't take double pointer in wlr_drm_format_add
-rw-r--r--include/render/drm_format_set.h2
-rw-r--r--render/drm_format_set.c8
-rw-r--r--types/output/swapchain.c2
3 files changed, 5 insertions, 7 deletions
diff --git a/include/render/drm_format_set.h b/include/render/drm_format_set.h
index 9d78b2b1..8614d0b9 100644
--- a/include/render/drm_format_set.h
+++ b/include/render/drm_format_set.h
@@ -5,7 +5,7 @@
struct wlr_drm_format *wlr_drm_format_create(uint32_t format);
bool wlr_drm_format_has(const struct wlr_drm_format *fmt, uint64_t modifier);
-bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier);
+bool wlr_drm_format_add(struct wlr_drm_format *fmt, uint64_t modifier);
struct wlr_drm_format *wlr_drm_format_dup(const struct wlr_drm_format *format);
/**
* Intersect modifiers for two DRM formats.
diff --git a/render/drm_format_set.c b/render/drm_format_set.c
index 6b917193..2412144c 100644
--- a/render/drm_format_set.c
+++ b/render/drm_format_set.c
@@ -61,14 +61,14 @@ bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
struct wlr_drm_format **ptr = format_set_get_ref(set, format);
if (ptr) {
- return wlr_drm_format_add(ptr, modifier);
+ return wlr_drm_format_add(*ptr, modifier);
}
struct wlr_drm_format *fmt = wlr_drm_format_create(format);
if (!fmt) {
return false;
}
- if (!wlr_drm_format_add(&fmt, modifier)) {
+ if (!wlr_drm_format_add(fmt, modifier)) {
wlr_drm_format_finish(fmt);
return false;
}
@@ -114,9 +114,7 @@ bool wlr_drm_format_has(const struct wlr_drm_format *fmt, uint64_t modifier) {
return false;
}
-bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier) {
- struct wlr_drm_format *fmt = *fmt_ptr;
-
+bool wlr_drm_format_add(struct wlr_drm_format *fmt, uint64_t modifier) {
if (wlr_drm_format_has(fmt, modifier)) {
return true;
}
diff --git a/types/output/swapchain.c b/types/output/swapchain.c
index a284579e..8db454e2 100644
--- a/types/output/swapchain.c
+++ b/types/output/swapchain.c
@@ -38,7 +38,7 @@ static struct wlr_swapchain *create_swapchain(struct wlr_output *output,
}
format->len = 0;
- wlr_drm_format_add(&format, DRM_FORMAT_MOD_INVALID);
+ wlr_drm_format_add(format, DRM_FORMAT_MOD_INVALID);
}
struct wlr_swapchain *swapchain = wlr_swapchain_create(allocator, width, height, format);