Code

cpu plugin: fix compiler warning on OS X
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 18:53:33 +0000 (20:53 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 14 Aug 2016 18:54:49 +0000 (20:54 +0200)
cpu.c:593:24: warning: comparison of integers of different signs: 'int' and 'mach_msg_type_number_t' (aka 'unsigned int') [-Wsign-compare]
        for (int cpu = 0; cpu < cpu_list_len; cpu++)
                          ~~~ ^ ~~~~~~~~~~~~

src/cpu.c

index c85660593497cc8e202dc344996362227e3357b2..1ac5b4a3b94a9cea50835485befc4adf7c934b88 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -590,7 +590,7 @@ static int cpu_read (void)
 
        host_t cpu_host;
 
-       for (int cpu = 0; cpu < cpu_list_len; cpu++)
+       for (mach_msg_type_number_t cpu = 0; cpu < cpu_list_len; cpu++)
        {
                cpu_host = 0;
                cpu_info_len = PROCESSOR_BASIC_INFO_COUNT;