From: Juergen Perlinger Date: Sun, 11 Dec 2016 10:39:49 +0000 (+0100) Subject: [Bug 3065] Quiet warnings on NetBSD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6529846c42c97cf9246b623fd9d17826a1870d58;p=thirdparty%2Fntp.git [Bug 3065] Quiet warnings on NetBSD bk: 584d2cf5ap5WNR03fl--RjZqDWl12Q --- diff --git a/ChangeLog b/ChangeLog index 0cb8c4fb4..83ab0574c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ +--- +* [Bug 3065] Quiet warnings on NetBSD + - applied some of the patches provided by Harvard. Not all of them + still match the current code base, and I did not touch libopt. + --- (4.2.8p9) 2016/11/21 Released by Harlan Stenn -(4.2.8p9) 2016/MM/DD Released by Harlan Stenn * [Sec 3119] Trap crash * [Sec 3118] Mode 6 information disclosure and DDoS vector diff --git a/include/ntp_fp.h b/include/ntp_fp.h index 780693226..b5d282055 100644 --- a/include/ntp_fp.h +++ b/include/ntp_fp.h @@ -352,7 +352,7 @@ extern int buftvtots (const char *, l_fp *); extern char * fptoa (s_fp, short); extern char * fptoms (s_fp, short); extern int hextolfp (const char *, l_fp *); -extern void gpstolfp (int, int, unsigned long, l_fp *); +extern void gpstolfp (u_int, u_int, unsigned long, l_fp *); extern int mstolfp (const char *, l_fp *); extern char * prettydate (l_fp *); extern char * gmprettydate (l_fp *); diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c index 6c71d7562..64359efa0 100644 --- a/libparse/clk_trimtsip.c +++ b/libparse/clk_trimtsip.c @@ -250,10 +250,10 @@ cvt_trimtsip( { case CMD_RCURTIME: { /* GPS time */ - l_fp secs; - int week = getshort((unsigned char *)&mb(4)); - l_fp utcoffset; - l_fp gpstime; + l_fp secs; + u_int week = getshort((unsigned char *)&mb(4)); + l_fp utcoffset; + l_fp gpstime; bp = &mb(0); if (fetch_ieee754(&bp, IEEE_SINGLE, &secs, trim_offsets) != IEEE_OK) diff --git a/libparse/gpstolfp.c b/libparse/gpstolfp.c index c162429ed..8a3607514 100644 --- a/libparse/gpstolfp.c +++ b/libparse/gpstolfp.c @@ -39,8 +39,8 @@ void gpstolfp( - int weeks, - int days, + u_int weeks, + u_int days, unsigned long seconds, l_fp * lfp ) diff --git a/ntpd/refclock_jjy.c b/ntpd/refclock_jjy.c index f53150fc5..73ff7bc02 100644 --- a/ntpd/refclock_jjy.c +++ b/ntpd/refclock_jjy.c @@ -592,7 +592,7 @@ jjy_receive ( struct recvbuf *rbufp ) l_fp tRecvTimestamp; /* arrival timestamp */ int rc ; char *pBuf, sLogText [ MAX_LOGTEXT ] ; - int iLen, iCopyLen ; + size_t iLen, iCopyLen ; int i, j, iReadRawBuf, iBreakPosition ; /* @@ -2688,8 +2688,9 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up ) { char sLog [ 80 ], sFirstThreeDigits [ 4 ] ; - int i, iNumberOfDigitsOfPhoneNumber, iCommaCount, iCommaPosition ; - int iFirstThreeDigitsCount ; + int iNumberOfDigitsOfPhoneNumber, iCommaCount, iCommaPosition ; + size_t i ; + size_t iFirstThreeDigitsCount ; jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: Telephone JJY" ) ; @@ -3823,7 +3824,7 @@ modem_receive ( struct recvbuf *rbufp ) struct jjyunit *up; struct refclockproc *pp; char *pBuf ; - int iLen ; + size_t iLen ; #ifdef DEBUG static const char *sFunctionName = "modem_receive" ; @@ -3857,11 +3858,11 @@ modem_receive ( struct recvbuf *rbufp ) #ifdef DEBUG if ( debug ) { char sResp [ 40 ] ; - int iCopyLen ; + size_t iCopyLen ; iCopyLen = ( iLen <= sizeof(sResp)-1 ? iLen : sizeof(sResp)-1 ) ; strncpy( sResp, pBuf, iLen <= sizeof(sResp)-1 ? iLen : sizeof(sResp)-1 ) ; sResp[iCopyLen] = 0 ; - printf ( "refclock_jjy.c : modem_receive : iLen=%d pBuf=[%s] iModemEvent=%d\n", iCopyLen, sResp, up->iModemEvent ) ; + printf ( "refclock_jjy.c : modem_receive : iLen=%zu pBuf=[%s] iModemEvent=%d\n", iCopyLen, sResp, up->iModemEvent ) ; } #endif modem_control ( peer, pp, up ) ; diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index aa9d2f2c6..0697f3980 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -4226,13 +4226,13 @@ parse_process( static void mk_utcinfo( - char *t, // pointer to the output string buffer - int wnt, - int wnlsf, + char *t, /* pointer to the output string buffer */ + uint16_t wnt, + uint16_t wnlsf, int dn, int dtls, int dtlsf, - int size // size of the output string buffer + int size /* size of the output string buffer */ ) { /* @@ -4261,7 +4261,7 @@ mk_utcinfo( + GPS_SEC_BIAS - 1; tm = gmtime( &t_ls ); - if (tm == NULL) // gmtime() failed + if (tm == NULL) /* gmtime() failed */ { snprintf( t, size, "** (gmtime() failed in mk_utcinfo())" ); return; diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 91364de4b..edcfa65ed 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -374,7 +374,7 @@ u_int numassoc; /* number of cached associations */ /* * For commands typed on the command line (with the -c option) */ -int numcmds = 0; +size_t numcmds = 0; const char *ccmds[MAXCMDS]; #define ADDCMD(cp) if (numcmds < MAXCMDS) ccmds[numcmds++] = (cp) @@ -458,7 +458,7 @@ ntpqmain( ) { u_int ihost; - int icmd; + size_t icmd; #ifdef SYS_VXWORKS @@ -3595,7 +3595,7 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void * /* Lowercase names aren't accepted by keytype_from_text in ssl_init.c */ for( cp = name; *cp; cp++ ) { - if( islower(*cp) ) + if( islower((unsigned int)*cp) ) return; } len = (cp - name) + 1;