Fix sparse warnings and add an extra sprinkling of const.
[tinc] / src / uml_socket / device.c
index 3523f64..a2da757 100644 (file)
@@ -23,6 +23,7 @@
 #include <sys/un.h>
 
 #include "conf.h"
 #include <sys/un.h>
 
 #include "conf.h"
+#include "device.h"
 #include "net.h"
 #include "logger.h"
 #include "utils.h"
 #include "net.h"
 #include "logger.h"
 #include "utils.h"
@@ -41,8 +42,8 @@ static char *device_info;
 extern char *identname;
 extern bool running;
 
 extern char *identname;
 extern bool running;
 
-static int device_total_in = 0;
-static int device_total_out = 0;
+static uint64_t device_total_in = 0;
+static uint64_t device_total_out = 0;
 
 enum request_type { REQ_NEW_CONTROL };
 
 
 enum request_type { REQ_NEW_CONTROL };
 
@@ -272,6 +273,6 @@ bool write_packet(vpn_packet_t *packet) {
 
 void dump_device_stats(void) {
        logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
 
 void dump_device_stats(void) {
        logger(LOG_DEBUG, "Statistics for %s %s:", device_info, device);
-       logger(LOG_DEBUG, " total bytes in:  %10d", device_total_in);
-       logger(LOG_DEBUG, " total bytes out: %10d", device_total_out);
+       logger(LOG_DEBUG, " total bytes in:  %10"PRIu64, device_total_in);
+       logger(LOG_DEBUG, " total bytes out: %10"PRIu64, device_total_out);
 }
 }