aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradnano <me@adnano.co>2023-12-28 11:59:02 -0500
committeradnano <me@adnano.co>2023-12-28 11:59:02 -0500
commitd139ebae8fd3d545f586470ff04008f311e47c12 (patch)
tree201ae0fadc9e0b26d4875fbe5b62bef536fc2260
parent69a7078e019261b26c31b61724a0f3bc517ab624 (diff)
downloadwmenu-d139ebae8fd3d545f586470ff04008f311e47c12.tar.gz
pool-buffer: Fix type conversion issues
-rw-r--r--pool-buffer.c8
1 files changed, 4 insertions, 4 deletions
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;