]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Remove warnings from test_functions.c
authorJan Safranek <jsafrane@redhat.com>
Thu, 6 Aug 2009 12:03:32 +0000 (14:03 +0200)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Sat, 29 Aug 2009 05:20:25 +0000 (10:50 +0530)
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 <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
tests/libcgrouptest.h
tests/test_functions.c

index 923828ac8eeafce8c11d11cea6b6f2eab924db76..98b1ba9ce6b6274c85b90761ad20e918af0c5a29 100644 (file)
@@ -30,6 +30,7 @@
 #include <libcgroup.h>
 #include "../config.h"
 #include <unistd.h>
+#include <inttypes.h>
 
 #define SIZE 100       /* Max size of a message to be printed */
 #define NUM_MSGS 20    /* Number of such messsages */
index 80e4e9017039cc895544abb9cdcc4c9094b84b8d..d9ca88ec7e3428c233a8c52141389cbac7e4074d 100644 (file)
@@ -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;