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 c856605..1ac5b4a 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;