]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Pick up tweaks to autogen-5.18.5
authorNTP Release Engineering <stenn@ntp.org>
Sun, 7 Apr 2019 07:40:07 +0000 (00:40 -0700)
committerNTP Release Engineering <stenn@ntp.org>
Sun, 7 Apr 2019 07:40:07 +0000 (00:40 -0700)
bk: 5ca9a957G6rtBl5Kuuokyjk50qNlfw

20 files changed:
ChangeLog
sntp/libopts/Makefile.am
sntp/libopts/ag-char-map.h
sntp/libopts/autoopts/options.h
sntp/libopts/compat/pathfind.c
sntp/libopts/configfile.c
sntp/libopts/enum.c
sntp/libopts/find.c
sntp/libopts/genshell.c
sntp/libopts/genshell.h
sntp/libopts/init.c
sntp/libopts/libopts.c
sntp/libopts/load.c
sntp/libopts/makeshell.c
sntp/libopts/nested.c
sntp/libopts/parse-duration.c
sntp/libopts/proto.h
sntp/libopts/reset.c
sntp/libopts/save.c
sntp/libopts/tokenize.c

index cf25de3d04df33739011698143444af6433f53f2..17b12a2b0244fae82b9a99ecfa0f6a9a1743e2f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Pick up tweaks to autogen-5.18.5 <stenn@ntp.org>
 From ntp-4.2.8p9:
 ---
 (4.2.8p9) 2016/11/21 Released by Harlan Stenn <stenn@ntp.org>
index 3160887390782c4dad6cc6964d46af906101be25..711e06f70d81a9351d4c0793cb746a61de0c236e 100644 (file)
@@ -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  \
index e905118ca2423d6737d32f620228adeabc0442fc..281badd948ff2b0a97f8a3005a297fb86d798483 100644 (file)
@@ -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.
index f92cd0efafde663acd03aef72ca1c7045c79cef2..0601d0fc571666a46045b8af802e88f2e429fe43 100644 (file)
  * @{
  */
 /// 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))
 /// @}
index d343dcc643de2ac06259c816b29681ac4cd9aff6..5c477caf07a6261c0a768c375c97ab27d28d4ac4 100644 (file)
@@ -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. */
index 8244371e56be7883288ae957eb0445c7418c5a2b..03156ca6d8896eb735cba5017c4d17b0cfc1e1c2 100644 (file)
@@ -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;
             }
index e9bba83644cb0c8692a6e01e4d7671189594c71e..3345558bec72e1015ad4f711d274d11b563f3588 100644 (file)
@@ -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;
     }
 }
 
index 97a24df47216ce5bf0b13f6b9915810d1d1a209e..90591cc9243dc5cfb294e16bb922ebefb14378c0 100644 (file)
@@ -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:
index 0f05b3efbc446892639f5937e210bdc98f540afd..3933572af9053bd26c049e85584eed6b3b20a396 100644 (file)
@@ -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
index 1c187357414062f06e89826c4c53533173a3b84e..c371f528d64ffa675eb18ca817d14a3b6c1c7f65 100644 (file)
@@ -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
index 81d4eee32d0c9ca981d7e8ae8c047ce173d63a02..e02e1e1b9bc797b69908c420238c80aa3a4ce0c7 100644 (file)
@@ -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);
 
index 97bc359ed8c52925eed7b24fa94283a4e6aa2dc2..a26c9248ae5edd04564d30691a1e7ef1c6785c34 100644 (file)
@@ -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"
index ccda5b4e870dc358a187198582baa2ffaaa30d15..b5230afd382a2b0bb04ed6a7c745fda249206cd0 100644 (file)
@@ -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;
index fbe8e171de0d322916c4d2f20f178e2b2a05297d..a61df422c857c7b3e4e8ae818e25cf56d04df71f 100644 (file)
@@ -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;
index aaf089f543d889e1a02c9158cf69bd3becb003a4..f4fb22620932fe9710a0708308b5d34def7a0a45 100644 (file)
@@ -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);
index 11e3d828d8975ef9da1ee9e3d05fc5a70cf7aee2..e072b7d567f54313272aa582040641ce7b426b91 100644 (file)
@@ -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
index a78b794fc6a5389fa1091382eda84540add754b1..8ba6646bd4b060d79b484d396c08c9a4bedab17d 100644 (file)
@@ -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
index 97ecb52e242532a6c0dda4b72f7097dfbd06d9ab..6ca2c05229db400569515f405f846f78f2fd50a2 100644 (file)
@@ -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);
index cdab05f628ec064e5e0aa15d82850ecdf0f03226..f462ced8c65df0d6754421ef8e88cc596150d3be 100644 (file)
@@ -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;
index 25550eaafeeae7eb80704032c75cb0ad285d7ad3..cbff7fba47df59eddc41fccbd896bce4ab58a3c3 100644 (file)
@@ -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 */