diff options
author | iod1hc <toan.dinhcong@vn.bosch.com> | 2020-11-12 15:59:53 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-01-06 09:27:28 +0900 |
commit | 7e7ae6dbb5579c2e163d87ff7bcc774de459b96b (patch) | |
tree | b2e5e358ca68957073414b05287d9da679c38ea0 /src/tests/dlt-test-multi-process.c | |
parent | 699d52298bfde3ab5721a78264d5a4f4e2f326ef (diff) | |
download | DLT-daemon-7e7ae6dbb5579c2e163d87ff7bcc774de459b96b.tar.gz |
tests: fix conversion warnings
- Casting data type to the right format.
Signed-off-by: Dinh Cong Toan <Toan.DinhCong@vn.bosch.com>
Diffstat (limited to 'src/tests/dlt-test-multi-process.c')
-rw-r--r-- | src/tests/dlt-test-multi-process.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tests/dlt-test-multi-process.c b/src/tests/dlt-test-multi-process.c index 9572420..8796568 100644 --- a/src/tests/dlt-test-multi-process.c +++ b/src/tests/dlt-test-multi-process.c @@ -343,7 +343,7 @@ void do_logging(s_thread_data *data) int msgs_left = data->params.nmsgs; - logmsg = calloc(1, data->params.nloglength + 1); + logmsg = calloc(1, (size_t) (data->params.nloglength + 1)); if (logmsg == NULL) { printf("Error allocate memory for message.\n"); DLT_UNREGISTER_CONTEXT(mycontext); @@ -356,7 +356,7 @@ void do_logging(s_thread_data *data) { n = 'A' + (n - 91) % 26; } - logmsg[i] = n; + logmsg[i] = (char) n; } while (msgs_left-- > 0) { @@ -387,21 +387,21 @@ void run_threads(s_parameters params) char apid_name[256]; int i; - srand(getpid()); + srand((unsigned int) getpid()); snprintf(apid, 5, "MT%02u", pidcount); snprintf(apid_name, 256, "Apps %s.", apid); DLT_REGISTER_APP(apid, apid_name); - thread_data = calloc(params.nthreads, sizeof(s_thread_data)); + thread_data = calloc( (size_t) params.nthreads, sizeof(s_thread_data)); if (thread_data == NULL) { printf("Error allocate memory for thread data.\n"); abort(); } for (i = 0; i < params.nthreads; i++) { - thread_data[i].tidcount = i; + thread_data[i].tidcount = (unsigned int) i; thread_data[i].params = params; thread_data[i].pidcount = pidcount; @@ -427,7 +427,7 @@ void run_threads(s_parameters params) */ int wait_for_death() { - int pids_left = pidcount; + int pids_left = (int) pidcount; while (pids_left > 0) { int status; |