From: Nuno Lopes Date: Sat, 1 Jul 2006 11:35:34 +0000 (+0000) Subject: add const keywords X-Git-Tag: php-5.2.0RC1~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7961207d6bc39ece1401f3615ee0375766cc9f06;p=php add const keywords --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 750bf3dba8..22c8c1f714 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -189,7 +189,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC) /* {{{ php_check_safe_mode_include_dir */ -PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC) +PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC) { if (PG(safe_mode)) { if (PG(safe_mode_include_dir) && *PG(safe_mode_include_dir)) { @@ -239,7 +239,7 @@ PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC) /* {{{ php_fopen_and_set_opened_path */ -static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC) +static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC) { FILE *fp; @@ -356,7 +356,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) * Tries to open a file with a PATH-style list of directories. * If the filename starts with "." or "/", the path is ignored. */ -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC) +PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC) { char *pathbuf, *ptr, *end; char *exec_fname; diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index d67d8bace0..c2bbec3e43 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -31,9 +31,9 @@ PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC); PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC); PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC); -PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC); +PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC); -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC); +PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC); PHPAPI int php_is_url(char *path); PHPAPI char *php_strip_url_passwd(char *path); diff --git a/main/network.c b/main/network.c index 15fa5aad97..63197cdd15 100644 --- a/main/network.c +++ b/main/network.c @@ -103,7 +103,7 @@ int inet_aton(const char *, struct in_addr *); # define PHP_GAI_STRERROR(x) (php_gai_strerror(x)) /* {{{ php_gai_strerror */ -static char *php_gai_strerror(int code) +static const char *php_gai_strerror(int code) { static struct { int code; diff --git a/main/safe_mode.c b/main/safe_mode.c index 3103b7ace4..3753e90ffb 100644 --- a/main/safe_mode.c +++ b/main/safe_mode.c @@ -45,7 +45,7 @@ * 5 - only check file */ -PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags) +PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags) { struct stat sb; int ret, nofile=0; @@ -186,7 +186,7 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int return 0; } -PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) { +PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode) { #ifdef NETWARE /* NetWare don't have uid*/ return 1; diff --git a/main/safe_mode.h b/main/safe_mode.h index f2025b434c..51cb68c06e 100644 --- a/main/safe_mode.h +++ b/main/safe_mode.h @@ -33,8 +33,8 @@ #define CHECKUID_NO_ERRORS 0x01 BEGIN_EXTERN_C() -PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode); -PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags); +PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode); +PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags); PHPAPI char *php_get_current_user(void); END_EXTERN_C()