processes plugin: const correctness
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 3 Jun 2018 22:25:33 +0000 (00:25 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 3 Jun 2018 22:25:33 +0000 (00:25 +0200)
src/processes.c: In function ‘ps_submit_proc_list’:
src/processes.c:915:8: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       {"delay-cpu", ps->delay_cpu},
        ^~~~~~~~~~~
src/processes.c:916:8: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       {"delay-blkio", ps->delay_blkio},
        ^~~~~~~~~~~~~
src/processes.c:917:8: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       {"delay-swapin", ps->delay_swapin},
        ^~~~~~~~~~~~~~
src/processes.c:918:8: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       {"delay-freepages", ps->delay_freepages},
        ^~~~~~~~~~~~~~~~~

src/processes.c

index ffe6c5a..86e99c3 100644 (file)
@@ -909,7 +909,7 @@ static void ps_submit_proc_list(procstat_t *ps) {
   gauge_t const delay_factor = 1000000000.0;
 
   struct {
-    char *type_instance;
+    const char *type_instance;
     gauge_t rate_ns;
   } delay_metrics[] = {
       {"delay-cpu", ps->delay_cpu},