This is an automated email from the ASF dual-hosted git repository.
marko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 021b924 trng_test: fix compile time warnings
021b924 is described below
commit 021b92469769d6444b775921682df4e6dc6ec84f
Author: Naveen Kaje <[email protected]>
AuthorDate: Thu Sep 26 11:14:12 2019 -0500
trng_test: fix compile time warnings
While building for simulator on Linux, the following warnings were
observed.
******************************************************************
error: format ‘%ld’ expects argument of type ‘long int’, \
but argument 2 has type ‘uint32_t {aka unsigned int}’ \
[-Werror=format=] console_printf("monobit: (%ld/%d) %f, \
block4: (%ld/%d) %f, block8: (%ld/%d) %f\n",
******************************************************************
Cast blksz, monobit_fails, block4_fails and block8_fails variables
when using in console_printf().
This change builds makes the test compatible for the simulator as well
as da1469x-dk-pro.
Signed-off-by: Naveen Kaje <[email protected]>
---
apps/trng_test/src/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/trng_test/src/main.c b/apps/trng_test/src/main.c
index a162aae..1d20a9e 100755
--- a/apps/trng_test/src/main.c
+++ b/apps/trng_test/src/main.c
@@ -218,10 +218,10 @@ main(void)
}
if (failed) {
- console_printf("monobit: (%ld/%d) %f, block4: (%ld/%d) %f,
block8: (%ld/%d) %f\n",
- blksz, monobit_fails, ((float)blksz - monobit_fails) /
blksz,
- blksz, block4_fails, ((float)blksz - block4_fails) /
blksz,
- blksz, block8_fails, ((float)blksz - block8_fails) /
blksz);
+ console_printf("monobit: (%u/%u) %f, block4: (%u/%u) %f,
block8: (%u/%u) %f\n",
+ (unsigned int)blksz, (unsigned int)monobit_fails,
((float)blksz - monobit_fails) / blksz,
+ (unsigned int)blksz, (unsigned int)block4_fails,
((float)blksz - block4_fails) / blksz,
+ (unsigned int)blksz, (unsigned int)block8_fails,
((float)blksz - block8_fails) / blksz);
}
idx = 0;