Patchwork fs-tests: test_1: fix compilation warnings

login
register
mail settings
Submitter Artem Bityutskiy
Date March 24, 2011, 8:25 a.m.
Message ID <1300955153-4626-1-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/88143/
State Accepted
Commit 1895b7b9eacd27112fd1fbeb7d10e67ffeae5041
Headers show

Comments

Artem Bityutskiy - March 24, 2011, 8:25 a.m.
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Fix the following compilation warnings:
test_1.c: In function ‘test_1’:
test_1.c:67:4: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
test_1.c:88:3: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’

The fix is to cast the argument with (unsigned long long).

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 tests/fs-tests/simple/test_1.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/tests/fs-tests/simple/test_1.c b/tests/fs-tests/simple/test_1.c
index 69eafe4..79fd0b9 100644
--- a/tests/fs-tests/simple/test_1.c
+++ b/tests/fs-tests/simple/test_1.c
@@ -64,7 +64,7 @@  void test_1(void)
 	/* Create files to file up the file system */
 	for (block = 1000000, i = 1; ; block /= 10) {
 		while (i != 0) {
-			sprintf(name, "fill_up_%llu", i);
+			sprintf(name, "fill_up_%llu", (unsigned long long)i);
 			actual_size = tests_create_file(name, block);
 			if (actual_size != 0)
 				++i;
@@ -85,7 +85,7 @@  void test_1(void)
 	i -= 1;
 	CHECK(tests_count_files_in_dir(".") == i);
 	for (; i > 0; --i) {
-		sprintf(name, "fill_up_%llu", i);
+		sprintf(name, "fill_up_%llu", (unsigned long long)i);
 		tests_check_filled_file(name);
 		tests_delete_file(name);
 	}