aboutsummaryrefslogtreecommitdiff
path: root/render/egl.c
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-10-03 01:51:07 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-10-03 01:51:07 -0400
commit1b0694b79481643cb456d03e1be50a1b4f6ca591 (patch)
treec693c5de3ee7ebd52873f6ec063118408f0bd28a /render/egl.c
parenta09d6494397bdd28a3254d2e646212afb5a3049c (diff)
treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical
Diffstat (limited to 'render/egl.c')
-rw-r--r--render/egl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/render/egl.c b/render/egl.c
index ea743e9a..8a1e6dae 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -210,7 +210,7 @@ static struct wlr_egl *egl_create(void) {
return NULL;
}
- struct wlr_egl *egl = calloc(1, sizeof(struct wlr_egl));
+ struct wlr_egl *egl = calloc(1, sizeof(*egl));
if (egl == NULL) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
return NULL;
@@ -457,7 +457,7 @@ static EGLDeviceEXT get_egl_device_from_drm_fd(struct wlr_egl *egl,
return EGL_NO_DEVICE_EXT;
}
- EGLDeviceEXT *devices = calloc(nb_devices, sizeof(EGLDeviceEXT));
+ EGLDeviceEXT *devices = calloc(nb_devices, sizeof(*devices));
if (devices == NULL) {
wlr_log_errno(WLR_ERROR, "Failed to allocate EGL device list");
return EGL_NO_DEVICE_EXT;
@@ -807,7 +807,7 @@ static int get_egl_dmabuf_formats(struct wlr_egl *egl, EGLint **formats) {
};
int num = sizeof(fallback_formats) / sizeof(fallback_formats[0]);
- *formats = calloc(num, sizeof(EGLint));
+ *formats = calloc(num, sizeof(**formats));
if (!*formats) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
return -1;
@@ -823,7 +823,7 @@ static int get_egl_dmabuf_formats(struct wlr_egl *egl, EGLint **formats) {
return -1;
}
- *formats = calloc(num, sizeof(EGLint));
+ *formats = calloc(num, sizeof(**formats));
if (*formats == NULL) {
wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno));
return -1;
@@ -860,12 +860,12 @@ static int get_egl_dmabuf_modifiers(struct wlr_egl *egl, EGLint format,
return 0;
}
- *modifiers = calloc(num, sizeof(uint64_t));
+ *modifiers = calloc(num, sizeof(**modifiers));
if (*modifiers == NULL) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
return -1;
}
- *external_only = calloc(num, sizeof(EGLBoolean));
+ *external_only = calloc(num, sizeof(**external_only));
if (*external_only == NULL) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
free(*modifiers);
@@ -912,7 +912,7 @@ static char *get_render_name(const char *name) {
wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len));
return NULL;
}
- drmDevice **devices = calloc(devices_len, sizeof(drmDevice *));
+ drmDevice **devices = calloc(devices_len, sizeof(*devices));
if (devices == NULL) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
return NULL;