diff options
author | M. Sean Finney <seanius@users.sourceforge.net> | 2007-01-20 10:59:25 +0000 |
---|---|---|
committer | M. Sean Finney <seanius@users.sourceforge.net> | 2007-01-20 10:59:25 +0000 |
commit | 3b5742d0b972f3bea7ce1e9bc640cd5677f9d606 (patch) | |
tree | 181fedb478c2c0369ea4aae45765f90bd19c1170 /plugins | |
parent | 2c25c058289e2f999a2b3cff20d10f19bdea6196 (diff) | |
download | monitoring-plugins-3b5742d0b972f3bea7ce1e9bc640cd5677f9d606.tar.gz |
compilation fixes for check_ntp.c:
- check_ntp.c:290: warning: overflow in implicit constant conversion
fixed with an explicit cast to int8_t.
- check_ntp.c:544: warning: pointer of type âvoid *â used in arithmetic
fixed by casting to ptrdiff_t before arithmetic and (void*) afterwards
- in TVtoNTP64, cast arithmetic result passed to R32 as uint64_t.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1571 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_ntp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 26543f4d..d6e1dd5f 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -191,7 +191,7 @@ typedef struct { do{ if(!t.tv_usec && !t.tv_sec) n=0x0UL; \ else { \ L32(n)=htonl(t.tv_sec + EPOCHDIFF); \ - R32(n)=htonl((4294.967296*t.tv_usec)+.5); \ + R32(n)=htonl((uint64_t)((4294.967296*t.tv_usec)+.5)); \ } \ } while(0) @@ -287,7 +287,7 @@ void setup_request(ntp_message *p){ VN_SET(p->flags, 4); MODE_SET(p->flags, MODE_CLIENT); p->poll=4; - p->precision=0xfa; + p->precision=(int8_t)0xfa; L16(p->rtdelay)=htons(1); L16(p->rtdisp)=htons(1); @@ -541,7 +541,7 @@ double jitter_request(const char *host, int *status){ */ npeers+=(ntohs(req.count)/sizeof(ntp_assoc_status_pair)); peers=(ntp_assoc_status_pair*)realloc(peers, sizeof(ntp_assoc_status_pair)*npeers); - memcpy((void*)peers+peer_offset, (void*)req.data, sizeof(ntp_assoc_status_pair)*npeers); + memcpy((void*)((ptrdiff_t)peers+peer_offset), (void*)req.data, sizeof(ntp_assoc_status_pair)*npeers); peer_offset+=ntohs(req.count); } while(req.op&REM_MORE); |