From: NTP Release Engineering Date: Sun, 7 Apr 2019 07:40:07 +0000 (-0700) Subject: Pick up tweaks to autogen-5.18.5 X-Git-Tag: NTP_4_3_94~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f15fddabf0760d817cfbf88612ddf772a80204b7;p=thirdparty%2Fntp.git Pick up tweaks to autogen-5.18.5 bk: 5ca9a957G6rtBl5Kuuokyjk50qNlfw --- diff --git a/ChangeLog b/ChangeLog index cf25de3d0..17b12a2b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* Pick up tweaks to autogen-5.18.5 From ntp-4.2.8p9: --- (4.2.8p9) 2016/11/21 Released by Harlan Stenn diff --git a/sntp/libopts/Makefile.am b/sntp/libopts/Makefile.am index 316088739..711e06f70 100644 --- a/sntp/libopts/Makefile.am +++ b/sntp/libopts/Makefile.am @@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libopts.la endif libopts_la_SOURCES = libopts.c libopts_la_CPPFLAGS = -I$(srcdir) -libopts_la_LDFLAGS = -version-info 41:0:16 +libopts_la_LDFLAGS = -version-info 41:1:16 EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = @@ -40,16 +40,16 @@ EXTRA_DIST += \ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \ MakeDefs.inc README ag-char-map.h \ alias.c ao-strs.c ao-strs.h \ - autoopts/usage-txt.h autoopts/options.h autoopts/project.h \ + autoopts/project.h autoopts/options.h autoopts/usage-txt.h \ autoopts.c autoopts.h boolean.c \ - check.c compat/compat.h compat/strdup.c \ - compat/windows-config.h compat/strchr.c compat/pathfind.c \ - compat/snprintf.c compat/_Noreturn.h configfile.c \ + check.c compat/windows-config.h compat/compat.h \ + compat/pathfind.c compat/snprintf.c compat/strdup.c \ + compat/strchr.c compat/_Noreturn.h configfile.c \ cook.c enum.c env.c \ file.c find.c genshell.c \ genshell.h gettext.h init.c \ - intprops.h load.c m4/stdnoreturn.m4 \ - m4/liboptschk.m4 m4/libopts.m4 makeshell.c \ + intprops.h load.c m4/libopts.m4 \ + m4/liboptschk.m4 m4/stdnoreturn.m4 makeshell.c \ nested.c numeric.c option-value-type.c \ option-value-type.h option-xat-attribute.c option-xat-attribute.h \ parse-duration.c parse-duration.h pgusage.c \ diff --git a/sntp/libopts/ag-char-map.h b/sntp/libopts/ag-char-map.h index e905118ca..281badd94 100644 --- a/sntp/libopts/ag-char-map.h +++ b/sntp/libopts/ag-char-map.h @@ -1,6 +1,6 @@ /* * 29 bits for 46 character classifications - * generated by char-mapper on 04/25/15 at 09:53:03 + * generated by char-mapper on 04/30/15 at 19:55:13 * * This file contains the character classifications * used by AutoGen and AutoOpts for identifying tokens. diff --git a/sntp/libopts/autoopts/options.h b/sntp/libopts/autoopts/options.h index f92cd0efa..0601d0fc5 100644 --- a/sntp/libopts/autoopts/options.h +++ b/sntp/libopts/autoopts/options.h @@ -109,15 +109,15 @@ * @{ */ /// autoopts structure version -#define OPTIONS_STRUCT_VERSION 167936 +#define OPTIONS_STRUCT_VERSION 167937 /// autoopts structure version string -#define OPTIONS_VERSION_STRING "41:0:16" +#define OPTIONS_VERSION_STRING "41:1:16" /// minimum version the autoopts library supports #define OPTIONS_MINIMUM_VERSION 102400 /// minimum version the autoopts library supports as a string #define OPTIONS_MIN_VER_STRING "25:0:0" /// the display version of the autoopts library, as a string -#define OPTIONS_DOTTED_VERSION "41.0" +#define OPTIONS_DOTTED_VERSION "41.1" /// convert a version/release number pair to an integer value #define OPTIONS_VER_TO_NUM(_v, _r) (((_v) * 4096) + (_r)) /// @} diff --git a/sntp/libopts/compat/pathfind.c b/sntp/libopts/compat/pathfind.c index d343dcc64..5c477caf0 100644 --- a/sntp/libopts/compat/pathfind.c +++ b/sntp/libopts/compat/pathfind.c @@ -115,15 +115,9 @@ make_absolute( char const * string, char const * dot_path ) if (!dot_path || *string == '/') { result = strdup( string ); - if (result == NULL) { - return NULL; /* couldn't allocate memory */ - } } else { if (dot_path && dot_path[0]) { result = malloc( 2 + strlen( dot_path ) + strlen( string ) ); - if (result == NULL) { - return NULL; /* couldn't allocate memory */ - } strcpy( result, dot_path ); result_len = (int)strlen(result); if (result[result_len - 1] != '/') { @@ -132,9 +126,6 @@ make_absolute( char const * string, char const * dot_path ) } } else { result = malloc( 3 + strlen( string ) ); - if (result == NULL) { - return NULL; /* couldn't allocate memory */ - } result[0] = '.'; result[1] = '/'; result[2] = '\0'; result_len = 2; } @@ -164,9 +155,7 @@ canonicalize_pathname( char *path ) /* The result cannot be larger than the input PATH. */ result = strdup( path ); - if (result == NULL) { - return NULL; /* couldn't allocate memory */ - } + stub_char = (*path == '/') ? '/' : '.'; /* Walk along RESULT looking for things to compact. */ diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c index 8244371e5..03156ca6d 100644 --- a/sntp/libopts/configfile.c +++ b/sntp/libopts/configfile.c @@ -182,9 +182,9 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val) } else do { - tArgList * argl = odesc->optCookie; - int argct = argl->useCt; - const void ** poptv = VOIDP(argl->apzArgs); + tArgList * argl = odesc->optCookie; + int argct = argl->useCt; + void ** poptv = (void **)(argl->apzArgs); if (argct == 0) { errno = ENOENT; @@ -192,7 +192,7 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val) } if (name == NULL) { - res = (const tOptionValue *)*poptv; + res = (tOptionValue *)*poptv; break; } @@ -249,7 +249,7 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal, char const * pzName, char const * pzVal) { bool old_found = false; - const tOptionValue * res = NULL; + tOptionValue * res = NULL; (void)pzName; (void)pzVal; @@ -264,12 +264,12 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal, } else do { - tArgList * argl = odesc->optCookie; - int ct = argl->useCt; - const void ** poptv = VOIDP(argl->apzArgs); + tArgList * argl = odesc->optCookie; + int ct = argl->useCt; + void ** poptv = (void **)argl->apzArgs; while (--ct >= 0) { - const tOptionValue * pOV = *(poptv++); + tOptionValue * pOV = *(poptv++); if (old_found) { res = pOV; break; @@ -315,8 +315,8 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal, tOptionValue const * optionGetValue(tOptionValue const * oov, char const * vname) { - tArgList * arg_list; - const tOptionValue * res = NULL; + tArgList * arg_list; + tOptionValue * res = NULL; if ((oov == NULL) || (oov->valType != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; @@ -325,14 +325,14 @@ optionGetValue(tOptionValue const * oov, char const * vname) arg_list = oov->v.nestVal; if (arg_list->useCt > 0) { - int ct = arg_list->useCt; - const void ** ovlist = VOIDP(arg_list->apzArgs); + int ct = arg_list->useCt; + void ** ovlist = (void **)(arg_list->apzArgs); if (vname == NULL) { - res = (const tOptionValue *)*ovlist; + res = (tOptionValue *)*ovlist; } else do { - const tOptionValue * opt_val = *(ovlist++); + tOptionValue * opt_val = *(ovlist++); if (strcmp(opt_val->pzName, vname) == 0) { res = opt_val; break; @@ -374,9 +374,9 @@ optionGetValue(tOptionValue const * oov, char const * vname) tOptionValue const * optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov ) { - tArgList * arg_list; - const tOptionValue * res = NULL; - int err = EINVAL; + tArgList * arg_list; + tOptionValue * res = NULL; + int err = EINVAL; if ((ov_list == NULL) || (ov_list->valType != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; @@ -384,18 +384,18 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov ) } arg_list = ov_list->v.nestVal; { - int ct = arg_list->useCt; - const void ** o_list = VOIDP(arg_list->apzArgs); + int ct = arg_list->useCt; + void ** o_list = (void **)(arg_list->apzArgs); while (ct-- > 0) { - const tOptionValue * nov = *(o_list++); + tOptionValue * nov = *(o_list++); if (nov == oov) { if (ct == 0) { err = ENOENT; } else { err = 0; - res = (const tOptionValue *)*o_list; + res = (tOptionValue *)*o_list; } break; } diff --git a/sntp/libopts/enum.c b/sntp/libopts/enum.c index e9bba8364..3345558be 100644 --- a/sntp/libopts/enum.c +++ b/sntp/libopts/enum.c @@ -189,12 +189,12 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD, * The result gets stashed in a char * pointer. */ uintptr_t res = name_ct; - size_t len = strlen(name); + size_t len = strlen((char *)name); uintptr_t idx; if (IS_DEC_DIGIT_CHAR(*name)) { - char * pz; - unsigned long val = strtoul(name, &pz, 0); + char * pz = VOIDP(name); + unsigned long val = strtoul(pz, &pz, 0); if ((*pz == NUL) && (val < name_ct)) return (uintptr_t)val; pz_enum_err_fmt = znum_too_large; @@ -215,7 +215,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD, * Multiple partial matches means we have an ambiguous match. */ for (idx = 0; idx < name_ct; idx++) { - if (strncmp(paz_names[idx], name, len) == 0) { + if (strncmp((char *)paz_names[idx], (char *)name, len) == 0) { if (paz_names[idx][len] == NUL) return idx; /* full match */ @@ -500,7 +500,7 @@ find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len, if (shift_ct >= nm_ct) return 0UL; - return (uintptr_t)1U << shift_ct; + return 1UL << shift_ct; } } diff --git a/sntp/libopts/find.c b/sntp/libopts/find.c index 97a24df47..90591cc92 100644 --- a/sntp/libopts/find.c +++ b/sntp/libopts/find.c @@ -80,7 +80,7 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz) buf[res] = NUL; *nm_pp = buf; - *arg_pp = VOIDP(p); + *arg_pp = (char *)p; return res; default: diff --git a/sntp/libopts/genshell.c b/sntp/libopts/genshell.c index 0f05b3efb..3933572af 100644 --- a/sntp/libopts/genshell.c +++ b/sntp/libopts/genshell.c @@ -6,7 +6,7 @@ * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 41:0:16 templates. + * Generated from AutoOpts 41:1:16 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen diff --git a/sntp/libopts/genshell.h b/sntp/libopts/genshell.h index 1c1873574..c371f528d 100644 --- a/sntp/libopts/genshell.h +++ b/sntp/libopts/genshell.h @@ -6,7 +6,7 @@ * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 41:0:16 templates. + * Generated from AutoOpts 41:1:16 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -55,7 +55,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 167936 +#define AO_TEMPLATE_VERSION 167937 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header diff --git a/sntp/libopts/init.c b/sntp/libopts/init.c index 81d4eee32..e02e1e1b9 100644 --- a/sntp/libopts/init.c +++ b/sntp/libopts/init.c @@ -97,14 +97,15 @@ validate_struct(tOptions * opts, char const * pname) */ if (opts->pzProgName == NULL) { char const * pz = strrchr(pname, DIRCH); - char const ** pp = VOIDP(&(opts->pzProgName)); + char const ** pp = + (char const **)(void **)&(opts->pzProgName); if (pz != NULL) *pp = pz+1; else *pp = pname; - pz = pathfind(getenv("PATH"), pname, "rx"); + pz = pathfind(getenv("PATH"), (char *)pname, "rx"); if (pz != NULL) pname = VOIDP(pz); diff --git a/sntp/libopts/libopts.c b/sntp/libopts/libopts.c index 97bc359ed..a26c9248a 100644 --- a/sntp/libopts/libopts.c +++ b/sntp/libopts/libopts.c @@ -3,7 +3,7 @@ #define LOCAL static #include "ao-strs.h" static char const ao_ver_string[] = - "41:0:16\n"; + "41:1:16\n"; #include "autoopts/options.h" #include "autoopts/usage-txt.h" #include "genshell.h" diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c index ccda5b4e8..b5230afd3 100644 --- a/sntp/libopts/load.c +++ b/sntp/libopts/load.c @@ -225,7 +225,7 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path) if (strchr(prg_path, DIRCH) != NULL) path = prg_path; else { - path = pathfind(getenv("PATH"), prg_path, "rx"); + path = pathfind(getenv("PATH"), (char *)prg_path, "rx"); if (path == NULL) return false; diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c index fbe8e171d..a61df422c 100644 --- a/sntp/libopts/makeshell.c +++ b/sntp/libopts/makeshell.c @@ -401,7 +401,7 @@ emit_usage(tOptions * opts) /* Copy the program name into the time/name buffer */ for (;;) { - if ((*pzPN++ = (char)tolower((unsigned char)*pz++)) == NUL) + if ((*pzPN++ = (char)tolower(*pz++)) == NUL) break; } @@ -671,8 +671,8 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts) continue; match_ct = 0; - while ( toupper((unsigned char)od->pz_DisableName[match_ct]) - == toupper((unsigned char)name[match_ct])) + while ( toupper(od->pz_DisableName[match_ct]) + == toupper(name[match_ct])) match_ct++; if (match_ct > min_match_ct) min_match_ct = match_ct; diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c index aaf089f54..f4fb22620 100644 --- a/sntp/libopts/nested.c +++ b/sntp/libopts/nested.c @@ -859,7 +859,6 @@ LOCAL int get_special_char(char const ** ppz, int * ct) { char const * pz = *ppz; - char * rz; if (*ct < 3) return '&'; @@ -873,8 +872,7 @@ get_special_char(char const ** ppz, int * ct) base = 16; pz++; } - retch = (int)strtoul(pz, &rz, base); - pz = rz; + retch = (int)strtoul(pz, (char **)&pz, base); if (*pz != ';') return '&'; base = (int)(++pz - *ppz); diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c index 11e3d828d..e072b7d56 100644 --- a/sntp/libopts/parse-duration.c +++ b/sntp/libopts/parse-duration.c @@ -60,20 +60,14 @@ typedef enum { static unsigned long str_const_to_ul (cch_t * str, cch_t ** ppz, int base) { - char * pz; - int rv = strtoul (str, &pz, base); - *ppz = pz; - return rv; + return strtoul (str, (char **)ppz, base); } /* Wrapper around strtol that does not require a cast. */ static long str_const_to_l (cch_t * str, cch_t ** ppz, int base) { - char * pz; - int rv = strtol (str, &pz, base); - *ppz = pz; - return rv; + return strtol (str, (char **)ppz, base); } /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h index a78b794fc..8ba6646bd 100644 --- a/sntp/libopts/proto.h +++ b/sntp/libopts/proto.h @@ -1,7 +1,7 @@ /* -*- buffer-read-only: t -*- vi: set ro: * * Prototypes for autoopts - * Generated Sat Apr 25 09:53:18 PDT 2015 + * Generated Thu Apr 30 19:55:28 PDT 2015 */ #ifndef AUTOOPTS_PROTO_H_GUARD #define AUTOOPTS_PROTO_H_GUARD 1 diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c index 97ecb52e2..6ca2c0522 100644 --- a/sntp/libopts/reset.c +++ b/sntp/libopts/reset.c @@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD) assert(0 == 1); } } else { - succ = opt_find_long(pOpts, pzArg, &opt_state); + succ = opt_find_long(pOpts, (char *)pzArg, &opt_state); if (! SUCCESSFUL(succ)) { fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg); pOpts->pUsageProc(pOpts, EXIT_FAILURE); diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c index cdab05f62..f462ced8c 100644 --- a/sntp/libopts/save.c +++ b/sntp/libopts/save.c @@ -453,7 +453,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al) if (al == NULL) return; opt_ct = al->useCt; - opt_list = VOIDP(al->apzArgs); + opt_list = (void **)al->apzArgs; if (opt_ct <= 0) { fprintf(fp, OPEN_CLOSE_FMT, name); @@ -488,7 +488,7 @@ prt_nested(FILE * fp, tOptDesc * p) return; opt_ct = al->useCt; - opt_list = VOIDP(al->apzArgs); + opt_list = (void **)al->apzArgs; if (opt_ct <= 0) return; diff --git a/sntp/libopts/tokenize.c b/sntp/libopts/tokenize.c index 25550eaaf..cbff7fba4 100644 --- a/sntp/libopts/tokenize.c +++ b/sntp/libopts/tokenize.c @@ -57,7 +57,7 @@ copy_cooked(ch_t ** ppDest, char const ** ppSrc) case NUL: *ppSrc = NULL; return; case '"': goto done; case '\\': - pSrc += ao_string_cook_escape_char((const char *)pSrc, (char *)&ch, 0x7F); + pSrc += ao_string_cook_escape_char((char *)pSrc, (char *)&ch, 0x7F); if (ch == 0x7F) break; /* FALLTHROUGH */