httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject [PATCH] APR getopt stuff with gcc and no warnings
Date Wed, 09 Aug 2000 21:04:24 GMT
I backed out the const-ness stuff to avoid the current warnings in
http_main.c and ab.c.  If somebody can be more const with no warnings
and no users of APR doing weird casts, more power to them :)  Speak up
if you don't want this committed.

Index: include/httpd.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/include/httpd.h,v
retrieving revision 1.70
diff -u -r1.70 httpd.h
--- httpd.h	2000/08/05 12:28:42	1.70
+++ httpd.h	2000/08/09 21:08:11
@@ -568,7 +568,7 @@
     apr_pool_t *pool;  /* Global pool. Please try to cleared on _all_ exits */
     apr_pool_t *pconf; /* aka configuration pool, cleared on restarts */
     int argc;
-    char *const *argv;
+    char **argv;
     const char *short_name;
 };
 
Index: lib/apr/include/apr_getopt.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr_getopt.h,v
retrieving revision 1.17
diff -u -r1.17 apr_getopt.h
--- apr_getopt.h	2000/08/09 18:00:15	1.17
+++ apr_getopt.h	2000/08/09 21:08:11
@@ -62,8 +62,8 @@
     int opt;                 /* character checked for validity */
     int reset;               /* reset getopt */
     int argc;                /* count of arguments */
-    char const* const* argv; /* array of pointers to arguments */
-    char const* place;       /* argument associated with option */
+    char **argv;             /* array of pointers to arguments */
+    char *place;             /* argument associated with option */
 } apr_getopt_t;
 
 /**
@@ -73,10 +73,10 @@
  * @param argc The number of arguments to parse
  * @param argv The array of arguments to parse
  * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv)
- * @deffunc apr_status_t apr_initopt( apr_getopt_t **os, apr_pool_t *cont,int argc, char
const* const* argv)
+ * @deffunc apr_status_t apr_initopt( apr_getopt_t **os, apr_pool_t *cont,int argc, char
** argv)
  */
 APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont,
-                                     int argc, char const* const* argv);
+                                     int argc, char **argv);
 
 /**
  * Parse the options initialized by apr_initopt().
@@ -93,10 +93,10 @@
  *             APR_BADARG   --  No argument followed @parameter:
  *             APR_SUCCESS  --  The next option was found.
  * </PRE>
- * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char
const** optarg)
+ * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char
** optarg)
  */
 APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, 
-                                    char *optch, char const** optarg);
+                                    char *optch, char **optarg);
 
 #endif  /* ! APR_GETOPT_H */
 
Index: lib/apr/misc/unix/getopt.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/misc/unix/getopt.c,v
retrieving revision 1.19
diff -u -r1.19 getopt.c
--- getopt.c	2000/08/09 14:54:03	1.19
+++ getopt.c	2000/08/09 21:08:12
@@ -36,7 +36,7 @@
 #define EMSG    ""
 
 APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont,
-                                     int argc, char const* const* argv)
+                                     int argc, char **argv)
 {
     *os = apr_palloc(cont, sizeof(apr_getopt_t));
     (*os)->err = 1;
@@ -48,7 +48,7 @@
 }
 
 APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, 
-                                    char *optch, char const** optarg)
+                                    char *optch, char **optarg)
 {
     const char *p;
     const char *oli;  /* option letter list index */
Index: main/http_main.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/main/http_main.c,v
retrieving revision 1.64
diff -u -r1.64 http_main.c
--- http_main.c	2000/08/09 14:56:55	1.64
+++ http_main.c	2000/08/09 21:08:15
@@ -196,7 +196,7 @@
     exit(process_exit_value);
 }
 
-static process_rec *create_process(int argc, char *const *argv)
+static process_rec *create_process(int argc, char **argv)
 {
     process_rec *process;
     
@@ -290,10 +290,10 @@
     apr_getopt_t *opt;
     module **mod;
     ap_directive_t *conftree = NULL;
-    const char *optarg;
+    char *optarg;
 
     apr_initialize();
-    process = create_process(argc, (char *const *)argv);
+    process = create_process(argc, argv);
     pglobal = process->pool;
     pconf = process->pconf;
     ap_server_argv0 = process->short_name;


-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message