Module Name:    src
Committed By:   joerg
Date:           Sun Nov 23 01:47:59 UTC 2014

Modified Files:
        src/external/bsd/ntp/dist/sntp/libopts: init.c
        src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h

Log Message:
Replace very question pointer games to override const, mark the member
writeable when inside the guts of the library.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/libopts/init.c
cvs rdiff -u -r1.6 -r1.7 \
    src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libopts/init.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/init.c:1.2 src/external/bsd/ntp/dist/sntp/libopts/init.c:1.3
--- src/external/bsd/ntp/dist/sntp/libopts/init.c:1.2	Sat Dec 28 03:20:15 2013
+++ src/external/bsd/ntp/dist/sntp/libopts/init.c	Sun Nov 23 01:47:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.2 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.3 2014/11/23 01:47:59 joerg Exp $	*/
 
 /**
  * \file initialize.c
@@ -103,20 +103,17 @@ validate_struct(tOptions * opts, char co
      */
     if (opts->pzProgName == NULL) {
         char const *  pz = strrchr(pname, DIRCH);
-        char const ** pp =
-            (char const **)(void **)(intptr_t)&(opts->pzProgName);
 
         if (pz != NULL)
-            *pp = pz+1;
+            opts->pzProgName = pz+1;
         else
-            *pp = pname;
+            opts->pzProgName = pname;
 
         pz = pathfind(getenv("PATH"), (char *)(intptr_t)pname, "rx");
         if (pz != NULL)
             pname = (void *)(intptr_t)pz;
 
-        pp  = (char const **)(void **)(intptr_t)&(opts->pzProgPath);
-        *pp = pname;
+        opts->pzProgPath = pname;
 
         /*
          *  when comparing long names, these are equivalent

Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.6 src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.7
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.6	Sat Dec 28 03:20:15 2013
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h	Sun Nov 23 01:47:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.h,v 1.6 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: options.h,v 1.7 2014/11/23 01:47:59 joerg Exp $	*/
 
 /*   -*- buffer-read-only: t -*- vi: set ro:
  *
@@ -602,9 +602,17 @@ struct options {
     char *                      pzCurOpt;      ///< current option text
 
     /// Public, the full path of the program
+#if AUTOOPTS_INTERNAL
+    char const *                pzProgPath;
+#else
     char const * const          pzProgPath;
+#endif
     /// Public, the name of the executable, without any path
+#if AUTOOPTS_INTERNAL
+    char const *                pzProgName;
+#else
     char const * const          pzProgName;
+#endif
     /// Public, the upper-cased, shell variable syntax-ed program name
     char const * const          pzPROGNAME;
     /// the name of the "rc file" (configuration file)

Reply via email to