From: Jan Safranek Date: Thu, 6 Aug 2009 12:03:32 +0000 (+0200) Subject: Remove warnings from test_functions.c X-Git-Tag: v0.35~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba948c63f487789e8c3e8478c0edeb15ff716214;p=thirdparty%2Flibcgroup.git Remove warnings from test_functions.c Fix following warnings: test_functions.c: In function ‘group_modified’: test_functions.c:435: warning: format ‘%d’ expects type ‘int *’, but argument 3 has type ‘_Bool *’ test_functions.c:440: warning: format ‘%lld’ expects type ‘long long int *’, but argument 3 has type ‘int64_t *’ test_functions.c:445: warning: format ‘%llu’ expects type ‘long long unsigned int *’, but argument 3 has type ‘u_int64_t *’ Signed-off-by: Jan Safranek Signed-off-by: Dhaval Giani --- diff --git a/tests/libcgrouptest.h b/tests/libcgrouptest.h index 923828ac..98b1ba9c 100644 --- a/tests/libcgrouptest.h +++ b/tests/libcgrouptest.h @@ -30,6 +30,7 @@ #include #include "../config.h" #include +#include #define SIZE 100 /* Max size of a message to be printed */ #define NUM_MSGS 20 /* Number of such messsages */ diff --git a/tests/test_functions.c b/tests/test_functions.c index 80e4e901..d9ca88ec 100644 --- a/tests/test_functions.c +++ b/tests/test_functions.c @@ -421,6 +421,7 @@ int group_modified(char *path_control_file, int value_type, char string_val[100]; FILE *fd; int error = 1; + int aux; fd = fopen(path_control_file, "r"); if (!fd) { @@ -432,17 +433,18 @@ int group_modified(char *path_control_file, int value_type, switch (value_type) { case BOOL: - fscanf(fd, "%d", &bool_val); + fscanf(fd, "%d", &aux); + bool_val = aux; if (bool_val == cval.val_bool) error = 0; break; case INT64: - fscanf(fd, "%lld", &int64_val); + fscanf(fd, "%" SCNi64, &int64_val); if (int64_val == cval.val_int64) error = 0; break; case UINT64: - fscanf(fd, "%llu", &uint64_val); + fscanf(fd, "%" SCNu64, &uint64_val); if (uint64_val == cval.val_uint64) error = 0; break;