From 699d52298bfde3ab5721a78264d5a4f4e2f326ef Mon Sep 17 00:00:00 2001 From: iod1hc Date: Thu, 5 Nov 2020 19:29:45 +0700 Subject: daemon: fix conversion warnings - Instead of casting frequently, change the data type of 'to_remove' to 'uint32_t' for the correct format, also adding temp variable to check return value. - Change data type of 2 variable 'offset' and 'sizecont' to 'size_t' (dlt_daemon_client.c), because these variable using many time with function 'sizeof', and they was used as local variable so it will not effect dlt library. Signed-off-by: Dinh Cong Toan --- src/daemon/dlt_daemon_event_handler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/daemon/dlt_daemon_event_handler.c') diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c index 0d463da..6c33d23 100644 --- a/src/daemon/dlt_daemon_event_handler.c +++ b/src/daemon/dlt_daemon_event_handler.c @@ -109,8 +109,8 @@ int dlt_daemon_prepare_event_handling(DltEventHandler *ev) static void dlt_event_handler_enable_fd(DltEventHandler *ev, int fd, int mask) { if (ev->max_nfds <= ev->nfds) { - int i = ev->nfds; - int max = 2 * ev->max_nfds; + int i = (int) ev->nfds; + int max = (int) (2 * ev->max_nfds); struct pollfd *tmp = realloc(ev->pfd, max * sizeof(*ev->pfd)); if (!tmp) { @@ -143,7 +143,7 @@ static void dlt_event_handler_disable_fd(DltEventHandler *ev, int fd) { unsigned int i = 0; unsigned int j = 0; - unsigned int nfds = ev->nfds; + unsigned int nfds = (unsigned int) ev->nfds; for (; i < nfds; i++, j++) { if (ev->pfd[i].fd == fd) { -- cgit v1.2.1