]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3065] Quiet warnings on NetBSD
authorJuergen Perlinger <perlinger@ntp.org>
Sun, 11 Dec 2016 10:39:49 +0000 (11:39 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Sun, 11 Dec 2016 10:39:49 +0000 (11:39 +0100)
bk: 584d2cf5ap5WNR03fl--RjZqDWl12Q

ChangeLog
include/ntp_fp.h
libparse/clk_trimtsip.c
libparse/gpstolfp.c
ntpd/refclock_jjy.c
ntpd/refclock_parse.c
ntpq/ntpq.c

index 0cb8c4fb4779b249944c144baf63c35be953e531..83ab0574c796bb5055664b375d871c2565e14d53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
+---
+* [Bug 3065] Quiet warnings on NetBSD <perlinger@ntp.org>
+  - 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 <stenn@ntp.org>
-(4.2.8p9) 2016/MM/DD Released by Harlan Stenn <stenn@ntp.org>
 
 * [Sec 3119] Trap crash <perlinger@ntp.org>
 * [Sec 3118] Mode 6 information disclosure and DDoS vector <perlinger@ntp.org>
index 780693226207063b541217403f23efca849b301f..b5d28205541b34adaea88e8dca3d5b8768cdbb64 100644 (file)
@@ -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 *);
index 6c71d75627ac83ad8fe687e7f14c69fde8371a27..64359efa0b329630323bc46e9d3365208fc7924b 100644 (file)
@@ -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)
index c162429ed92a9ecfb5a424021e61105de8673e1f..8a3607514985dbc4f75183ae59ee9fe9f83fa16b 100644 (file)
@@ -39,8 +39,8 @@
 
 void
 gpstolfp(
-        int weeks,
-        int days,
+        u_int weeks,
+        u_int days,
         unsigned long  seconds,
         l_fp * lfp
         )
index f53150fc5ae2e74ed79d43a3e507dd3776bd49fa..73ff7bc02d7df060791c7eab61836afcdc6d2623 100644 (file)
@@ -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 ) ;
index aa9d2f2c68bfc597ed7c333840ca7abab3cf07f2..0697f39809eda04f600dae3fc42bf24e676f2e1a 100644 (file)
@@ -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;
index 91364de4ba8bd799308bbca83c6c57025076f34d..edcfa65edfbf94deaf3e2f9e7161af31b09ca9cb 100644 (file)
@@ -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;