summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c56c817)
raw | patch | inline | side by side (parent: c56c817)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 4 Jun 2016 18:11:33 +0000 (20:11 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 4 Jun 2016 18:11:33 +0000 (20:11 +0200) |
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; })));
^~~~~~~~~~~~~~~
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; })));
^~~~~~~~~~~~~~~
src/chrony.c | patch | blob | history |
diff --git a/src/chrony.c b/src/chrony.c
index 6fcea705fbe4c5425367e5dedd707dc1801ad2d2..2bfba2f60b2f58ba67e81ae1b39311c8f64f97dd 100644 (file)
--- a/src/chrony.c
+++ b/src/chrony.c
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;
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) */