From d139ebae8fd3d545f586470ff04008f311e47c12 Mon Sep 17 00:00:00 2001
From: adnano <me@adnano.co>
Date: Thu, 28 Dec 2023 11:59:02 -0500
Subject: pool-buffer: Fix type conversion issues

---
 pool-buffer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'pool-buffer.c')

diff --git a/pool-buffer.c b/pool-buffer.c
index aca95a1..a4cf513 100644
--- a/pool-buffer.c
+++ b/pool-buffer.c
@@ -68,19 +68,19 @@ static const struct wl_buffer_listener buffer_listener = {
 static struct pool_buffer *create_buffer(struct wl_shm *shm,
 		struct pool_buffer *buf, int32_t width, int32_t height,
 		int32_t scale, uint32_t format) {
-	uint32_t stride = width * scale * 4;
-	size_t size = stride * height * scale;
+	int32_t stride = width * scale * 4;
+	int32_t size = stride * height * scale;
 
 	int fd = create_shm_file(size);
 	assert(fd != -1);
-	void *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+	void *data = mmap(NULL, (size_t)size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, size);
 	buf->buffer = wl_shm_pool_create_buffer(pool, 0,
 			width * scale, height * scale, stride, format);
 	wl_shm_pool_destroy(pool);
 	close(fd);
 
-	buf->size = size;
+	buf->size = (size_t)size;
 	buf->width = width;
 	buf->height = height;
 	buf->scale = scale;
-- 
cgit v1.2.3