From 3b5742d0b972f3bea7ce1e9bc640cd5677f9d606 Mon Sep 17 00:00:00 2001 From: "M. Sean Finney" Date: Sat, 20 Jan 2007 10:59:25 +0000 Subject: [PATCH] =?utf8?q?compilation=20fixes=20for=20check=5Fntp.c:=20-?= =?utf8?q?=20check=5Fntp.c:290:=20warning:=20overflow=20in=20implicit=20co?= =?utf8?q?nstant=20conversion=20=20=20fixed=20with=20an=20explicit=20cast?= =?utf8?q?=20to=20int8=5Ft.=20-=20check=5Fntp.c:544:=20warning:=20pointer?= =?utf8?q?=20of=20type=20=C3=A2=C2=80=C2=98void=20*=C3=A2=C2=80=C2=99=20us?= =?utf8?q?ed=20in=20arithmetic=20=20=20fixed=20by=20casting=20to=20ptrdiff?= =?utf8?q?=5Ft=20before=20arithmetic=20and=20(void*)=20afterwards=20-=20in?= =?utf8?q?=20TVtoNTP64,=20cast=20arithmetic=20result=20passed=20to=20R32?= =?utf8?q?=20as=20uint64=5Ft.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1571 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_ntp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 26543f4..d6e1dd5 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); -- 2.30.2