Thread (15 messages) 15 messages, 2 authors, 2007-03-29
STALE7053d

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

From: Robert Schwebel <hidden>
Date: 2007-03-24 12:16:54

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 <redacted>

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help