diff options
-rw-r--r-- | include/apr_general.h | 8 | ||||
-rw-r--r-- | include/arch/win32/misc.h | 3 | ||||
-rw-r--r-- | misc/netware/start.c | 4 | ||||
-rw-r--r-- | misc/unix/start.c | 4 | ||||
-rw-r--r-- | misc/win32/internal.c | 3 | ||||
-rw-r--r-- | misc/win32/start.c | 15 |
6 files changed, 25 insertions, 12 deletions
diff --git a/include/apr_general.h b/include/apr_general.h index 531dff1af..c47467691 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -195,12 +195,16 @@ APR_DECLARE(apr_status_t) apr_initialize(void); * order to deal with platform-specific oddities, such as Win32 services, * code pages and signals. This must be the first function called for any * APR program. - * @deffunc apr_status_t apr_app_initialize(int *argc, char ***argv, char ***env) + * @param argc Pointer to the argc that may be corrected + * @param argv Pointer to the argv that may be corrected + * @param env Pointer to the env that may be corrected, may be NULL * @remark See apr_initialize if this is a library consumer of apr. * Otherwise, this call is identical to apr_initialize, and must be closed * with a call to apr_terminate at the end of program execution. */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env); +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + char const * const * *argv, + char const * const * *env); /** * Tear down any APR internal data structures which aren't torn down diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index feb72c6bf..072dad16b 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -103,7 +103,8 @@ struct apr_other_child_rec_t { */ extern int APR_DECLARE_DATA apr_app_init_complete; -int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args); +int apr_wastrtoastr(char const * const * *retarr, + wchar_t const * const *arr, int args); /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that diff --git a/misc/netware/start.c b/misc/netware/start.c index a49c1e589..64c6c0a9d 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -62,7 +62,9 @@ #include "internal_time.h" -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service diff --git a/misc/unix/start.c b/misc/unix/start.c index 5bfa8dc3a..b1ad87528 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -61,7 +61,9 @@ #include "internal_time.h" -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 771be2eac..4ba6f70ba 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -76,7 +76,8 @@ * These are allocated from the MSVCRT's _CRT_BLOCK to trick the system * into trusting our store. */ -int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args) +int apr_wastrtoastr(char const * const * *retarr, + wchar_t const * const *arr, int args) { size_t elesize = 0; char **newarr; diff --git a/misc/win32/start.c b/misc/win32/start.c index 36fc7ac6c..340c62960 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -75,9 +75,10 @@ int APR_DECLARE_DATA apr_app_init_complete = 0; * as a list of strings. These are allocated from the MSVCRT's * _CRT_BLOCK to trick the system into trusting our store. */ -static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) +static int warrsztoastr(const char * const * *retarr, + const wchar_t * arrsz, int args) { - apr_wchar_t *wch; + const apr_wchar_t *wch; size_t totlen; size_t newlen; size_t wsize; @@ -128,7 +129,9 @@ static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) /* Reprocess the arguments to main() for a completely apr-ized application */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -155,9 +158,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***en dupenv = warrsztoastr(&_environ, sysstr, -1); if (env) { - env = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); - memcpy(*env, _environ, (dupenv + 1) * sizeof (char *)); + *env = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); + memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *)); } else { } |