From: Seunghun Lee Date: Thu, 25 Aug 2022 09:08:32 +0000 (+0900) Subject: allocator/shm: Cast int to size_t to avoid warning X-Git-Tag: accepted/tizen/unified/20220829.062544~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F280253%2F1;p=platform%2Fcore%2Fuifw%2Flibds.git allocator/shm: Cast int to size_t to avoid warning Change-Id: I1b5f9fefb99222d7f150743acd5c03b8a1e9e12c --- diff --git a/src/allocator/shm.c b/src/allocator/shm.c index 3fad474..96a0210 100644 --- a/src/allocator/shm.c +++ b/src/allocator/shm.c @@ -128,7 +128,7 @@ shm_allocator_create_buffer(struct ds_allocator *ds_allocator, int width, int height, uint32_t format) { struct ds_shm_buffer *buffer; - int bytes_per_pixel, stride; + size_t bytes_per_pixel, stride; buffer = calloc(1, sizeof *buffer); if (!buffer) @@ -138,8 +138,8 @@ shm_allocator_create_buffer(struct ds_allocator *ds_allocator, // FIXME bytes_per_pixel = 4; - stride = width * bytes_per_pixel; - buffer->size = stride * height; + stride = (size_t)width * bytes_per_pixel; + buffer->size = stride * (size_t)height; buffer->shm.fd = allocate_shm_file(buffer->size); if (buffer->shm.fd < 0) { free(buffer);