diff options
author | iod1hc <toan.dinhcong@vn.bosch.com> | 2020-11-05 19:29:45 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-01-06 09:27:28 +0900 |
commit | 699d52298bfde3ab5721a78264d5a4f4e2f326ef (patch) | |
tree | d1f59052c1f77e860971fec19032333907d58c22 /src/daemon/dlt_daemon_event_handler.c | |
parent | 2e8dade01beef3d8b6e6b812690c1f64d3408ce2 (diff) | |
download | DLT-daemon-699d52298bfde3ab5721a78264d5a4f4e2f326ef.tar.gz |
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 <toan.dinhcong@vn.bosch.com>
Diffstat (limited to 'src/daemon/dlt_daemon_event_handler.c')
-rw-r--r-- | src/daemon/dlt_daemon_event_handler.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |