[patch 03/11] fix format to use correct types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes

In file included from libstats_test.c:1:
../include/libstats.h: In function 'stats_hist_print':
../include/libstats.h:207: warning: format '%d' expects type 'int', but argument 2 has type 'long int'
../include/libstats.h:207: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
../include/libstats.h:207: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
../include/libstats.h:209: warning: format '%d' expects type 'int', but argument 2 has type 'long int'
../include/libstats.h:209: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
../include/libstats.h: In function 'stats_container_save':
../include/libstats.h:245: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
../include/libstats.h:245: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
make[1]: *** [libstats_test-libstats_test.o] Error 1

Signed-off-by: Robert Schwebel <r.schwebel@xxxxxxxxxxxxxx>

 include/libstats.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: include/libstats.h
===================================================================
--- include/libstats.h.orig
+++ include/libstats.h
@@ -203,10 +203,10 @@ void stats_hist_print(stats_container_t 
 	for (i = 0; i < hist->size; i++) {
 		x = hist->records[i].x;
 		if (i < hist->size-1)
-			printf("[%d,%d) = %d\n", x, 
+			printf("[%ld,%ld) = %ld\n", x, 
 				hist->records[i+1].x, hist->records[i].y);
 		else
-			printf("[%d,-) = %d\n", x, hist->records[i].y);
+			printf("[%ld,-) = %ld\n", x, hist->records[i].y);
 	}
 }
 
@@ -242,7 +242,7 @@ int stats_container_save(char *filename,
             maxx = MAX(maxx, rec->x);            
             miny = MIN(miny, rec->y);            
             maxy = MAX(maxy, rec->y);            
-            fprintf(dat_fd, "%d %d\n", rec->x, rec->y);
+            fprintf(dat_fd, "%ld %ld\n", rec->x, rec->y);
         }
         fclose(dat_fd);
     } 

--
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

-
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux