]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
autogen-5.18.5
authorHarlan Stenn <stenn@ntp.org>
Sun, 26 Apr 2015 18:32:21 +0000 (14:32 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sun, 26 Apr 2015 18:32:21 +0000 (14:32 -0400)
bk: 553d2f35A65n4KVfYxaaEeyJKvQ0qw

50 files changed:
ChangeLog
sntp/libopts/COPYING.gplv3
sntp/libopts/COPYING.lgplv3
sntp/libopts/COPYING.mbsd
sntp/libopts/Makefile.am
sntp/libopts/README
sntp/libopts/ag-char-map.h
sntp/libopts/alias.c
sntp/libopts/ao-strs.c
sntp/libopts/ao-strs.h
sntp/libopts/autoopts.c
sntp/libopts/autoopts.h
sntp/libopts/boolean.c
sntp/libopts/check.c
sntp/libopts/configfile.c
sntp/libopts/cook.c
sntp/libopts/enum.c
sntp/libopts/env.c
sntp/libopts/file.c
sntp/libopts/find.c
sntp/libopts/genshell.c
sntp/libopts/gettext.h
sntp/libopts/init.c
sntp/libopts/intprops.h
sntp/libopts/libopts.c
sntp/libopts/load.c
sntp/libopts/makeshell.c
sntp/libopts/nested.c
sntp/libopts/numeric.c
sntp/libopts/option-value-type.c
sntp/libopts/option-value-type.h
sntp/libopts/option-xat-attribute.c
sntp/libopts/option-xat-attribute.h
sntp/libopts/parse-duration.c
sntp/libopts/parse-duration.h
sntp/libopts/pgusage.c
sntp/libopts/proto.h
sntp/libopts/putshell.c
sntp/libopts/reset.c
sntp/libopts/restore.c
sntp/libopts/save.c
sntp/libopts/sort.c
sntp/libopts/stack.c
sntp/libopts/stdnoreturn.in.h
sntp/libopts/streqvcmp.c
sntp/libopts/text_mmap.c
sntp/libopts/time.c
sntp/libopts/tokenize.c
sntp/libopts/usage.c
sntp/libopts/version.c

index fb9e044fe2d9615ca671b72a81f1506355252f93..7a4da5dea2f9313b356e30c5d34f5919024398ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ Below are from 4.2.8p3:
 * CID 1269537: Clean up a line of dead code in getShmTime().
 * ntpq.c cleanup.
 * Improve the ntpq documentation around the controlkey keyid.
+* autogen-5.18.5.
 (4.3.19) 2015/04/25 Released by Harlan Stenn <stenn@ntp.org>
 Below are from 4.2.8p3:
 * [Bug 2804] Fix regression in previous fix.
index 065b7a6c55164651bffbdf89bbdadd08f77389a8..26d6fd2e7b11fb4d0750107654fbbb137cca034a 100644 (file)
@@ -1,7 +1,7 @@
                     GNU GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
index 3deaacb08b80f9dc5f8d2c147428b34461afab4e..b6db23288f8c4bff339ee332e952e1a5702c05b1 100644 (file)
@@ -1,7 +1,7 @@
                   GNU LESSER GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
index 8a704271906c86f28d8d6109b823520f718444cf..74948befa59e2103389f3515ca054c712a136148 100644 (file)
@@ -1,3 +1,4 @@
+Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 
index ea1b56dfd2f22d8b09b621c53ed207a3fb969dfc..3160887390782c4dad6cc6964d46af906101be25 100644 (file)
@@ -40,11 +40,11 @@ EXTRA_DIST += \
     COPYING.gplv3           COPYING.lgplv3          COPYING.mbsd  \
     MakeDefs.inc            README                  ag-char-map.h  \
     alias.c                 ao-strs.c               ao-strs.h  \
-    autoopts/project.h      autoopts/options.h      autoopts/usage-txt.h  \
+    autoopts/usage-txt.h    autoopts/options.h      autoopts/project.h  \
     autoopts.c              autoopts.h              boolean.c  \
-    check.c                 compat/snprintf.c       compat/strchr.c  \
-    compat/strdup.c         compat/_Noreturn.h      compat/pathfind.c  \
-    compat/compat.h         compat/windows-config.h configfile.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  \
     cook.c                  enum.c                  env.c  \
     file.c                  find.c                  genshell.c  \
     genshell.h              gettext.h               init.c  \
index 4bf758d8c21d7694a9791f3dc35b72736a912fd8..98e4f3c677c8fc8863c2ccae29f6675ff787bbe7 100644 (file)
@@ -115,7 +115,7 @@ These macros work as follows:
 
 LICENSING:
 
-This material is Copyright (C) 1992-2014 by Bruce Korb.  You are
+This material is Copyright (C) 1992-2015 by Bruce Korb.  You are
 licensed to use this under the terms of either the GNU Lesser General
 Public License (see: COPYING.lgpl), or, at your option, the modified
 Berkeley Software Distribution License (see: COPYING.mbsd).  Both of
index 01733d71c78e6aaaaf16b5ef7b1b6af294f6360d..e905118ca2423d6737d32f620228adeabc0442fc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  29 bits for 46 character classifications
- *  generated by char-mapper on 08/08/14 at 16:09:03
+ *  generated by char-mapper on 04/25/15 at 09:53:03
  *
  *  This file contains the character classifications
  *  used by AutoGen and AutoOpts for identifying tokens.
@@ -8,7 +8,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index be8c6c6cb46f130c17470eb7233624f6bf099e35..49e1f1fdd1a9f542ecd695860f4269758dfad0a5 100644 (file)
@@ -12,7 +12,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index a8fac46c6c46aa5fd82572295518e8d9360c1fb6..857aa73528b953a8084f4f74aadc41691681c5e6 100644 (file)
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (ao-strs.c)
  *
- * It has been AutoGen-ed  August  8, 2014 at 04:09:03 PM by AutoGen 5.18.4pre11
+ * It has been AutoGen-ed
  * From the definitions    ao-strs.def
  * and the template file   strings
  *
- *  Copyright (C) 2011-2014 Bruce Korb, all rights reserved.
+ *  Copyright (C) 2011-2015 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the
  *  Modified (3 clause) Berkeley Software Distribution License
index abe1f89e9eb2c2d595d30a5dbf3cb3cc36914528..864fc48ac5c4ecb190d8f0f3d7492c3da09fbe56 100644 (file)
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (ao-strs.h)
  *
- * It has been AutoGen-ed  August  8, 2014 at 04:09:03 PM by AutoGen 5.18.4pre11
+ * It has been AutoGen-ed
  * From the definitions    ao-strs.def
  * and the template file   strings
  *
- *  Copyright (C) 2011-2014 Bruce Korb, all rights reserved.
+ *  Copyright (C) 2011-2015 Bruce Korb, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the
  *  Modified (3 clause) Berkeley Software Distribution License
index a5193186a7c0c2aacf28e3f5696ad1bb6b59cfcd..4b15acafbb6320ce0142e37b529bf2cf55b8d08e 100644 (file)
@@ -13,7 +13,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -299,9 +299,9 @@ regular_opts(tOptions * opts)
  *
  * what: this is the main option processing routine
  *
- * arg:  + tOptions* + opts  + program options descriptor +
- * arg:  + int       + a_ct  + program arg count  +
- * arg:  + char**    + a_v   + program arg vector +
+ * arg:  + tOptions * + opts  + program options descriptor +
+ * arg:  + int        + a_ct  + program arg count  +
+ * arg:  + char **    + a_v   + program arg vector +
  *
  * ret_type:  int
  * ret_desc:  the count of the arguments processed
index 6987958cd11126cfff0b6dc5246e9b03f0ec6712..6f75f9e44e55d69af141f01b5b88ac86e7ae237d 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  Coercive cast.  Compel an address to be interpreted as the type
  *  of the first argument.  No complaints, just do it.
  */
-#define C(_t,_p)  ((_t)(void *)(_p))
+#define C(_t,_p)  ((_t)VOIDP(_p))
 #endif
 
 /* The __attribute__((__warn_unused_result__)) feature
@@ -256,10 +256,10 @@ typedef struct {
     char const * pzTime;
 } arg_types_t;
 
-#define AGALOC(c, w)          ao_malloc((size_t)c)
-#define AGREALOC(p, c, w)     ao_realloc((void*)p, (size_t)c)
-#define AGFREE(p)            free((void *)(intptr_t)p)
-#define AGDUPSTR(p, s, w)     (p = ao_strdup(s))
+#define AGALOC(_c, _w)        ao_malloc((size_t)_c)
+#define AGREALOC(_p, _c, _w)  ao_realloc(VOIDP(_p), (size_t)_c)
+#define AGFREE(_p)            free(VOIDP(_p))
+#define AGDUPSTR(_p, _s, _w)  (_p = ao_strdup(_s))
 
 static void *
 ao_malloc(size_t sz);
@@ -267,10 +267,10 @@ ao_malloc(size_t sz);
 static void *
 ao_realloc(void *p, size_t sz);
 
-#define ao_free(_p) free((void *)_p)
+#define ao_free(_p) free(VOIDP(_p))
 
 static char *
-ao_strdup(char const *str);
+ao_strdup(char const * str);
 
 /**
  *  DO option handling?
@@ -369,7 +369,7 @@ ao_strdup(char const *str);
 #endif
 
 #ifndef MAP_FAILED
-#  define  MAP_FAILED           ((void*)-1)
+#  define  MAP_FAILED           VOIDP(-1)
 #endif
 
 #ifndef  _SC_PAGESIZE
@@ -379,8 +379,8 @@ ao_strdup(char const *str);
 #endif
 
 #ifndef HAVE_STRCHR
-extern char* strchr(char const *s, int c);
-extern char* strrchr(char const *s, int c);
+extern char * strchr(char const * s, int c);
+extern char * strrchr(char const * s, int c);
 #endif
 
 /**
@@ -452,7 +452,7 @@ typedef enum { AOFLAG_TABLE } ao_flags_t;
 #undef  _aof_
 
 static char const   zNil[] = "";
-static arg_types_t  argTypes             = { 0 };
+static arg_types_t  argTypes             = { NULL };
 static char         line_fmt_buf[32];
 static bool         displayEnum          = false;
 static char const   pkgdatadir_default[] = PKGDATADIR;
index e83e518c000a27a8db04cedcc1755f91dc956562..2bea8e7f2aebeef321d9e9c605af0e31b2ea5938 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -36,8 +36,8 @@
  * private:
  *
  * what:  Decipher a boolean value
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od  + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od  + the descriptor for this arg +
  *
  * doc:
  *  Decipher a true or false value for a boolean valued option argument.
@@ -47,8 +47,8 @@
 void
 optionBooleanVal(tOptions * opts, tOptDesc * od)
 {
-    char* pz;
-    bool  res = true;
+    char * pz;
+    bool   res = true;
 
     if (INQUERY_CALL(opts, od))
         return;
index 9b221a1ef926affd7a88bbc104052a6dc671fc21..eff8ec0133542dd980e4f1dbc2da48562d958643 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
index 0409446356587089075165dfbc9bdb66c1bb8427..03156ca6d8896eb735cba5017c4d17b0cfc1e1c2 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -33,7 +33,7 @@ static void
 file_preset(tOptions * opts, char const * fname, int dir);
 
 static char *
-handle_comment(char* txt);
+handle_comment(char * txt);
 
 static char *
 handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir);
@@ -87,9 +87,9 @@ skip_unkn(char const * txt)
 /*=export_func  configFileLoad
  *
  * what:  parse a configuration file
- * arg:   + char const*     + fname + the file to load +
+ * arg:   + char const * + fname + the file to load +
  *
- * ret_type:  const tOptionValue*
+ * ret_type:  const tOptionValue *
  * ret_desc:  An allocated, compound value structure
  *
  * doc:
@@ -146,11 +146,11 @@ configFileLoad(char const * fname)
 /*=export_func  optionFindValue
  *
  * what:  find a hierarcicaly valued option instance
- * arg:   + const tOptDesc* + odesc + an option with a nested arg type +
- * arg:   + char const*     + name  + name of value to find +
- * arg:   + char const*     + val   + the matching value    +
+ * arg:   + const tOptDesc * + odesc + an option with a nested arg type +
+ * arg:   + char const *     + name  + name of value to find +
+ * arg:   + char const *     + val   + the matching value    +
  *
- * ret_type:  const tOptionValue*
+ * ret_type:  const tOptionValue *
  * ret_desc:  a compound value structure
  *
  * doc:
@@ -182,9 +182,9 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
     }
 
     else do {
-        tArgList* argl  = odesc->optCookie;
-        int       argct = argl->useCt;
-        void **   poptv = (void**)(intptr_t)(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 = (tOptionValue*)*poptv;
+            res = (tOptionValue *)*poptv;
             break;
         }
 
@@ -221,12 +221,12 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
  * FIXME: the handling of 'pzName' and 'pzVal' is just wrong.
  *
  * what:  find a hierarcicaly valued option instance
- * arg:   + const tOptDesc* + odesc + an option with a nested arg type +
- * arg:   + const tOptionValue* + pPrevVal + the last entry +
- * arg:   + char const*     + name     + name of value to find +
- * arg:   + char const*     + value    + the matching value    +
+ * arg:   + const tOptDesc * + odesc + an option with a nested arg type +
+ * arg:   + const tOptionValue * + pPrevVal + the last entry +
+ * arg:   + char const *     + name     + name of value to find +
+ * arg:   + char const *     + value    + the matching value    +
  *
- * ret_type:  const tOptionValue*
+ * ret_type:  const tOptionValue *
  * ret_desc:  a compound value structure
  *
  * doc:
@@ -249,7 +249,7 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
                     char const * pzName, char const * pzVal)
 {
     bool old_found = false;
-    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;
-        void** poptv = (void**)(intptr_t)argl->apzArgs;
+        tArgList * argl = odesc->optCookie;
+        int        ct   = argl->useCt;
+        void **   poptv = (void **)argl->apzArgs;
 
         while (--ct >= 0) {
-            tOptionValue* pOV = *(poptv++);
+            tOptionValue * pOV = *(poptv++);
             if (old_found) {
                 res = pOV;
                 break;
@@ -288,10 +288,10 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
 /*=export_func  optionGetValue
  *
  * what:  get a specific value from a hierarcical list
- * arg:   + const tOptionValue* + pOptValue + a hierarchcal value +
- * arg:   + char const*   + valueName + name of value to get +
+ * arg:   + const tOptionValue * + pOptValue + a hierarchcal value +
+ * arg:   + char const *         + valueName + name of value to get +
  *
- * ret_type:  const tOptionValue*
+ * ret_type:  const tOptionValue *
  * ret_desc:  a compound value structure
  *
  * doc:
@@ -326,10 +326,10 @@ optionGetValue(tOptionValue const * oov, char const * vname)
 
     if (arg_list->useCt > 0) {
         int     ct     = arg_list->useCt;
-        void ** ovlist = (void**)(intptr_t)(arg_list->apzArgs);
+        void ** ovlist = (void **)(arg_list->apzArgs);
 
         if (vname == NULL) {
-            res = (tOptionValue*)*ovlist;
+            res = (tOptionValue *)*ovlist;
 
         } else do {
             tOptionValue * opt_val = *(ovlist++);
@@ -347,10 +347,10 @@ optionGetValue(tOptionValue const * oov, char const * vname)
 /*=export_func  optionNextValue
  *
  * what:  get the next value from a hierarchical list
- * arg:   + const tOptionValue* + pOptValue + a hierarchcal list value +
- * arg:   + const tOptionValue* + pOldValue + a value from this list   +
+ * arg:   + const tOptionValue * + pOptValue + a hierarchcal list value +
+ * arg:   + const tOptionValue * + pOldValue + a value from this list   +
  *
- * ret_type:  const tOptionValue*
+ * ret_type:  const tOptionValue *
  * ret_desc:  a compound value structure
  *
  * doc:
@@ -385,7 +385,7 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
     arg_list = ov_list->v.nestVal;
     {
         int     ct    = arg_list->useCt;
-        void ** o_list = (void**)(intptr_t)(arg_list->apzArgs);
+        void ** o_list = (void **)(arg_list->apzArgs);
 
         while (ct-- > 0) {
             tOptionValue * nov = *(o_list++);
@@ -395,7 +395,7 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
 
                 } else {
                     err = 0;
-                    res = (tOptionValue*)*o_list;
+                    res = (tOptionValue *)*o_list;
                 }
                 break;
             }
@@ -498,9 +498,9 @@ file_preset(tOptions * opts, char const * fname, int dir)
  *  but actually I don't care that much.  It ends with "-->".
  */
 static char *
-handle_comment(char* txt)
+handle_comment(char * txt)
 {
-    char* pz = strstr(txt, "-->");
+    char * pz = strstr(txt, "-->");
     if (pz != NULL)
         pz += 3;
     return pz;
@@ -515,8 +515,8 @@ handle_comment(char* txt)
 static char *
 handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir)
 {
-    char* pzName = txt++;
-    char* pzEnd  = strchr(txt, NL);
+    char * pzName = txt++;
+    char * pzEnd  = strchr(txt, NL);
 
     if (pzEnd == NULL)
         return txt + strlen(txt);
@@ -547,8 +547,8 @@ handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir)
      *  on to a newline *not* preceded by a backslash.
      */
     if (pzEnd[-1] == '\\') {
-        char* pcD = pzEnd-1;
-        char* pcS = pzEnd;
+        char * pcD = pzEnd-1;
+        char * pcS = pzEnd;
 
         for (;;) {
             char ch = *(pcS++);
@@ -920,9 +920,9 @@ handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir)
     tOptionLoadMode mode = option_load_mode;
     tOptionValue    valu;
 
-    char* pzName = ++txt;
-    char* pzData;
-    char* pcNulPoint;
+    char * pzName = ++txt;
+    char * pzData;
+    char * pcNulPoint;
 
     txt = SPN_VALUE_NAME_CHARS(txt);
     pcNulPoint = txt;
@@ -931,8 +931,8 @@ handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir)
     switch (*txt) {
     case ' ':
     case '\t':
-        txt = (void *)(intptr_t)parse_attrs(
-            opts, SPN_WHITESPACE_CHARS(txt), &mode, &valu);
+        txt = VOIDP(parse_attrs(
+            opts, SPN_WHITESPACE_CHARS(txt), &mode, &valu));
         if (txt == NULL)
             return txt;
         if (*txt == '>')
@@ -1096,8 +1096,8 @@ intern_file_load(tOptions * opts)
  *
  * what: Load the locatable config files, in order
  *
- * arg:  + tOptions*   + opts + program options descriptor +
- * arg:  + char const* + prog + program name +
+ * arg:  + tOptions *   + opts + program options descriptor +
+ * arg:  + char const * + prog + program name +
  *
  * ret_type:  int
  * ret_desc:  0 -> SUCCESS, -1 -> FAILURE
@@ -1137,8 +1137,7 @@ optionFileLoad(tOptions * opts, char const * prog)
      * of this pointer to point to writable memory.
      */
     {
-        char const ** pp =
-            (char const **)(void *)(intptr_t)&(opts->pzProgName);
+        char const ** pp = VOIDP(&(opts->pzProgName));
         *pp = prog;
     }
 
@@ -1150,8 +1149,8 @@ optionFileLoad(tOptions * opts, char const * prog)
  * private:
  *
  * what:  Load an option rc/ini file
- * arg:   + tOptions* + opts  + program options descriptor +
- * arg:   + tOptDesc* + odesc + the descriptor for this arg +
+ * arg:   + tOptions * + opts  + program options descriptor +
+ * arg:   + tOptDesc * + odesc + the descriptor for this arg +
  *
  * doc:
  *  Processes the options found in the file named with
index 952aac95065d5aa6bd601e9ec18634845d880c60..65260a27222d5ab0b869b3e27a8b3883d695d406 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -38,8 +38,8 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p);
  * private:
  *
  * what:  escape-process a string fragment
- * arg:   + char const + pzScan  + points to character after the escape +
- * arg:   + char       + pRes    + Where to put the result byte +
+ * arg:   + char const * + pzScan  + points to character after the escape +
+ * arg:   + char *       + pRes    + Where to put the result byte +
  * arg:   + unsigned int + nl_ch   + replacement char if scanned char is \n +
  *
  * ret-type: unsigned int
@@ -184,7 +184,7 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
 
             case '*':
             {
-                char* p = strstr( ps+2, "*/" );
+                char * p = strstr( ps+2, "*/" );
                 /*
                  *  Skip to terminating star slash
                  */
@@ -218,10 +218,10 @@ contiguous_quote(char ** pps, char * pq, int * lnct_p)
  * private:
  *
  * what:  concatenate and escape-process strings
- * arg:   + char* + pzScan  + The *MODIFIABLE* input buffer +
- * arg:   + int*  + lnct_p  + The (possibly NULL) pointer to a line count +
+ * arg:   + char * + pzScan  + The *MODIFIABLE* input buffer +
+ * arg:   + int *  + lnct_p  + The (possibly NULL) pointer to a line count +
  *
- * ret-type: char*
+ * ret-type: char *
  * ret-desc: The address of the text following the processed strings.
  *           The return value is NULL if the strings are ill-formed.
  *
@@ -245,8 +245,8 @@ ao_string_cook(char * pzScan, int * lnct_p)
      *  It is a quoted string.  Process the escape sequence characters
      *  (in the set "abfnrtv") and make sure we find a closing quote.
      */
-    char* pzD = pzScan++;
-    char* pzS = pzScan;
+    char * pzD = pzScan++;
+    char * pzS = pzScan;
 
     if (lnct_p == NULL)
         lnct_p = &l;
index e759e8c0a5f070493367e0ac9ea3d4db9de76afc..3345558bec72e1015ad4f711d274d11b563f3588 100644 (file)
@@ -14,7 +14,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -186,14 +186,14 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
 {
     /*
      *  Return the matching index as a pointer sized integer.
-     *  The result gets stashed in a char* pointer.
+     *  The result gets stashed in a char * pointer.
      */
     uintptr_t   res = name_ct;
-    size_t      len = strlen((const char*)name);
+    size_t      len = strlen((char *)name);
     uintptr_t   idx;
 
     if (IS_DEC_DIGIT_CHAR(*name)) {
-        char * pz = (char *)(void *)(intptr_t)name;
+        char * pz = VOIDP(name);
         unsigned long val = strtoul(pz, &pz, 0);
         if ((*pz == NUL) && (val < name_ct))
             return (uintptr_t)val;
@@ -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((char*)(intptr_t)paz_names[idx], (char*)(intptr_t)name, len) == 0) {
+        if (strncmp((char *)paz_names[idx], (char *)name, len) == 0) {
             if (paz_names[idx][len] == NUL)
                 return idx;  /* full match */
 
@@ -242,7 +242,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
  * what:  Convert between enumeration values and strings
  * private:
  *
- * arg:   tOptDesc*,     pOD,       enumeration option description
+ * arg:   tOptDesc *,    pOD,       enumeration option description
  * arg:   unsigned int,  enum_val,  the enumeration value to map
  *
  * ret_type:  char const *
@@ -265,8 +265,8 @@ optionKeywordName(tOptDesc * pOD, unsigned int enum_val)
  * what:  Convert from a string to an enumeration value
  * private:
  *
- * arg:   tOptions*,     pOpts,     the program options descriptor
- * arg:   tOptDesc*,     pOD,       enumeration option description
+ * arg:   tOptions *,    pOpts,     the program options descriptor
+ * arg:   tOptDesc *,    pOD,       enumeration option description
  * arg:   char const * const *,  paz_names, list of enumeration names
  * arg:   unsigned int,  name_ct,   number of names in list
  *
@@ -509,7 +509,7 @@ find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
  *
  * arg:   tOptDesc *,  od,   the set membership option description
  *
- * ret_type: char*
+ * ret_type: char *
  * ret_desc: the names of the set bits
  *
  * doc:   This converts the OPT_VALUE_name mask value to a allocated string.
@@ -521,7 +521,7 @@ optionMemberList(tOptDesc * od)
     uintptr_t    sv = od->optArg.argIntptr;
     char * res;
     (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
-    res = (void *)(intptr_t)od->optArg.argString;
+    res = VOIDP(od->optArg.argString);
     od->optArg.argIntptr = sv;
     return res;
 }
@@ -530,8 +530,8 @@ optionMemberList(tOptDesc * od)
  * what:  Convert between bit flag values and strings
  * private:
  *
- * arg:   tOptions*,     opts,     the program options descriptor
- * arg:   tOptDesc*,     od,       the set membership option description
+ * arg:   tOptions *,     opts,     the program options descriptor
+ * arg:   tOptDesc *,     od,       the set membership option description
  * arg:   char const * const *,
  *                       nm_list,  list of enumeration names
  * arg:   unsigned int,  nm_ct,    number of names in list
@@ -634,12 +634,12 @@ optionSetMembers(tOptions * opts, tOptDesc * od,
         if (nm_ct < (8 * sizeof(uintptr_t)))
             res &= (1UL << nm_ct) - 1UL;
 
-        od->optCookie = (void *)res;
+        od->optCookie = VOIDP(res);
     }
     return;
 
 fail_return:
-    od->optCookie = (void *)0;
+    od->optCookie = VOIDP(0);
 }
 
 /** @}
index 7b6615e5e91b44c8a0f3a6c07d0e4ba3c437d918..36ae2e535a6c430721ad444e0f826380fe5a0b61 100644 (file)
@@ -13,7 +13,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -48,7 +48,7 @@ LOCAL void
 doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
 {
     char const *        env_opts = getenv(pOpts->pzPROGNAME);
-    token_list_t      pTL;
+    token_list_t *      pTL;
     int                 sv_argc;
     proc_state_mask_t   sv_flag;
     char **             sv_argv;
@@ -82,7 +82,7 @@ doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
      */
     {
         uintptr_t v = (uintptr_t)(pTL->tkn_list);
-        pOpts->origArgVect = (void *)(v - sizeof(char *));
+        pOpts->origArgVect = VOIDP(v - sizeof(char *));
     }
     pOpts->origArgCt   = (unsigned int)pTL->tkn_ct   + 1;
     pOpts->fOptSet    &= ~OPTPROC_ERRSTOP;
@@ -192,7 +192,7 @@ env_presets(tOptions * pOpts, teEnvPresetType type)
 {
     int        ct;
     tOptState  st;
-    char     pzFlagName;
+    char *     pzFlagName;
     size_t     spaceLeft;
     char       zEnvName[ AO_NAME_SIZE ];
 
index d5fdb4a98b71e5db7a628698c333a3f908cdb874..7d92875d84c33e6069fa2056dfd45043605a8a07 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -107,7 +107,7 @@ open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
         /* NOTREACHED */
 
     if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
-        pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
+        pOD->optCookie = VOIDP(pOD->optArg.argString);
     else
         AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
 
@@ -131,7 +131,7 @@ fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
         /* NOTREACHED */
 
     if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
-        pOD->optCookie = (void *)(intptr_t)pOD->optArg.argString;
+        pOD->optCookie = VOIDP(pOD->optArg.argString);
     else
         AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
 
@@ -143,8 +143,8 @@ fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
  * private:
  *
  * what:  Decipher a boolean value
- * arg:   + tOptions    + pOpts    + program options descriptor  +
- * arg:   + tOptDesc    + pOptDesc + the descriptor for this arg +
+ * arg:   + tOptions *    + pOpts    + program options descriptor  +
+ * arg:   + tOptDesc *    + pOptDesc + the descriptor for this arg +
  * arg:   + teOptFileType + ftype    + File handling type          +
  * arg:   + tuFileMode    + mode     + file open mode (if needed)  +
  *
@@ -153,7 +153,7 @@ fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
  *   The mode specifies if the file must exist, must not exist or may
  *   (or may not) exist.  The mode may also specify opening the
  *   file: don't, open just the descriptor (fd), or open as a stream
- *   (FILE* pointer).
+ *   (FILE * pointer).
 =*/
 void
 optionFileCheck(tOptions * pOpts, tOptDesc * pOD,
index 8d4789628cef179042bbe92a80d3479a687d76db..90591cc9243dc5cfb294e16bb922ebefb14378c0 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -58,7 +58,7 @@ static tSuccess
 get_opt_arg_may(tOptions * pOpts, tOptState * o_st);
 
 static tSuccess
-get_opt_arg_none(tOptions * pOpts, tOptState* o_st);
+get_opt_arg_none(tOptions * pOpts, tOptState * o_st);
 /* = = = END-STATIC-FORWARD = = = */
 
 /**
@@ -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  = (char *)(intptr_t)p;
+            *arg_pp  = (char *)p;
             return res;
 
         default:
@@ -409,9 +409,9 @@ opt_find_long(tOptions * opts, char const * opt_name, tOptState * state)
  * @param pOptState  state about current option
  */
 LOCAL tSuccess
-opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState)
+opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState)
 {
-    tOptDesc pRes = pOpts->pOptDesc;
+    tOptDesc * pRes = pOpts->pOptDesc;
     int        ct   = pOpts->optCt;
 
     /*
@@ -554,7 +554,7 @@ get_opt_arg_may(tOptions * pOpts, tOptState * o_st)
         if (*++pOpts->pzCurOpt != NUL)
             o_st->pzOptArg = pOpts->pzCurOpt;
         else {
-            char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
+            char * pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
 
             /*
              *  BECAUSE it is optional, we must make sure
@@ -577,7 +577,7 @@ get_opt_arg_may(tOptions * pOpts, tOptState * o_st)
          */
         if (  (o_st->pzOptArg == NULL)
            && (! NAMED_OPTS(pOpts))) {
-            char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
+            char * pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
 
             /*
              *  BECAUSE it is optional, we must make sure
@@ -616,7 +616,7 @@ get_opt_arg_may(tOptions * pOpts, tOptState * o_st)
  *  @returns SUCCESS or FAILURE
  */
 static tSuccess
-get_opt_arg_none(tOptions * pOpts, tOptState* o_st)
+get_opt_arg_none(tOptions * pOpts, tOptState * o_st)
 {
     /*
      *  No option argument.  Make sure next time around we find
@@ -711,7 +711,7 @@ find_opt(tOptions * opts, tOptState * o_st)
          *  strip off the "const" quality of the "default_opt" field.
          */
         while (*(++pz) == '-')   ;
-        def_opt  = (void *)(intptr_t)&(opts->specOptIdx.default_opt);
+        def_opt  = VOIDP(&(opts->specOptIdx.default_opt));
         def      = *def_opt;
         *def_opt = NO_EQUIVALENT;
         res      = opt_find_long(opts, pz, o_st);
index 20e6c15c9fd6c5f335582f72528a4ba52dd20a41..0f05b3efbc446892639f5937e210bdc98f540afd 100644 (file)
@@ -294,7 +294,7 @@ doUsageOpt(tOptions * opts, tOptDesc * od)
     (void)opts;
     (void)od;
 }
-/* extracted from optmain.tlib near line 1245 */
+/* extracted from optmain.tlib near line 1250 */
 
 /**
  * The directory containing the data associated with genshellopt.
@@ -406,11 +406,11 @@ AO_gettext(char const * pz)
     if (option_xlateable_txt.field_ct != 0) {
         res = dgettext("libopts", pz);
         if (res == pz)
-            res = (char *)(void *)_(pz);
+            res = (char *)VOIDP(_(pz));
     } else
-        res = (char *)(void *)_(pz);
+        res = (char *)VOIDP(_(pz));
 #else
-    res = (char *)(void *)_(pz);
+    res = (char *)VOIDP(_(pz));
 #endif
     if (res == pz)
         return res;
@@ -447,7 +447,7 @@ translate_option_strings(void)
          *  Do the translations.  The first pointer follows the field count
          *  field.  The field count field is the size of a pointer.
          */
-        char ** ppz = (char**)(void*)&(option_xlateable_txt);
+        char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
         int     ix  = option_xlateable_txt.field_ct;
 
         do {
@@ -457,16 +457,16 @@ translate_option_strings(void)
         /* prevent re-translation and disable "libopts" domain lookup */
         option_xlateable_txt.field_ct = 0;
 
-        coerce_it((void*)&(opts->pzCopyright));
-        coerce_it((void*)&(opts->pzCopyNotice));
-        coerce_it((void*)&(opts->pzFullVersion));
-        coerce_it((void*)&(opts->pzUsageTitle));
-        coerce_it((void*)&(opts->pzExplain));
-        coerce_it((void*)&(opts->pzDetail));
+        coerce_it(VOIDP(&(opts->pzCopyright)));
+        coerce_it(VOIDP(&(opts->pzCopyNotice)));
+        coerce_it(VOIDP(&(opts->pzFullVersion)));
+        coerce_it(VOIDP(&(opts->pzUsageTitle)));
+        coerce_it(VOIDP(&(opts->pzExplain)));
+        coerce_it(VOIDP(&(opts->pzDetail)));
         {
             tOptDesc * od = opts->pOptDesc;
             for (ix = opts->optCt; ix > 0; ix--, od++)
-                coerce_it((void*)&(od->pzText));
+                coerce_it(VOIDP(&(od->pzText)));
         }
     }
 }
@@ -555,19 +555,19 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   puts(_("allocation of %d bytes failed\n"));
 #line 53 "../init.c"
   puts(_("AutoOpts function called without option descriptor\n"));
-#line 90 "../init.c"
+#line 86 "../init.c"
   puts(_("\tThis exceeds the compiled library version:  "));
-#line 88 "../init.c"
+#line 84 "../init.c"
   puts(_("Automated Options Processing Error!\n"
        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
 #line 80 "../autoopts.c"
   puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 92 "../init.c"
+#line 88 "../init.c"
   puts(_("\tThis is less than the minimum library version:  "));
 #line 121 "../version.c"
   puts(_("Automated Options version %s\n"
        "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 82 "../makeshell.c"
+#line 87 "../makeshell.c"
   puts(_("(AutoOpts bug):  %s.\n"));
 #line 90 "../reset.c"
   puts(_("optionResetOpt() called, but reset-option not configured"));
@@ -591,9 +591,9 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   puts(_("%s: Command line arguments required\n"));
 #line 43 "../alias.c"
   puts(_("%d %s%s options allowed\n"));
-#line 89 "../makeshell.c"
+#line 94 "../makeshell.c"
   puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 301 "../makeshell.c"
+#line 306 "../makeshell.c"
   puts(_("interprocess pipe"));
 #line 168 "../version.c"
   puts(_("error: version option argument '%c' invalid.  Use:\n"
@@ -671,9 +671,9 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   puts(_("Try '%s %s' for more information.\n"));
 #line 45 "../alias.c"
   puts(_("one %s%s option allowed\n"));
-#line 203 "../makeshell.c"
+#line 208 "../makeshell.c"
   puts(_("standard output"));
-#line 938 "../makeshell.c"
+#line 943 "../makeshell.c"
   puts(_("standard output"));
 #line 274 "../usage.c"
   puts(_("standard output"));
@@ -691,9 +691,9 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
   puts(_("standard error"));
 #line 175 "../version.c"
   puts(_("standard error"));
-#line 203 "../makeshell.c"
+#line 208 "../makeshell.c"
   puts(_("write"));
-#line 938 "../makeshell.c"
+#line 943 "../makeshell.c"
   puts(_("write"));
 #line 273 "../usage.c"
   puts(_("write"));
@@ -745,7 +745,7 @@ by the newly generated text.  The first '#!' line will be regenerated.\n"));
 #line 380 "../usage.c"
   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
        "hyphen and the flag character.\n"));
-#line 916 "../makeshell.c"
+#line 921 "../makeshell.c"
   puts(_("\n"
        "= = = = = = = =\n\n"
        "This incarnation of genshell will produce\n"
index 9b7416ded2497e1f8740f73596ee936edb180a61..7d3ea3cbf16040c2cbdbea249fb616e4fe7b0be6 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2015 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index 9374528126dc6f602960cbadba790d47caad3d99..e02e1e1b9bc797b69908c420238c80aa3a4ce0c7 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -69,7 +69,7 @@ validate_struct(tOptions * opts, char const * pname)
          */
         if ((opts->fOptSet & OPTPROC_NO_XLAT_MASK) == OPTPROC_NXLAT_OPT)
             opts->fOptSet |= OPTPROC_NXLAT_OPT_CFG;
-        (*opts->pTransProc)();
+        opts->pTransProc();
     }
 
     /*
@@ -81,10 +81,6 @@ validate_struct(tOptions * opts, char const * pname)
        && (  (opts->structVersion > OPTIONS_STRUCT_VERSION  )
           || (opts->structVersion < OPTIONS_MINIMUM_VERSION )
        )  )  {
-
-        static char const ao_ver_string[] =
-            STR(AO_CURRENT)":"STR(AO_REVISION)":"STR(AO_AGE)"\n";
-
         fprintf(stderr, zwrong_ver, pname, NUM_TO_VER(opts->structVersion));
         if (opts->structVersion > OPTIONS_STRUCT_VERSION )
             fputs(ztoo_new, stderr);
@@ -101,17 +97,20 @@ validate_struct(tOptions * opts, char const * pname)
      */
     if (opts->pzProgName == NULL) {
         char const *  pz = strrchr(pname, DIRCH);
+        char const ** pp =
+            (char const **)(void **)&(opts->pzProgName);
 
         if (pz != NULL)
-            opts->pzProgName = pz+1;
+            *pp = pz+1;
         else
-            opts->pzProgName = pname;
+            *pp = pname;
 
-        pz = pathfind(getenv("PATH"), (char *)(intptr_t)pname, "rx");
+        pz = pathfind(getenv("PATH"), (char *)pname, "rx");
         if (pz != NULL)
-            pname = (void *)(intptr_t)pz;
+            pname = VOIDP(pz);
 
-        opts->pzProgPath = pname;
+        pp  = (char const **)VOIDP(&(opts->pzProgPath));
+        *pp = pname;
 
         /*
          *  when comparing long names, these are equivalent
index 6936ad572f8827ef275a14b55ad380433b71d4ec..2ae151b92953d8d65237393540c023258145cee6 100644 (file)
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2014 Free Software Foundation, Inc.
+   Copyright (C) 2001-2005, 2009-2015 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index a0ff3624745a5e7e3451bf4fddbdff6604571bd8..97bc359ed8c52925eed7b24fa94283a4e6aa2dc2 100644 (file)
@@ -2,6 +2,8 @@
 #include "autoopts/project.h"
 #define  LOCAL static
 #include "ao-strs.h"
+static char const ao_ver_string[] =
+    "41:0:16\n";
 #include "autoopts/options.h"
 #include "autoopts/usage-txt.h"
 #include "genshell.h"
index 065449255022fb51e14073838ad1ed9ba1369fd1..b5230afd382a2b0bb04ed6a7c745fda249206cd0 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -94,10 +94,10 @@ get_realpath(char * buf, size_t b_sz)
  * private:
  *
  * what:  translate and construct a path
- * arg:   + char*       + p_buf     + The result buffer +
- * arg:   + int         + b_sz      + The size of this buffer +
- * arg:   + char const* + fname     + The input name +
- * arg:   + char const* + prg_path  + The full path of the current program +
+ * arg:   + char *       + p_buf     + The result buffer +
+ * arg:   + int          + b_sz      + The size of this buffer +
+ * arg:   + char const * + fname     + The input name +
+ * arg:   + char const * + prg_path  + The full path of the current program +
  *
  * ret-type: bool
  * ret-desc: true if the name was handled, otherwise false.
@@ -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"), (char*)(intptr_t)prg_path, "rx");
+        path = pathfind(getenv("PATH"), (char *)prg_path, "rx");
 
         if (path == NULL)
             return false;
@@ -544,8 +544,8 @@ load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
  *
  * what:  process a string for an option name and value
  *
- * arg:   tOptions*,   opts,  program options descriptor
- * arg:   char const*, line,  NUL-terminated text
+ * arg:   tOptions *,   opts,  program options descriptor
+ * arg:   char const *, line,  NUL-terminated text
  *
  * doc:
  *
index baef8fcb5f799f0e34927efa48103616735c4066..a61df422c857c7b3e4e8ae818e25cf56d04df71f 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
  */
 
+ static inline unsigned char to_uchar (char ch) { return ch; }
+
+#define UPPER(_c) (toupper(to_uchar(_c)))
+#define LOWER(_c) (tolower(to_uchar(_c)))
+
 /* = = = START-STATIC-FORWARD = = = */
 static void
 emit_var_text(char const * prog, char const * var, int fdin);
@@ -101,7 +106,7 @@ fserr_exit(char const * prog, char const * op, char const * fname)
  * private:
  *
  * what:  Decipher a boolean value
- * arg:   + tOptions* + pOpts    + program options descriptor +
+ * arg:   + tOptions * + pOpts    + program options descriptor +
  *
  * doc:
  *  Emit a shell script that will parse the command line options.
@@ -396,13 +401,13 @@ 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;
         }
 
-        pp  = (char **)(void *)(intptr_t)&(opts->pzProgPath);
+        pp  = VOIDP(&(opts->pzProgPath));
         *pp = tm_nm_buf;
-        pp  = (char **)(void *)(intptr_t)&(opts->pzProgName);
+        pp  = VOIDP(&(opts->pzProgName));
         *pp = tm_nm_buf;
     }
 
@@ -410,8 +415,8 @@ emit_usage(tOptions * opts)
     text_to_var(opts, TT_USAGE,     NULL);
 
     {
-        tOptDesc* pOptDesc = opts->pOptDesc;
-        int       optionCt = opts->optCt;
+        tOptDesc * pOptDesc = opts->pOptDesc;
+        int        optionCt = opts->optCt;
 
         for (;;) {
             if (pOptDesc->pOptProc == optionPrintVersion) {
@@ -601,8 +606,8 @@ emit_inaction(tOptions * opts, tOptDesc * od)
 static void
 emit_flag(tOptions * opts)
 {
-    tOptDesc* od = opts->pOptDesc;
-    int       opt_ct = opts->optCt;
+    tOptDesc * od = opts->pOptDesc;
+    int        opt_ct = opts->optCt;
 
     fputs(zOptionCase, stdout);
 
@@ -653,7 +658,7 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
              *  They must not be the same.  They cannot be, because it would
              *  not compile correctly if they were.
              */
-            while (toupper((unsigned char)od->pz_Name[match_ct]) == toupper((unsigned char)name[match_ct]))
+            while (UPPER(od->pz_Name[match_ct]) == UPPER(name[match_ct]))
                 match_ct++;
 
             if (match_ct > min_match_ct)
@@ -666,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;
@@ -772,7 +777,7 @@ load_old_output(char const * fname, char const * pname)
      *  Read in all the data as fast as our OS will let us.
      */
     for (;;) {
-        size_t inct = fread((void*)scan, 1, (size_t)stbf.st_size, fp);
+        size_t inct = fread(VOIDP(scan), 1, (size_t)stbf.st_size, fp);
         if (inct == 0)
             break;
 
@@ -845,8 +850,8 @@ open_out(char const * fname, char const * pname)
  * private:
  * what: The usage function for the genshellopt generated program
  *
- * arg:  + tOptions* + opts    + program options descriptor +
- * arg:  + int       + exit_cd + usage text type to produce +
+ * arg:  + tOptions * + opts    + program options descriptor +
+ * arg:  + int        + exit_cd + usage text type to produce +
  *
  * doc:
  *  This function is used to create the usage strings for the option
@@ -901,11 +906,11 @@ genshelloptUsage(tOptions * opts, int exit_cd)
      */
     {
         char *  pz;
-        char ** pp = (char **)(void *)(intptr_t)&(optionParseShellOptions->pzProgName);
+        char ** pp = VOIDP(&(optionParseShellOptions->pzProgName));
         AGDUPSTR(pz, optionParseShellOptions->pzPROGNAME, "prog name");
         *pp = pz;
         while (*pz != NUL) {
-            *pz = (char)tolower((unsigned char)*pz);
+            *pz = (char)LOWER(*pz);
             pz++;
         }
     }
index 96e45530fb479de8053760bd5bd75f0a07d40a23..f4fb22620932fe9710a0708308b5d34def7a0a45 100644 (file)
@@ -12,7 +12,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -53,8 +53,8 @@ static xml_xlate_t const xml_xlate[] = {
 static void
 remove_continuation(char * src);
 
-static char const*
-scan_q_str(char const* pzTxt);
+static char const *
+scan_q_str(char const * pzTxt);
 
 static tOptionValue *
 add_string(void ** pp, char const * name, size_t nm_len,
@@ -64,11 +64,11 @@ static tOptionValue *
 add_bool(void ** pp, char const * name, size_t nm_len,
          char const * val, size_t d_len);
 
-static tOptionValue*
+static tOptionValue *
 add_number(void ** pp, char const * name, size_t nm_len,
            char const * val, size_t d_len);
 
-static tOptionValue*
+static tOptionValue *
 add_nested(void ** pp, char const * name, size_t nm_len,
            char * val, size_t d_len);
 
@@ -98,7 +98,7 @@ sort_list(tArgList * arg_list);
 static void
 remove_continuation(char * src)
 {
-    char* pzD;
+    char * pzD;
 
     do  {
         while (*src == NL)  src++;
@@ -133,8 +133,8 @@ remove_continuation(char * src)
 /**
  *  Find the end of a quoted string, skipping escaped quote characters.
  */
-static char const*
-scan_q_str(char const* pzTxt)
+static char const *
+scan_q_str(char const * pzTxt)
 {
     char q = *(pzTxt++); /* remember the type of quote */
 
@@ -182,7 +182,7 @@ static tOptionValue *
 add_string(void ** pp, char const * name, size_t nm_len,
            char const * val, size_t d_len)
 {
-    tOptionValue* pNV;
+    tOptionValue * pNV;
     size_t sz = nm_len + d_len + sizeof(*pNV);
 
     pNV = AGALOC(sz, "option name/str value pair");
@@ -254,7 +254,7 @@ add_bool(void ** pp, char const * name, size_t nm_len,
     else new_val->v.boolVal = ! IS_FALSE_TYPE_CHAR(*val);
 
     new_val->valType = OPARG_TYPE_BOOLEAN;
-    new_val->pzName = (char*)(new_val + 1);
+    new_val->pzName = (char *)(new_val + 1);
     memcpy(new_val->pzName, name, nm_len);
     new_val->pzName[ nm_len ] = NUL;
     addArgListEntry(pp, new_val);
@@ -272,7 +272,7 @@ add_bool(void ** pp, char const * name, size_t nm_len,
  *
  * @returns the new value structure
  */
-static tOptionValue*
+static tOptionValue *
 add_number(void ** pp, char const * name, size_t nm_len,
            char const * val, size_t d_len)
 {
@@ -291,7 +291,7 @@ add_number(void ** pp, char const * name, size_t nm_len,
         new_val->v.longVal = strtol(val, 0, 0);
 
     new_val->valType = OPARG_TYPE_NUMERIC;
-    new_val->pzName  = (char*)(new_val + 1);
+    new_val->pzName  = (char *)(new_val + 1);
     memcpy(new_val->pzName, name, nm_len);
     new_val->pzName[ nm_len ] = NUL;
     addArgListEntry(pp, new_val);
@@ -309,18 +309,18 @@ add_number(void ** pp, char const * name, size_t nm_len,
  *
  * @returns the new value structure
  */
-static tOptionValue*
+static tOptionValue *
 add_nested(void ** pp, char const * name, size_t nm_len,
            char * val, size_t d_len)
 {
-    tOptionValue* new_val;
+    tOptionValue * new_val;
 
     if (d_len == 0) {
         size_t sz = nm_len + sizeof(*new_val) + 1;
         new_val = AGALOC(sz, "empty nest");
         new_val->v.nestVal = NULL;
         new_val->valType = OPARG_TYPE_HIERARCHY;
-        new_val->pzName = (char*)(new_val + 1);
+        new_val->pzName = (char *)(new_val + 1);
         memcpy(new_val->pzName, name, nm_len);
         new_val->pzName[ nm_len ] = NUL;
 
@@ -341,11 +341,11 @@ add_nested(void ** pp, char const * name, size_t nm_len,
 static char const *
 scan_name(char const * name, tOptionValue * res)
 {
-    tOptionValue* new_val;
-    char const * pzScan = name+1; /* we know first char is a name char */
-    char const * pzVal;
-    size_t       nm_len = 1;
-    size_t       d_len = 0;
+    tOptionValue * new_val;
+    char const *   pzScan = name+1; /* we know first char is a name char */
+    char const *   pzVal;
+    size_t         nm_len = 1;
+    size_t         d_len = 0;
 
     /*
      *  Scan over characters that name a value.  These names may not end
@@ -645,13 +645,13 @@ unload_arg_list(tArgList * arg_list)
     char const ** pnew_val = arg_list->apzArgs;
 
     while (ct-- > 0) {
-        tOptionValue* new_val = (tOptionValue*)(void*)(intptr_t)*(pnew_val++);
+        tOptionValue * new_val = (tOptionValue *)VOIDP(*(pnew_val++));
         if (new_val->valType == OPARG_TYPE_HIERARCHY)
             unload_arg_list(new_val->v.nestVal);
         AGFREE(new_val);
     }
 
-    AGFREE((void*)arg_list);
+    AGFREE(arg_list);
 }
 
 /*=export_func  optionUnloadNested
@@ -675,7 +675,7 @@ optionUnloadNested(tOptionValue const * opt_val)
 
     unload_arg_list(opt_val->v.nestVal);
 
-    AGFREE((void*)(intptr_t)opt_val);
+    AGFREE(opt_val);
 }
 
 /**
@@ -694,8 +694,8 @@ sort_list(tArgList * arg_list)
      */
     for (ix = 0; ++ix < lm;) {
         int iy = ix-1;
-        tOptionValue * new_v = C(tOptionValue *, (intptr_t)arg_list->apzArgs[ix]);
-        tOptionValue * old_v = C(tOptionValue *, (intptr_t)arg_list->apzArgs[iy]);
+        tOptionValue * new_v = C(tOptionValue *, arg_list->apzArgs[ix]);
+        tOptionValue * old_v = C(tOptionValue *, arg_list->apzArgs[iy]);
 
         /*
          *  For as long as the new entry precedes the "old" entry,
@@ -703,8 +703,8 @@ sort_list(tArgList * arg_list)
          *  "-1" entry.
          */
         while (strcmp(old_v->pzName, new_v->pzName) > 0) {
-            arg_list->apzArgs[iy+1] = (void*)old_v;
-            old_v = (tOptionValue*)(void*)(intptr_t)(arg_list->apzArgs[--iy]);
+            arg_list->apzArgs[iy+1] = VOIDP(old_v);
+            old_v = (tOptionValue *)VOIDP(arg_list->apzArgs[--iy]);
             if (iy < 0)
                 break;
         }
@@ -713,7 +713,7 @@ sort_list(tArgList * arg_list)
          *  Always store the pointer.  Sometimes it is redundant,
          *  but the redundancy is cheaper than a test and branch sequence.
          */
-        arg_list->apzArgs[iy+1] = (void*)new_v;
+        arg_list->apzArgs[iy+1] = VOIDP(new_v);
     }
 }
 
@@ -725,7 +725,7 @@ sort_list(tArgList * arg_list)
  * arg:   + char const * + pzName + the name for the text +
  * arg:   + size_t       + nm_len + the length of "name"  +
  *
- * ret_type:  tOptionValue*
+ * ret_type:  tOptionValue *
  * ret_desc:  An allocated, compound value structure
  *
  * doc:
@@ -746,7 +746,7 @@ sort_list(tArgList * arg_list)
 LOCAL tOptionValue *
 optionLoadNested(char const * text, char const * name, size_t nm_len)
 {
-    tOptionValue* res_val;
+    tOptionValue * res_val;
 
     /*
      *  Make sure we have some data and we have space to put what we find.
@@ -762,7 +762,7 @@ optionLoadNested(char const * text, char const * name, size_t nm_len)
     }
     res_val = AGALOC(sizeof(*res_val) + nm_len + 1, "nest args");
     res_val->valType = OPARG_TYPE_HIERARCHY;
-    res_val->pzName  = (char*)(res_val + 1);
+    res_val->pzName  = (char *)(res_val + 1);
     memcpy(res_val->pzName, name, nm_len);
     res_val->pzName[nm_len] = NUL;
 
@@ -814,8 +814,8 @@ optionLoadNested(char const * text, char const * name, size_t nm_len)
  * private:
  *
  * what:  parse a hierarchical option argument
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Nested value was found on the command line
@@ -837,7 +837,7 @@ optionNestedVal(tOptions * opts, tOptDesc * od)
         av = arg_list->apzArgs;
 
         while (--ct >= 0) {
-            void * p = (void *)(intptr_t)*(av++);
+            void * p = VOIDP(*(av++));
             optionUnloadNested((tOptionValue const *)p);
         }
 
@@ -848,7 +848,7 @@ optionNestedVal(tOptions * opts, tOptDesc * od)
             od->optArg.argString, od->pz_Name, strlen(od->pz_Name));
 
         if (opt_val != NULL)
-            addArgListEntry(&(od->optCookie), (void*)opt_val);
+            addArgListEntry(&(od->optCookie), VOIDP(opt_val));
     }
 }
 
@@ -872,7 +872,7 @@ get_special_char(char const ** ppz, int * ct)
             base = 16;
             pz++;
         }
-        retch = (int)strtoul(pz, (char **)(intptr_t)&pz, base);
+        retch = (int)strtoul(pz, (char **)&pz, base);
         if (*pz != ';')
             return '&';
         base = (int)(++pz - *ppz);
index 471cb936e1a99e1e9fd991766ccecec3d842e730..ab8f3d1958be14c49ed7588929f4ebb466441346 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  * private:
  *
  * what:  Show info about range constraints
- * arg:   + tOptions* + pOpts     + program options descriptor  +
- * arg:   + tOptDesc* + pOptDesc  + the descriptor for this arg +
- * arg:   + void *    + rng_table + the value range tables      +
- * arg:   + int       + rng_count + the number of entries       +
+ * arg:   + tOptions * + pOpts     + program options descriptor  +
+ * arg:   + tOptDesc * + pOptDesc  + the descriptor for this arg +
+ * arg:   + void *     + rng_table + the value range tables      +
+ * arg:   + int        + rng_count + the number of entries       +
  *
  * doc:
  *   Show information about a numeric option with range constraints.
 =*/
 void
-optionShowRange(tOptions * pOpts, tOptDesc * pOD, const void * rng_table, int rng_ct)
+optionShowRange(tOptions * pOpts, tOptDesc * pOD, void * rng_table, int rng_ct)
 {
     const struct {long const rmin, rmax;} * rng = rng_table;
 
@@ -97,8 +97,8 @@ optionShowRange(tOptions * pOpts, tOptDesc * pOD, const void * rng_table, int rn
  * private:
  *
  * what:  process an option with a numeric value.
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Decipher a numeric value.
@@ -106,8 +106,8 @@ optionShowRange(tOptions * pOpts, tOptDesc * pOD, const void * rng_table, int rn
 void
 optionNumericVal(tOptions * opts, tOptDesc * od)
 {
-    char* pz;
-    long  val;
+    char * pz;
+    long   val;
 
     /*
      *  Guard against all the different ways this procedure might get invoked
index 08c003a8df5eee380a44984c343342e500847431..5f676408ae0094a18887716e01370cd96b50200e 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  DO NOT EDIT THIS FILE   (stdin.c)
  *
- *  It has been AutoGen-ed  August  8, 2014 at 04:09:05 PM by AutoGen 5.18.4pre11
+ *  It has been AutoGen-ed
  *  From the definitions    stdin
  *  and the template file   str2enum
  *
@@ -31,7 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "option-value-type.h"
-/* ANSI-C code produced by gperf version 3.0.3 */
+/* ANSI-C code produced by gperf version 3.0.4 */
 /* Command-line: gperf option-value-type.gp  */
 /* Computed positions: -k'1' */
 
index 23b2be9cb1d6012c3454074dd4c5a9f04dbb0026..cf6dcaadb8cf4a77ed625479a3c63379f00f4670 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  DO NOT EDIT THIS FILE   (stdin.h)
  *
- *  It has been AutoGen-ed  August  8, 2014 at 04:09:05 PM by AutoGen 5.18.4pre11
+ *  It has been AutoGen-ed
  *  From the definitions    stdin
  *  and the template file   str2enum
  *
index cc5f4f133c3d083fa73c90005fe40f9077167f4c..be86041fd8163a33dc4cdc685e56e38a882fa905 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  DO NOT EDIT THIS FILE   (stdin.c)
  *
- *  It has been AutoGen-ed  August  8, 2014 at 04:09:04 PM by AutoGen 5.18.4pre11
+ *  It has been AutoGen-ed
  *  From the definitions    stdin
  *  and the template file   str2enum
  *
@@ -31,7 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "option-xat-attribute.h"
-/* ANSI-C code produced by gperf version 3.0.3 */
+/* ANSI-C code produced by gperf version 3.0.4 */
 /* Command-line: gperf option-xat-attribute.gp  */
 /* Computed positions: -k'1' */
 
index d2c19c7923011d3507ad3c782e5ed3f0f96bfabd..dde1617a445dd66a0879ff8538b4c83489fa2094 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  DO NOT EDIT THIS FILE   (stdin.h)
  *
- *  It has been AutoGen-ed  August  8, 2014 at 04:09:04 PM by AutoGen 5.18.4pre11
+ *  It has been AutoGen-ed
  *  From the definitions    stdin
  *  and the template file   str2enum
  *
index 2536a06a00f7a6a9b912d612fabe72ae3f2cf68f..e072b7d567f54313272aa582040641ce7b426b91 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse a time duration and return a seconds count
-   Copyright (C) 2008-2014 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -60,14 +60,14 @@ typedef enum {
 static unsigned long
 str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
 {
-  return strtoul (str, (char **)(intptr_t)ppz, base);
+  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)
 {
-  return strtol (str, (char **)(intptr_t)ppz, base);
+  return strtol (str, (char **)ppz, base);
 }
 
 /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
index da7301e1cebe0de496de77e5fd9b649adcc3f35d..33ddc3366e9ffb975c85e128268ef8d53deffe90 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse a time duration and return a seconds count
-   Copyright (C) 2008-2014 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
    Written by Bruce Korb <bkorb@gnu.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index a385b4d999a8b9339ae49bf2e2e680cf6aa1da0b..3d229c18d0584112b462b4f20502c1b1cd2c3c4b 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -33,7 +33,7 @@
  */
 
 #if defined(HAVE_WORKING_FORK)
-static FILE *
+static inline FILE *
 open_tmp_usage(char ** buf)
 {
     char * bf;
@@ -64,7 +64,7 @@ open_tmp_usage(char ** buf)
     }
 }
 
-static char *
+static inline char *
 mk_pager_cmd(char const * fname)
 {
     /*
@@ -85,10 +85,10 @@ mk_pager_cmd(char const * fname)
         if (pager == NULL)
             pager = MORE_STR;
 
-        bfsz = strlen(fname) + strlen(pager) + PAGE_USAGE_FMT_LEN;
+        bfsz = 2 * strlen(fname) + strlen(pager) + PAGE_USAGE_FMT_LEN;
         res  = AGALOC(bfsz, "more cmd");
         snprintf(res, bfsz, PAGE_USAGE_FMT, pager, fname);
-        AGFREE((void*)(intptr_t)fname);
+        AGFREE(fname);
         return res;
     }
 }
index 3275ea1d0f6fa2c71dca6f9b04bc20be7cfec524..a78b794fc6a5389fa1091382eda84540add754b1 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- buffer-read-only: t -*- vi: set ro:
  *
  * Prototypes for autoopts
- * Generated Fri Aug  8 16:09:18 PDT 2014
+ * Generated Sat Apr 25 09:53:18 PDT 2015
  */
 #ifndef AUTOOPTS_PROTO_H_GUARD
 #define AUTOOPTS_PROTO_H_GUARD 1
@@ -65,7 +65,7 @@ static tSuccess
 opt_find_long(tOptions * opts, char const * opt_name, tOptState * state);
 
 static tSuccess
-opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState);
+opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState);
 
 static tSuccess
 get_opt_arg(tOptions * opts, tOptState * o_st);
index 4b0fa10a13fbebd9eb92a1e009f2e1f78a69bd7f..9bfa984da67dd020e2b54b1803077d14b44297fd 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -296,7 +296,7 @@ print_membership(tOptions * pOpts, tOptDesc * pOD)
     uintptr_t val = 1;
     printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
            (int)(uintptr_t)(pOD->optCookie));
-    pOD->optCookie = (void*)(uintptr_t)~0UL;
+    pOD->optCookie = VOIDP(~0UL);
     (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD);
 
     pz = pOD->optArg.argString;
@@ -323,7 +323,7 @@ print_membership(tOptions * pOpts, tOptDesc * pOD)
 static void
 print_stacked_arg(tOptions * pOpts, tOptDesc * pOD)
 {
-    tArgList*       pAL = (tArgList*)pOD->optCookie;
+    tArgList *      pAL = (tArgList *)pOD->optCookie;
     char const **   ppz = pAL->apzArgs;
     int             ct  = pAL->useCt;
 
@@ -363,19 +363,19 @@ print_reordering(tOptions * opts)
 /*=export_func  optionPutShell
  * what:  write a portable shell script to parse options
  * private:
- * arg:   tOptions*, pOpts, the program options descriptor
+ * arg:   tOptions *, pOpts, the program options descriptor
  * doc:   This routine will emit portable shell script text for parsing
  *        the options described in the option definitions.
 =*/
 void
-optionPutShell(tOptions* pOpts)
+optionPutShell(tOptions * pOpts)
 {
     int  optIx = 0;
 
     printf(zOptCtFmt, pOpts->curOptIdx-1);
 
     do  {
-        tOptDesc* pOD = pOpts->pOptDesc + optIx;
+        tOptDesc * pOD = pOpts->pOptDesc + optIx;
 
         if ((pOD->fOptState & OPTST_NO_OUTPUT_MASK) != 0)
             continue;
@@ -396,7 +396,7 @@ optionPutShell(tOptions* pOpts)
          *  but copy over the set-state bits.
          */
         if (pOD->optActualIndex != optIx) {
-            tOptDesc* p   = pOpts->pOptDesc + pOD->optActualIndex;
+            tOptDesc * p  = pOpts->pOptDesc + pOD->optActualIndex;
             p->optArg     = pOD->optArg;
             p->fOptState &= OPTST_PERSISTENT_MASK;
             p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT_MASK;
index 1e959a1e4ce7efdd72370d4179ea51a40929da4f..6ca2c05229db400569515f405f846f78f2fd50a2 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -30,7 +30,7 @@
  */
 
 static void
-optionReset( tOptions* pOpts, tOptDesc* pOD )
+optionReset(tOptions * pOpts, tOptDesc * pOD)
 {
     pOD->fOptState &= OPTST_PERSISTENT_MASK;
     pOD->fOptState |= OPTST_RESET;
@@ -63,8 +63,8 @@ optionResetEverything(tOptions * pOpts)
  * private:
  *
  * what:  Reset the value of an option
- * arg:   + tOptions* + pOpts    + program options descriptor  +
- * arg:   + tOptDesc* + pOptDesc + the descriptor for this arg +
+ * arg:   + tOptions * + pOpts    + program options descriptor  +
+ * arg:   + tOptDesc * + pOptDesc + the descriptor for this arg +
  *
  * doc:
  *  This code will cause another option to be reset to its initial state.
@@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD)
             assert(0 == 1);
         }
     } else {
-        succ = opt_find_long(pOpts, (char *)(intptr_t)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 f711cb3adfc1220069b9d5ab87f5db345bc749ba..02ef14aeba3829c4b032ebcc3040d7e7518a2294 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
  *  have been marked as allocated though.
  */
 static void
-fixupSavedOptionArgs(tOptions* pOpts)
+fixupSavedOptionArgs(tOptions * pOpts)
 {
-    tOptions* p   = pOpts->pSavedState;
-    tOptDesc* pOD = pOpts->pOptDesc;
-    int       ct  = pOpts->optCt;
+    tOptions * p   = pOpts->pSavedState;
+    tOptDesc * pOD = pOpts->pOptDesc;
+    int        ct  = pOpts->optCt;
 
     /*
      *  Make sure that allocated stuff is only referenced in the
@@ -52,18 +52,18 @@ fixupSavedOptionArgs(tOptions* pOpts)
         switch (OPTST_GET_ARGTYPE(pOD->fOptState)) {
         case OPARG_TYPE_STRING:
             if (pOD->fOptState & OPTST_STACKED) {
-                tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+                tOptDesc * q = p->pOptDesc + (pOD - pOpts->pOptDesc);
                 q->optCookie = NULL;
             }
             if (pOD->fOptState & OPTST_ALLOC_ARG) {
-                tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+                tOptDesc * q = p->pOptDesc + (pOD - pOpts->pOptDesc);
                 AGDUPSTR(q->optArg.argString, pOD->optArg.argString, "arg");
             }
             break;
 
         case OPARG_TYPE_HIERARCHY:
         {
-            tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+            tOptDesc * q = p->pOptDesc + (pOD - pOpts->pOptDesc);
             q->optCookie = NULL;
         }
         }
@@ -73,7 +73,7 @@ fixupSavedOptionArgs(tOptions* pOpts)
 /*=export_func optionSaveState
  *
  * what:  saves the option state to memory
- * arg:   tOptions*, pOpts, program options descriptor
+ * arg:   tOptions *, pOpts, program options descriptor
  *
  * doc:
  *
@@ -96,7 +96,7 @@ fixupSavedOptionArgs(tOptions* pOpts)
 void
 optionSaveState(tOptions * pOpts)
 {
-    tOptions * p = (tOptions*)pOpts->pSavedState;
+    tOptions * p = (tOptions *)pOpts->pSavedState;
 
     if (p == NULL) {
         size_t sz = sizeof(*pOpts)
@@ -116,7 +116,7 @@ optionSaveState(tOptions * pOpts)
 /*=export_func optionRestore
  *
  * what:  restore option state from memory copy
- * arg:   tOptions*, pOpts, program options descriptor
+ * arg:   tOptions *, pOpts, program options descriptor
  *
  * doc:  Copy back the option state from saved memory.
  *       The allocated memory is left intact, so this routine can be
@@ -129,9 +129,9 @@ optionSaveState(tOptions * pOpts)
  *       printed to @code{stderr} and exit is called.
 =*/
 void
-optionRestore(tOptions* pOpts)
+optionRestore(tOptions * pOpts)
 {
-    tOptions* p = (tOptions*)pOpts->pSavedState;
+    tOptions * p = (tOptions *)pOpts->pSavedState;
 
     if (p == NULL) {
         char const * pzName = pOpts->pzProgName;
@@ -159,7 +159,7 @@ optionRestore(tOptions* pOpts)
 /*=export_func optionFree
  *
  * what:  free allocated option processing memory
- * arg:   tOptions*, pOpts, program options descriptor
+ * arg:   tOptions *, pOpts, program options descriptor
  *
  * doc:   AutoOpts sometimes allocates memory and puts pointers to it in the
  *        option state structures.  This routine deallocates all such memory.
@@ -168,11 +168,11 @@ optionRestore(tOptions* pOpts)
  *        this routine is always successful.
 =*/
 void
-optionFree(tOptions* pOpts)
+optionFree(tOptions * pOpts)
 {
  free_saved_state:
     {
-        tOptDesc* p = pOpts->pOptDesc;
+        tOptDesc * p = pOpts->pOptDesc;
         int ct = pOpts->optCt;
         do  {
             if (p->fOptState & OPTST_ALLOC_ARG) {
@@ -204,7 +204,7 @@ optionFree(tOptions* pOpts)
         } while (p++, --ct > 0);
     }
     if (pOpts->pSavedState != NULL) {
-        tOptions * p = (tOptions*)pOpts->pSavedState;
+        tOptions * p = (tOptions *)pOpts->pSavedState;
         memcpy(pOpts, p, sizeof(*p));
         memcpy(pOpts->pOptDesc, p+1, (size_t)p->optCt * sizeof(tOptDesc));
         AGFREE(pOpts->pSavedState);
index dd51d6055f76f1a924b3c6319c34e2f0c757225d..f462ced8c65df0d6754421ef8e88cc596150d3be 100644 (file)
@@ -12,7 +12,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -92,7 +92,7 @@ find_dir_name(tOptions * opts, int * p_free)
      *  we can stash the RC (INI) file.
      */
     {
-        char const * const* papz = opts->papzHomeList;
+        char const * const * papz = opts->papzHomeList;
         if (papz == NULL)
             return NULL;
 
@@ -216,7 +216,7 @@ find_file_name(tOptions * opts, int * p_free_name)
         size_t sz = strlen(pzDir) + strlen(opts->pzRcName) + 2;
 
         {
-            char * pzPath = (char*)AGALOC(sz, "file name");
+            char * pzPath = (char *)AGALOC(sz, "file name");
 #ifdef HAVE_SNPRINTF
             snprintf(pzPath, sz, "%s/%s", pzDir, opts->pzRcName);
 #else
@@ -306,7 +306,7 @@ prt_entry(FILE * fp, tOptDesc * od, char const * l_arg)
      *  THEN the char pointer is really the number
      */
     if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_NUMERIC)
-        fprintf(fp, "%d", (int)(t_word)l_arg);
+        fprintf(fp, "%d", (int)(intptr_t)l_arg);
 
     else {
         for (;;) {
@@ -453,7 +453,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al)
     if (al == NULL)
         return;
     opt_ct   = al->useCt;
-    opt_list = (void **)(intptr_t)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 = (void **)(intptr_t)al->apzArgs;
+    opt_list = (void **)al->apzArgs;
 
     if (opt_ct <= 0)
         return;
@@ -560,7 +560,7 @@ open_sv_file(tOptions * opts)
          *  normally point to static data that is overwritten by each call.
          *  The test to detect allocated ctime, so we leak the memory.
          */
-        AGFREE((void*)time_str);
+        AGFREE(time_str);
 #endif
     }
 
@@ -596,7 +596,7 @@ static void
 prt_str_arg(FILE * fp, tOptDesc * pOD)
 {
     if (pOD->fOptState & OPTST_STACKED) {
-        tArgList * pAL = (tArgList*)pOD->optCookie;
+        tArgList * pAL = (tArgList *)pOD->optCookie;
         int        uct = pAL->useCt;
         char const ** ppz = pAL->apzArgs;
 
@@ -629,7 +629,7 @@ prt_enum_arg(FILE * fp, tOptDesc * od)
      *  bit flag values back into a string suitable for printing.
      */
     (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
-    prt_entry(fp, od, (void*)(intptr_t)(od->optArg.argString));
+    prt_entry(fp, od, VOIDP(od->optArg.argString));
 
     od->optArg.argEnum = val;
 }
@@ -689,7 +689,7 @@ prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts)
  *
  * what:  saves the option state to a file
  *
- * arg:   tOptions*,   opts,  program options descriptor
+ * arg:   tOptions *,   opts,  program options descriptor
  *
  * doc:
  *
@@ -765,7 +765,7 @@ optionSaveFile(tOptions * opts)
             break;
 
         case OPARG_TYPE_NUMERIC:
-            prt_entry(fp, p, (void*)(p->optArg.argInt));
+            prt_entry(fp, p, VOIDP(p->optArg.argInt));
             break;
 
         case OPARG_TYPE_STRING:
index 894d0ecf58ebb878409dea5f37957872b3c6882e..da0033431affb004e7e07526a51ed4bdaf9996fe 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -198,11 +198,11 @@ optionSort(tOptions * opts)
     /*
      *  Make sure we can allocate two full-sized arg vectors.
      */
-    opt_txt = malloc(opts->origArgCt * sizeof(char*));
+    opt_txt = malloc(opts->origArgCt * sizeof(char *));
     if (opt_txt == NULL)
         goto exit_no_mem;
 
-    ppzOpds = malloc(opts->origArgCt * sizeof(char*));
+    ppzOpds = malloc(opts->origArgCt * sizeof(char *));
     if (ppzOpds == NULL) {
         free(opt_txt);
         goto exit_no_mem;
@@ -315,10 +315,10 @@ optionSort(tOptions * opts)
  joinLists:
     if (optsIdx > 0)
         memcpy(opts->origArgVect + 1, opt_txt,
-               (size_t)optsIdx * sizeof(char*));
+               (size_t)optsIdx * sizeof(char *));
     if (opdsIdx > 0)
         memcpy(opts->origArgVect + 1 + optsIdx, ppzOpds,
-               (size_t)opdsIdx * sizeof(char*));
+               (size_t)opdsIdx * sizeof(char *));
 
  freeTemps:
     free(opt_txt);
index d2ce165adb883a745983fd6d468ad3479a5c0c03..affe6b661fd514a8df7b4fa8885fcca8bf98ed25 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -38,8 +38,8 @@
  * private:
  *
  * what:  Remove option args from a stack
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Invoked for options that are equivalenced to stacked options.
@@ -52,7 +52,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od)
     if (INQUERY_CALL(opts, od))
         return;
 
-    arg_list = (tArgList*)od->optCookie;
+    arg_list = (tArgList *)od->optCookie;
 
     /*
      *  IF we don't have any stacked options,
@@ -165,7 +165,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od)
         od->fOptState &= OPTST_PERSISTENT_MASK;
         if ((od->fOptState & OPTST_INITENABLED) == 0)
             od->fOptState |= OPTST_DISABLED;
-        AGFREE((void *)arg_list);
+        AGFREE(arg_list);
         od->optCookie = NULL;
     }
 }
@@ -179,19 +179,19 @@ optionUnstackArg(tOptions * opts, tOptDesc * od)
 LOCAL void
 addArgListEntry(void ** ppAL, void * entry)
 {
-    tArgList* pAL = *(void**)ppAL;
+    tArgList * pAL = *(void **)ppAL;
 
     /*
      *  IF we have never allocated one of these,
      *  THEN allocate one now
      */
     if (pAL == NULL) {
-        pAL = (tArgList*)AGALOC(sizeof(*pAL), "new option arg stack");
+        pAL = (tArgList *)AGALOC(sizeof(*pAL), "new option arg stack");
         if (pAL == NULL)
             return;
         pAL->useCt   = 0;
         pAL->allocCt = MIN_ARG_ALLOC_CT;
-        *ppAL = (void*)pAL;
+        *ppAL = VOIDP(pAL);
     }
 
     /*
@@ -206,11 +206,11 @@ addArgListEntry(void ** ppAL, void * entry)
          *  The base structure contains space for MIN_ARG_ALLOC_CT
          *  pointers.  We subtract it off to find our augment size.
          */
-        sz += sizeof(char*) * ((size_t)pAL->allocCt - MIN_ARG_ALLOC_CT);
-        pAL = (tArgList*)AGREALOC((void*)pAL, sz, "expanded opt arg stack");
+        sz += sizeof(char *) * ((size_t)pAL->allocCt - MIN_ARG_ALLOC_CT);
+        pAL = (tArgList *)AGREALOC(VOIDP(pAL), sz, "expanded opt arg stack");
         if (pAL == NULL)
             return;
-        *ppAL = (void*)pAL;
+        *ppAL = VOIDP(pAL);
     }
 
     /*
@@ -224,8 +224,8 @@ addArgListEntry(void ** ppAL, void * entry)
  * private:
  *
  * what:  put option args on a stack
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Keep an entry-ordered list of option arguments.
@@ -239,7 +239,7 @@ optionStackArg(tOptions * opts, tOptDesc * od)
         return;
 
     if ((od->fOptState & OPTST_RESET) != 0) {
-        tArgList * arg_list = (void*)od->optCookie;
+        tArgList * arg_list = od->optCookie;
         int ix;
         if (arg_list == NULL)
             return;
@@ -254,7 +254,7 @@ optionStackArg(tOptions * opts, tOptDesc * od)
             return;
 
         AGDUPSTR(pz, od->optArg.argString, "stack arg");
-        addArgListEntry(&(od->optCookie), (void*)pz);
+        addArgListEntry(&(od->optCookie), VOIDP(pz));
     }
 }
 /** @}
index d4ae183ce6c08f5007408d9b87487507c4320575..5b4d11bb3b0ac87b2204eeed29dc3352447c17ee 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdnoreturn.h>.
 
-   Copyright 2012-2014 Free Software Foundation, Inc.
+   Copyright 2012-2015 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 371d7f4f0cfd87cbc405fbb177940d82e57a8efa..e87a232d199dbe13af5134dc32bfb95c5f635789 100644 (file)
@@ -15,7 +15,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -81,9 +81,9 @@ static unsigned char charmap[] = {
  *
  * what: compare two strings with an equivalence mapping
  *
- * arg:  + char const* + str1 + first string +
- * arg:  + char const* + str2 + second string +
- * arg:  + int         + ct   + compare length +
+ * arg:  + char const * + str1 + first string +
+ * arg:  + char const * + str2 + second string +
+ * arg:  + int          + ct   + compare length +
  *
  * ret_type:  int
  * ret_desc:  the difference between two differing characters
@@ -129,8 +129,8 @@ strneqvcmp(char const * s1, char const * s2, int ct)
  *
  * what: compare two strings with an equivalence mapping
  *
- * arg:  + char const* + str1 + first string +
- * arg:  + char const* + str2 + second string +
+ * arg:  + char const * + str1 + first string +
+ * arg:  + char const * + str2 + second string +
  *
  * ret_type:  int
  * ret_desc:  the difference between two differing characters
@@ -226,7 +226,7 @@ streqvmap(char from, char to, int ct)
  *
  * what: map a list of characters to the same value
  *
- * arg:  + char const* + ch_list + characters to equivalence +
+ * arg:  + char const * + ch_list + characters to equivalence +
  *
  * doc:
  *
@@ -238,7 +238,7 @@ streqvmap(char from, char to, int ct)
  * err:  none.
 =*/
 void
-strequate(char const* s)
+strequate(char const * s)
 {
     if ((s != NULL) && (*s != NUL)) {
         unsigned char equiv = (unsigned char)*s;
@@ -252,8 +252,8 @@ strequate(char const* s)
  *
  * what: convert a string into its mapped-to value
  *
- * arg:  + char*       + dest + output string +
- * arg:  + char const* + src  + input string +
+ * arg:  + char *       + dest + output string +
+ * arg:  + char const * + src  + input string +
  *
  * doc:
  *
@@ -267,7 +267,7 @@ strequate(char const* s)
  * err:  none.
 =*/
 void
-strtransform(char* d, char const* s)
+strtransform(char * d, char const * s)
 {
     do  {
         *(d++) = (char)charmap[(unsigned char)*s];
index f30e71c6c9c300326cab35632deb1b3441e7d042..07c0bf10ebc3e22c682a4be8a3aa80e158de53e9 100644 (file)
@@ -9,7 +9,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -61,7 +61,7 @@
 #define FILE_WRITABLE(_prt,_flg) \
         (   (_prt & PROT_WRITE) \
          && ((_flg & (MAP_SHARED|MAP_PRIVATE)) == MAP_SHARED))
-#define MAP_FAILED_PTR ((void*)MAP_FAILED)
+#define MAP_FAILED_PTR (VOIDP(MAP_FAILED))
 
 /**
  * Load the contents of a text file.  There are two separate implementations,
@@ -93,7 +93,7 @@ load_text_file(tmap_info_t * mapinfo, char const * pzFile)
 
     {
         size_t sz = mapinfo->txt_size;
-        char pz = mapinfo->txt_data;
+        char * pz = mapinfo->txt_data;
 
         while (sz > 0) {
             ssize_t rdct = read(mapinfo->txt_fd, pz, sz);
@@ -254,12 +254,12 @@ close_mmap_files(tmap_info_t * mi)
  *
  * what:  map a text file with terminating NUL
  *
- * arg:   char const*,  pzFile,  name of the file to map
- * arg:   int,          prot,    mmap protections (see mmap(2))
- * arg:   int,          flags,   mmap flags (see mmap(2))
- * arg:   tmap_info_t*, mapinfo, returned info about the mapping
+ * arg:   char const *,  pzFile,  name of the file to map
+ * arg:   int,           prot,    mmap protections (see mmap(2))
+ * arg:   int,           flags,   mmap flags (see mmap(2))
+ * arg:   tmap_info_t *, mapinfo, returned info about the mapping
  *
- * ret-type:   void*
+ * ret-type:   void *
  * ret-desc:   The mmaped data address
  *
  * doc:
@@ -296,7 +296,7 @@ close_mmap_files(tmap_info_t * mi)
  * #include <mylib.h>
  * tmap_info_t mi;
  * int no_nul;
- * void* data = text_mmap("file", PROT_WRITE, MAP_PRIVATE, &mi);
+ * void * data = text_mmap("file", PROT_WRITE, MAP_PRIVATE, &mi);
  * if (data == MAP_FAILED) return;
  * no_nul = (mi.txt_size == mi.txt_full_size);
  * << use the data >>
@@ -327,7 +327,7 @@ text_mmap(char const * pzFile, int prot, int flags, tmap_info_t * mi)
  *
  * what:  unmap the data mapped in by text_mmap
  *
- * arg:   tmap_info_t*, mapinfo, info about the mapping
+ * arg:   tmap_info_t *, mapinfo, info about the mapping
  *
  * ret-type:   int
  * ret-desc:   -1 or 0.  @code{errno} will have the error code.
index 517d5b199a4fc3b19029538e1babbb9283a3fb8c..62e07541e54a5bf151c102eb7c693d370ef43548 100644 (file)
@@ -8,7 +8,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -31,8 +31,8 @@
  * private:
  *
  * what:  process an option with a time duration.
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Decipher a time duration value.
@@ -64,8 +64,8 @@ optionTimeVal(tOptions * opts, tOptDesc * od)
  * private:
  *
  * what:  process an option with a time and date.
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  Decipher a time and date value.
index a0db4cb8072a9bf86376f1b2363ee30a43abc8be..cbff7fba47df59eddc41fccbd896bce4ab58a3c3 100644 (file)
@@ -9,7 +9,7 @@
  *  This file defines the string_tokenize interface
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
 
 /* = = = START-STATIC-FORWARD = = = */
 static void
-copy_cooked(ch_t** ppDest, char const ** ppSrc);
+copy_cooked(ch_t ** ppDest, char const ** ppSrc);
 
 static void
-copy_raw(ch_t** ppDest, char const ** ppSrc);
+copy_raw(ch_t ** ppDest, char const ** ppSrc);
 
 static token_list_t *
 alloc_token_list(char const * str);
 /* = = = END-STATIC-FORWARD = = = */
 
 static void
-copy_cooked(ch_t** ppDest, char const ** ppSrc)
+copy_cooked(ch_t ** ppDest, char const ** ppSrc)
 {
-    ch_t* pDest = (ch_t*)*ppDest;
-    const ch_t* pSrc  = (const ch_t*)(*ppSrc + 1);
+    ch_t * pDest = (ch_t *)*ppDest;
+    const ch_t * pSrc  = (const ch_t *)(*ppSrc + 1);
 
     for (;;) {
         ch_t ch = *(pSrc++);
@@ -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((char*)(intptr_t)pSrc, (char*)(intptr_t)&ch, 0x7F);
+            pSrc += ao_string_cook_escape_char((char *)pSrc, (char *)&ch, 0x7F);
             if (ch == 0x7F)
                 break;
             /* FALLTHROUGH */
@@ -68,16 +68,16 @@ copy_cooked(ch_t** ppDest, char const ** ppSrc)
     }
 
  done:
-    *ppDest = (ch_t*)pDest; /* next spot for storing character */
+    *ppDest = (ch_t *)pDest; /* next spot for storing character */
     *ppSrc  = (char const *)pSrc;  /* char following closing quote    */
 }
 
 
 static void
-copy_raw(ch_t** ppDest, char const ** ppSrc)
+copy_raw(ch_t ** ppDest, char const ** ppSrc)
 {
-    ch_t* pDest = *ppDest;
-    cc_t* pSrc  = (cc_t*) (*ppSrc + 1);
+    ch_t * pDest = *ppDest;
+    cc_t * pSrc  = (cc_t *) (*ppSrc + 1);
 
     for (;;) {
         ch_t ch = *(pSrc++);
@@ -151,12 +151,12 @@ alloc_token_list(char const * str)
         } while (*pz != NUL);
 
         res = malloc(sizeof(*res) + (size_t)(pz - str)
-                     + ((size_t)max_token_ct * sizeof(ch_t*)));
+                     + ((size_t)max_token_ct * sizeof(ch_t *)));
     }
 
     if (res == NULL)
         errno = ENOMEM;
-    else res->tkn_list[0] = (ch_t*)(res->tkn_list + (max_token_ct - 1));
+    else res->tkn_list[0] = (ch_t *)(res->tkn_list + (max_token_ct - 1));
 
     return res;
 
@@ -170,9 +170,9 @@ alloc_token_list(char const * str)
  *
  * what: tokenize an input string
  *
- * arg:  + char const* + string + string to be tokenized +
+ * arg:  + char const * + string + string to be tokenized +
  *
- * ret_type:  token_list_t*
+ * ret_type:  token_list_t *
  * ret_desc:  pointer to a structure that lists each token
  *
  * doc:
@@ -213,7 +213,7 @@ alloc_token_list(char const * str)
  * @example
  *    #include <stdlib.h>
  *    int ix;
- *    token_list_t* ptl = ao_string_tokenize(some_string)
+ *    token_list_t * ptl = ao_string_tokenize(some_string)
  *    for (ix = 0; ix < ptl->tkn_ct; ix++)
  *       do_something_with_tkn(ptl->tkn_list[ix]);
  *    free(ptl);
@@ -231,11 +231,11 @@ alloc_token_list(char const * str)
  *  @code{ENOMEM} - There is not enough memory.
  *  @end itemize
 =*/
-token_list_t*
-ao_string_tokenize(char const* str)
+token_list_t *
+ao_string_tokenize(char const * str)
 {
-    token_list_t* res = alloc_token_list(str);
-    ch_t* pzDest;
+    token_list_t * res = alloc_token_list(str);
+    ch_t * pzDest;
 
     /*
      *  Now copy each token into the output buffer.
@@ -243,7 +243,7 @@ ao_string_tokenize(char const* str)
     if (res == NULL)
         return res;
 
-    pzDest = (ch_t*)(res->tkn_list[0]);
+    pzDest = (ch_t *)(res->tkn_list[0]);
     res->tkn_ct  = 0;
 
     do  {
@@ -304,15 +304,15 @@ ao_string_tokenize(char const* str)
 #include <string.h>
 
 int
-main(int argc, char** argv)
+main(int argc, char ** argv)
 {
     if (argc == 1) {
         printf("USAGE:  %s arg [ ... ]\n", *argv);
         return 1;
     }
     while (--argc > 0) {
-        char* arg = *(++argv);
-        token_list_t* p = ao_string_tokenize(arg);
+        char * arg = *(++argv);
+        token_list_t * p = ao_string_tokenize(arg);
         if (p == NULL) {
             printf("Parsing string ``%s'' failed:\n\terrno %d (%s)\n",
                    arg, errno, strerror(errno));
index bb33b35ac4608cdea3e518e0bf75b1627ffd8caa..c652da7f0bceac1c846cedace5f8c10147aa2169 100644 (file)
@@ -18,7 +18,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
@@ -240,7 +240,7 @@ skip_misuse_usage(tOptions * pOpts)
 /*=export_func  optionOnlyUsage
  *
  * what:  Print usage text for just the options
- * arg:   + tOptions  + pOpts    + program options descriptor +
+ * arg:   + tOptions *  + pOpts    + program options descriptor +
  * arg:   + int         + ex_code  + exit code for calling exit(3) +
  *
  * doc:
@@ -553,8 +553,8 @@ optionPrintParagraphs(char const * text, bool plain, FILE * fp)
  * private:
  *
  * what:  Print usage text
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + int       + exitCode + exit code for calling exit(3) +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + int        + exitCode + exit code for calling exit(3) +
  *
  * doc:
  *  This routine will print usage in both GNU-standard and AutoOpts-expanded
index 1516c147f889c62c035d92707dcfcb3a5c874f5a..8a8de75dbe312682b1626cecc80a206c26b8e406 100644 (file)
@@ -10,7 +10,7 @@
 /*
  *  This file is part of AutoOpts, a companion to AutoGen.
  *  AutoOpts is free software.
- *  AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *  AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
  *
  *  AutoOpts is available under any one of two licenses.  The license
  *  in use must be one of these two and the choice is under the control
 /*=export_func  optionVersion
  *
  * what:     return the compiled AutoOpts version number
- * ret_type: char const*
+ * ret_type: char const *
  * ret_desc: the version string in constant memory
  * doc:
  *  Returns the full version string compiled into the library.
  *  The returned string cannot be modified.
 =*/
-char const*
+char const *
 optionVersion(void)
 {
     static char const ver[] = OPTIONS_DOTTED_VERSION;
@@ -181,8 +181,8 @@ print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit)
 /*=export_func  optionPrintVersion
  *
  * what:  Print the program version
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  This routine will print the version to stdout.
@@ -196,8 +196,8 @@ optionPrintVersion(tOptions * opts, tOptDesc * od)
 /*=export_func  optionPrintVersionAndReturn
  *
  * what:  Print the program version
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  This routine will print the version to stdout and return
@@ -215,8 +215,8 @@ optionPrintVersionAndReturn(tOptions * opts, tOptDesc * od)
  * private:
  *
  * what:  Print the program version to stderr
- * arg:   + tOptions* + opts + program options descriptor +
- * arg:   + tOptDesc* + od   + the descriptor for this arg +
+ * arg:   + tOptions * + opts + program options descriptor +
+ * arg:   + tOptDesc * + od   + the descriptor for this arg +
  *
  * doc:
  *  This routine will print the version to stderr.