From f7cba3a80d9ebefc57776fffd17a4ae68f72e494 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Thu, 5 Feb 2015 20:53:33 +0000 Subject: Vendor import ntp-4.2.8p1. Approved by: roberto --- libparse/Makefile.am | 32 ++++++++++++++++++++++++++++++-- libparse/Makefile.in | 32 ++++++++++++++++++++++++++++++-- libparse/clk_meinberg.c | 2 +- libparse/clk_rawdcf.c | 20 ++++++++++---------- libparse/data_mbg.c | 6 +++--- libparse/info_trimble.c | 6 +++--- libparse/mkinfo_rcmd.sed | 2 +- libparse/mkinfo_scmd.sed | 2 +- 8 files changed, 79 insertions(+), 23 deletions(-) (limited to 'libparse') diff --git a/libparse/Makefile.am b/libparse/Makefile.am index a92db1546cbf..2988e08e2bc2 100644 --- a/libparse/Makefile.am +++ b/libparse/Makefile.am @@ -1,5 +1,5 @@ NULL= -BUILT_SOURCES = +BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) CLEANFILES = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a @@ -12,6 +12,29 @@ K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS # previously. It is located in $(srcdir) and any updates must # end up there. +# +# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as +# BSD make) to work around build/dependency issues where we want +# built source files to live in srcdir, as opposed to builddir. +# + +if VPATH_HACK +VPHACK= vphack +VPHACK_AFTER= vphack_after +else +VPHACK= +VPHACK_AFTER= +endif + +vphack: + test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + +vphack_after: + test -L info_trimble.c || ( \ + mv info_trimble.c $(srcdir)/info_trimble.c && \ + ln -s $(srcdir)/info_trimble.c . \ + ) + libparse_a_SOURCES = parse.c \ parse_conf.c \ clk_meinberg.c \ @@ -65,11 +88,16 @@ AM_CPPFLAGS += $(CPPFLAGS_NTP) EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c -$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new mv -f info_trimble.new $@ +#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +# sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new +# sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new +# mv -f info_trimble.new $@ + kieee754io.o: $(srcdir)/ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ diff --git a/libparse/Makefile.in b/libparse/Makefile.in index 606763edf963..15a989b318fd 100644 --- a/libparse/Makefile.in +++ b/libparse/Makefile.in @@ -176,6 +176,7 @@ CHUTEST = @CHUTEST@ CONFIG_SHELL = @CONFIG_SHELL@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ CPPFLAGS_NTP = @CPPFLAGS_NTP@ CXX = @CXX@ CXXCPP = @CXXCPP@ @@ -210,7 +211,9 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ +LDADD_LIBEVENT = @LDADD_LIBEVENT@ LDADD_LIBNTP = @LDADD_LIBNTP@ +LDADD_LIBUTIL = @LDADD_LIBUTIL@ LDADD_NLIST = @LDADD_NLIST@ LDADD_NTP = @LDADD_NTP@ LDFLAGS = @LDFLAGS@ @@ -408,16 +411,27 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = -BUILT_SOURCES = check-libntp .deps-ver +BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) check-libntp \ + .deps-ver CLEANFILES = check-libntp .deps-ver noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a noinst_PROGRAMS = @MAKE_PARSEKMODULE@ K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS +@VPATH_HACK_FALSE@VPHACK = # info_trimble.c was mistakenly created in the build directory # previously. It is located in $(srcdir) and any updates must # end up there. + +# +# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as +# BSD make) to work around build/dependency issues where we want +# built source files to live in srcdir, as opposed to builddir. +# +@VPATH_HACK_TRUE@VPHACK = vphack +@VPATH_HACK_FALSE@VPHACK_AFTER = +@VPATH_HACK_TRUE@VPHACK_AFTER = vphack_after libparse_a_SOURCES = parse.c \ parse_conf.c \ clk_meinberg.c \ @@ -794,11 +808,25 @@ uninstall-am: tags uninstall uninstall-am -$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +vphack: + test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + +vphack_after: + test -L info_trimble.c || ( \ + mv info_trimble.c $(srcdir)/info_trimble.c && \ + ln -s $(srcdir)/info_trimble.c . \ + ) + +info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new mv -f info_trimble.new $@ +#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed +# sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new +# sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new +# mv -f info_trimble.new $@ + kieee754io.o: $(srcdir)/ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c index bc0ac0e8170a..a94c3f7a2edd 100644 --- a/libparse/clk_meinberg.c +++ b/libparse/clk_meinberg.c @@ -157,7 +157,7 @@ mbg_csum( ) { unsigned long sum = 0; - short i; + unsigned int i; for ( i = 0; i < n; i++ ) sum += *p++; diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index 98848bee8fb0..d6e4b184c050 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -125,12 +125,12 @@ clockformat_t clock_rawdcf = static struct dcfparam { - unsigned char *onebits; - unsigned char *zerobits; + const unsigned char *onebits; + const unsigned char *zerobits; } dcfparameter = { - (unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ - (unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ + (const unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ + (const unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ }; static struct rawdcfcode @@ -182,7 +182,7 @@ static u_long ext_bf( unsigned char *buf, int idx, - unsigned char *zero + const unsigned char *zero ) { u_long sum = 0; @@ -202,7 +202,7 @@ static unsigned pcheck( unsigned char *buf, int idx, - unsigned char *zero + const unsigned char *zero ) { int i,last; @@ -225,8 +225,8 @@ convert_rawdcf( ) { unsigned char *s = buffer; - unsigned char *b = dcfprm->onebits; - unsigned char *c = dcfprm->zerobits; + const unsigned char *b = dcfprm->onebits; + const unsigned char *c = dcfprm->zerobits; int i; parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer)); @@ -342,8 +342,8 @@ cvt_rawdcf( last_tcode_t *t = (last_tcode_t *)local; unsigned char *s = (unsigned char *)buffer; unsigned char *e = s + size; - unsigned char *b = dcfparameter.onebits; - unsigned char *c = dcfparameter.zerobits; + const unsigned char *b = dcfparameter.onebits; + const unsigned char *c = dcfparameter.zerobits; u_long rtc = CVT_NONE; unsigned int i, lowmax, highmax, cutoff, span; #define BITS 9 diff --git a/libparse/data_mbg.c b/libparse/data_mbg.c index 97bef35c4479..23ca75509180 100644 --- a/libparse/data_mbg.c +++ b/libparse/data_mbg.c @@ -266,8 +266,8 @@ mbg_tm_str( tmp->year, tmp->month, tmp->mday, tmp->hour, tmp->minute, tmp->second, tmp->frac, (tmp->offs_from_utc < 0) ? '-' : '+', - abs(tmp->offs_from_utc) / 3600, - (abs(tmp->offs_from_utc) / 60) % 60); + abs((int)tmp->offs_from_utc) / 3600, + (abs((int)tmp->offs_from_utc) / 60) % 60); *buffpp += strlen(*buffpp); mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); @@ -383,7 +383,7 @@ get_mbg_comparam( COM_PARM *comparamp ) { - int i; + size_t i; comparamp->baud_rate = get_lsb_long(buffpp); for (i = 0; i < sizeof(comparamp->framing); i++) diff --git a/libparse/info_trimble.c b/libparse/info_trimble.c index eea6cbd3f52c..53b2e32c1ac5 100644 --- a/libparse/info_trimble.c +++ b/libparse/info_trimble.c @@ -2,6 +2,7 @@ * Automatically generated - do not modify */ +#include #include "ntp_types.h" #include "ntpd.h" #include "trimble.h" @@ -47,7 +48,7 @@ cmd_info_t trimble_scmds[] = { { CMD_CHIGH8CNT, "CMD_CHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x75)", "", 0 }, { CMD_CMAXDGPSCOR, "CMD_CMAXDGPSCOR", "maximum rate of DGPS corrections (0x77)", "", 0 }, { CMD_CSUPER, "CMD_CSUPER", "super paket (0x8E)", "", 0 }, - { 0xFF, "", "" } + { 0xFF, "", "", "", 0 } }; @@ -89,6 +90,5 @@ cmd_info_t trimble_rcmds[] = { { CMD_RDOUBLELLA, "CMD_RDOUBLELLA", "double precision LLA (0x84)", "gps_position_ext(LLA)", RO|DEF }, { CMD_RDGPSSTAT, "CMD_RDGPSSTAT", "differential correction status (0x85)", "trimble_dgpsstatus", RO }, { CMD_RSUPER, "CMD_RSUPER", "super paket (0x8F)", "", 0 }, - { 0xFF, "", "" } + { 0xFF, "", "", "", 0 } }; - diff --git a/libparse/mkinfo_rcmd.sed b/libparse/mkinfo_rcmd.sed index 5238d5c4eb13..b8ed6232e615 100644 --- a/libparse/mkinfo_rcmd.sed +++ b/libparse/mkinfo_rcmd.sed @@ -4,5 +4,5 @@ cmd_info_t trimble_rcmds[] = { s!^#define[ \ ][ \ ]*\(CMD_R[^ \ ]*\)[ \ ][ \ ]*\([^ \ ]*\)[ \ ][ \ ]*/\*[ \ ][ \ ]*\(.*\)[ \ ]*:\([^:]*\):\([^:]*\)[ \ ][ \ ]*\*/!\ { \1, "\1", "\3 (\2)", "\4", \5 },!p $a\ -\ { 0xFF, "", "" }\ +\ { 0xFF, "", "", "", 0 }\ }; diff --git a/libparse/mkinfo_scmd.sed b/libparse/mkinfo_scmd.sed index 9c17f39ed703..fb58d32db5d3 100644 --- a/libparse/mkinfo_scmd.sed +++ b/libparse/mkinfo_scmd.sed @@ -11,5 +11,5 @@ cmd_info_t trimble_scmds[] = { s!^#define[ ][ ]*\(CMD_C[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "", 0 },!p $a\ -\ { 0xFF, "", "" }\ +\ { 0xFF, "", "", "", 0 }\ }; -- cgit v1.2.3