Skip to content

Commit 7961207

Browse files
committed
add const keywords
1 parent 6910275 commit 7961207

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

main/fopen_wrappers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
189189

190190
/* {{{ php_check_safe_mode_include_dir
191191
*/
192-
PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC)
192+
PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC)
193193
{
194194
if (PG(safe_mode)) {
195195
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)
239239

240240
/* {{{ php_fopen_and_set_opened_path
241241
*/
242-
static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC)
242+
static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC)
243243
{
244244
FILE *fp;
245245

@@ -356,7 +356,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
356356
* Tries to open a file with a PATH-style list of directories.
357357
* If the filename starts with "." or "/", the path is ignored.
358358
*/
359-
PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC)
359+
PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC)
360360
{
361361
char *pathbuf, *ptr, *end;
362362
char *exec_fname;

main/fopen_wrappers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
3131
PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
3232
PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC);
3333

34-
PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC);
34+
PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);
3535

36-
PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC);
36+
PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC);
3737

3838
PHPAPI int php_is_url(char *path);
3939
PHPAPI char *php_strip_url_passwd(char *path);

main/network.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int inet_aton(const char *, struct in_addr *);
103103
# define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
104104
/* {{{ php_gai_strerror
105105
*/
106-
static char *php_gai_strerror(int code)
106+
static const char *php_gai_strerror(int code)
107107
{
108108
static struct {
109109
int code;

main/safe_mode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* 5 - only check file
4646
*/
4747

48-
PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags)
48+
PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags)
4949
{
5050
struct stat sb;
5151
int ret, nofile=0;
@@ -186,7 +186,7 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
186186
return 0;
187187
}
188188

189-
PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) {
189+
PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode) {
190190
#ifdef NETWARE
191191
/* NetWare don't have uid*/
192192
return 1;

main/safe_mode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#define CHECKUID_NO_ERRORS 0x01
3434

3535
BEGIN_EXTERN_C()
36-
PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode);
37-
PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags);
36+
PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode);
37+
PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags);
3838
PHPAPI char *php_get_current_user(void);
3939
END_EXTERN_C()
4040

0 commit comments

Comments
 (0)