From ef73893222e95c415387882f2c90c7cc88a341cb Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 16 Apr 2020 00:11:16 +0200 Subject: shm: fix warnings Change-Id: I0e56539f699c39ab6e3546c96973184552da4d5f --- Transceiver52M/device/ipc/shm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Transceiver52M/device/ipc/shm.c b/Transceiver52M/device/ipc/shm.c index 41de233..76f6151 100644 --- a/Transceiver52M/device/ipc/shm.c +++ b/Transceiver52M/device/ipc/shm.c @@ -8,7 +8,7 @@ /* Convert offsets to pointers */ struct ipc_shm_stream *ipc_shm_decode_stream(void *tall_ctx, struct ipc_shm_raw_region *root_raw, struct ipc_shm_raw_stream *stream_raw) { - int i; + unsigned int i; struct ipc_shm_stream *stream; stream = talloc_zero(tall_ctx, struct ipc_shm_stream); stream = talloc_zero_size(tall_ctx, sizeof(struct ipc_shm_stream) + @@ -38,7 +38,7 @@ struct ipc_shm_channel *ipc_shm_decode_channel(void *tall_ctx, struct ipc_shm_ra } struct ipc_shm_region *ipc_shm_decode_region(void *tall_ctx, struct ipc_shm_raw_region *root_raw) { - int i; + unsigned int i; struct ipc_shm_region *root; root = talloc_zero_size(tall_ctx, sizeof(struct ipc_shm_region) + sizeof(struct ipc_shm_channel*) * root_raw->num_chans); @@ -66,8 +66,8 @@ unsigned int ipc_shm_encode_smpl_buf(struct ipc_shm_raw_region *root_raw, struct unsigned int ipc_shm_encode_stream(struct ipc_shm_raw_region *root_raw, struct ipc_shm_raw_stream *stream_raw, uint32_t num_buffers, uint32_t buffer_size) { - int i; uint8_t* start = (uint8_t*)stream_raw; + unsigned int i; unsigned int offset = sizeof(struct ipc_shm_raw_stream) + sizeof(uint32_t)*num_buffers; fprintf(stderr, "encode: stream at offset %lu\n", (start - (uint8_t*)root_raw)); @@ -103,8 +103,8 @@ unsigned int ipc_shm_encode_channel(struct ipc_shm_raw_region *root_raw, struct /* if root_raw is NULL, then do a dry run, aka only calculate final offset */ unsigned int ipc_shm_encode_region(struct ipc_shm_raw_region *root_raw, uint32_t num_chans, uint32_t num_buffers, uint32_t buffer_size) { - int i; uint8_t* start = (uint8_t*)root_raw; + unsigned i; unsigned int offset = sizeof(struct ipc_shm_raw_region) + sizeof(uint32_t)*num_chans; if (root_raw) -- cgit v1.2.3