[Git][NTPsec/ntpsec][master] 2 commits: Fix to work on NetBSD
Hal Murray
gitlab at mg.gitlab.com
Sun Dec 6 12:41:45 UTC 2015
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
ed54fa3a by Hal Murray at 2015-12-06T04:39:59Z
Fix to work on NetBSD
- - - - -
2a81e6b8 by Hal Murray at 2015-12-06T04:40:26Z
More compiler warnings, mostly from NetBSD
- - - - -
6 changed files:
- include/parse.h
- libntp/audio.c
- ntpd/refclock_acts.c
- ntpd/refclock_jjy.c
- ntpq/ntpq.c
- pylib/check_timepps.py
Changes:
=====================================
include/parse.h
=====================================
--- a/include/parse.h
+++ b/include/parse.h
@@ -34,7 +34,7 @@
/*
* some constants useful for GPS time conversion
*/
-#define GPSORIGIN 2524953600 /* NTP origin - GPS origin in seconds */
+#define GPSORIGIN 2524953600u /* GPS origin - NTP origin in seconds */
#define GPSWRAP 990 /* assume week count less than this in the previous epoch */
#define GPSWEEKS 1024 /* number of weeks until the GPS epch rolls over */
=====================================
libntp/audio.c
=====================================
--- a/libntp/audio.c
+++ b/libntp/audio.c
@@ -46,9 +46,6 @@
/*
* Global variables
*/
-#ifdef HAVE_SYS_AUDIOIO_H
-static struct audio_device device; /* audio device ident */
-#endif /* HAVE_SYS_AUDIOIO_H */
#ifdef USE_PCM_STYLE_SOUND
# define INIT_FILE "/etc/ntp.audio"
int agc = SOUND_MIXER_WRITE_RECLEV; /* or IGAIN or LINE */
@@ -481,6 +478,7 @@ audio_show(void)
#else /* not USE_PCM_STYLE_SOUND */
# ifdef HAVE_SYS_AUDIOIO_H
+ struct audio_device device; /* audio device ident */
ioctl(ctl_fd, (int)AUDIO_GETDEV, &device);
printf("audio: name %s, version %s, config %s\n",
device.name, device.version, device.config);
=====================================
ntpd/refclock_acts.c
=====================================
--- a/ntpd/refclock_acts.c
+++ b/ntpd/refclock_acts.c
@@ -381,7 +381,7 @@ acts_message(
*/
strlcpy(tbuf, msg, sizeof(tbuf));
for (cp = tbuf; cp < tbuf + sizeof(tbuf); cp++)
- if (isspace(*cp))
+ if (isspace((int)*cp))
*cp = '\0';
switch (up->state) {
=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -661,7 +661,7 @@ jjy_receive ( struct recvbuf *rbufp )
up->iLineBufLen ++ ;
/* Copy printable characters */
- if ( ! iscntrl( up->sRawBuf[i] ) ) {
+ if ( ! iscntrl( (int)up->sRawBuf[i] ) ) {
up->sTextBuf[up->iTextBufLen] = up->sRawBuf[i] ;
up->iTextBufLen ++ ;
}
@@ -2691,7 +2691,7 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up )
iNumberOfDigitsOfPhoneNumber = iCommaCount = iCommaPosition = iFirstThreeDigitsCount = 0 ;
for ( i = 0 ; i < strlen( sys_phone[0] ) ; i ++ ) {
- if ( isdigit( *(sys_phone[0]+i) ) ) {
+ if ( isdigit( (int)*(sys_phone[0]+i) ) ) {
if ( iFirstThreeDigitsCount < (int)sizeof(sFirstThreeDigits)-1 ) {
sFirstThreeDigits[iFirstThreeDigitsCount++] = *(sys_phone[0]+i) ;
}
=====================================
ntpq/ntpq.c
=====================================
--- a/ntpq/ntpq.c
+++ b/ntpq/ntpq.c
@@ -3378,7 +3378,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((int)*cp) )
return;
}
len = (cp - name) + 1;
=====================================
pylib/check_timepps.py
=====================================
--- a/pylib/check_timepps.py
+++ b/pylib/check_timepps.py
@@ -5,6 +5,7 @@ TIMEPPS_FRAG = """
# include <timepps.h>
#else
# ifdef HAVE_SYS_TIMEPPS_H
+# include <sys/time.h> /* Needed on NetBSD */
# include <sys/timepps.h>
# endif
#endif
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/88a8be7027d0442ec9c6db7bcd0c3061f6789378...2a81e6b8b60f4e0360faaf8d8d611b4aff97ffb2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151206/500fed12/attachment.html>
More information about the vc
mailing list