Explorar o código

check_disk.c: Fix many format warnings

See,

check_disk.c: In function ‘main’:
check_disk.c:319:62: warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
         printf ("For %s, used_pct=%g free_pct=%g used_units=%i free_units=%i total_units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
                                                             ~^
                                                             %li
           me->me_mountdir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
                                                              ~~~~~~~~~~~~~~~~~
check_disk.c:319:76: warning: format ‘%i’ expects argument of type ‘int’, but argument 6 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
  printf ("For %s, used_pct=%g free_pct=%g used_units=%i free_units=%i total_units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
                                                                    ~^
                                                                    %li
    me->me_mountdir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
                                                                          ~~~~~~~~~~~~~~~~~
check_disk.c:319:91: warning: format ‘%i’ expects argument of type ‘int’, but argument 7 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 s, used_pct=%g free_pct=%g used_units=%i free_units=%i total_units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
                                                                    ~^
                                                                    %li
 dir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
                                                                              ~~~~~~~~~~~~~~~~~~
check_disk.c:319:152: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 10 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
                                                                  ~~~^
                                                                  %lu
 h->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
                                                                                             ~~~~~~~~~~~~~~~~~
check_disk.c:319:162: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 11 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 s=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
                                                                        ~~~^
                                                                        %lu
 free_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
                                                                                                            ~~~~
check_disk.c: In function ‘get_stats’:
check_disk.c:1008:39: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
           printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                    ~~~^
                                    %lu
                  p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                                 ~~~~~~~~~~~~~~~~~
check_disk.c:1008:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
           printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                      ~~~^
                                                      %lu
                  p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                                                    ~~~~~~~~~~~~~~~~~~~~
check_disk.c:1008:77: warning: format ‘%i’ expects argument of type ‘int’, but argument 6 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
   printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                                    ~^
                                                                    %li
          p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                                                                                                   ~~~~~~~~~~~~~~~~~~~
check_disk.c:1008:91: warning: format ‘%i’ expects argument of type ‘int’, but argument 7 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 p %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                                    ~^
                                                                    %li
 t->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                                                                                                          ~~~~~~~~~~~~~~~~~~~
check_disk.c:1008:106: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 lu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                                    ~^
                                                                    %li
check_disk.c:1010:18:
 , mult);

check_disk.c:1008:125: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 9 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 u, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                                  ~~~^
                                                                  %lu
check_disk.c:1010:40:

check_disk.c:1008:135: warning: format ‘%llu’ expects a matching ‘long long unsigned int’ argument [-Wformat=]
 %s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                                                                        ~~~^
check_disk.c:1029:48: warning: unknown conversion type character ‘ ’ in format [-Wformat=]
         printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                                                ^
check_disk.c:1029:62: warning: unknown conversion type character ‘ ’ in format [-Wformat=]
         printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                                                              ^
check_disk.c:1029:77: warning: unknown conversion type character ‘ ’ in format [-Wformat=]
 printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                                                                     ^
check_disk.c:1029:95: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 ow has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                                                                  ~~~^
                                                                  %lu
 mpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p->best_match->me_mountdir, p->dused_units,
 ~~~~~~~~~~~~~~~~
check_disk.c:1029:105: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uintmax_t’ {aka ‘long unsigned int’} [-Wformat=]
 as: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                                                                        ~~~^
                                                                        %lu
 p.fsu_bavail, tmpfsp.fsu_blocksize, p->best_match->me_mountdir, p->dused_units,
               ~~~~~~~~~~~~~~~~~~~~
check_disk.c:1029:16: warning: too many arguments for format [-Wformat-extra-args]
         printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mario Trangoni %!s(int64=7) %!d(string=hai) anos
pai
achega
cc9843fe50
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      plugins/check_disk.c

+ 3 - 4
plugins/check_disk.c

@@ -316,7 +316,7 @@ main (int argc, char **argv)
       get_stats (path, &fsp);
 
       if (verbose >= 3) {
-        printf ("For %s, used_pct=%g free_pct=%g used_units=%i free_units=%i total_units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
+        printf ("For %s, used_pct=%g free_pct=%g used_units=%li free_units=%li total_units=%li used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%lu mult=%lu\n",
           me->me_mountdir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
       }
 
@@ -1005,7 +1005,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
         get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp);
         get_path_stats(p_list, &tmpfsp); 
         if (verbose >= 3)
-          printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
+          printf("Group %s: adding %lu blocks sized %lu, (%s) used_units=%li free_units=%li total_units=%li fsu_blocksize=%lu mult=%lu\n",
                  p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                  p_list->dtotal_units, mult);
 
@@ -1016,7 +1016,6 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
           p->available += p_list->available;
           p->available_to_root += p_list->available_to_root;
           p->used += p_list->used;
-            
           p->dused_units += p_list->dused_units;
           p->dfree_units += p_list->dfree_units;
           p->dtotal_units += p_list->dtotal_units;
@@ -1026,7 +1025,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
         first = 0;
       }
       if (verbose >= 3) 
-        printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
+        printf("Group %s now has: used_units=%li free_units=%li total_units=%li fsu_blocksize=%lu mult=%lu\n",
                p->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p->best_match->me_mountdir, p->dused_units,
                p->dfree_units, p->dtotal_units, mult);
     }