From: Ruben Kerkhof Date: Sat, 4 Jun 2016 18:11:33 +0000 (+0200) Subject: chrony plugin: constify 2 function arguments X-Git-Tag: collectd-5.6.0~238 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=689919bee5ce3a803219b00078c276414a28f526;p=collectd.git chrony plugin: constify 2 function arguments Fixes a couple of dozen of these warnings: chrony.c:889:20: warning: passing 'const char [14]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] chrony_push_data("clock_stratum", "chrony", (__extension__ ({ unsigned short int __v, __x = (unsigned short int) (chrony_resp.body.tracking.f_stratum); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; }))); ^~~~~~~~~~~~~~~ --- diff --git a/src/chrony.c b/src/chrony.c index 6fcea705..2bfba2f6 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -674,7 +674,7 @@ ntohf(tFloat p_float) static void -chrony_push_data(char *p_type, char *p_type_inst, double p_value) +chrony_push_data(const char *p_type, const char *p_type_inst, double p_value) { value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -705,7 +705,7 @@ chrony_push_data(char *p_type, char *p_type_inst, double p_value) static void -chrony_push_data_valid(char *p_type, char *p_type_inst, const int p_is_valid, +chrony_push_data_valid(const char *p_type, const char *p_type_inst, const int p_is_valid, double p_value) { /* Push real value if p_is_valid is true, push NAN if p_is_valid is not true (idea from ntp plugin) */