Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f308132

Browse files
committed
Add const to input string parameters
1 parent fa06e5f commit f308132

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Include/sysmodule.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
extern "C" {
88
#endif
99

10-
PyAPI_FUNC(PyObject *) PySys_GetObject(char *);
11-
PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *);
10+
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
11+
PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
1212
PyAPI_FUNC(void) PySys_SetArgv(int, char **);
13-
PyAPI_FUNC(void) PySys_SetPath(char *);
13+
PyAPI_FUNC(void) PySys_SetPath(const char *);
1414

1515
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
1616
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
@@ -21,7 +21,7 @@ PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
2121
PyAPI_DATA(int) _PySys_CheckInterval;
2222

2323
PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
24-
PyAPI_FUNC(void) PySys_AddWarnOption(char *);
24+
PyAPI_FUNC(void) PySys_AddWarnOption(const char *);
2525

2626
#ifdef __cplusplus
2727
}

Python/sysmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern const char *PyWin_DLLVersionString;
4646
#endif
4747

4848
PyObject *
49-
PySys_GetObject(char *name)
49+
PySys_GetObject(const char *name)
5050
{
5151
PyThreadState *tstate = PyThreadState_GET();
5252
PyObject *sd = tstate->interp->sysdict;
@@ -56,7 +56,7 @@ PySys_GetObject(char *name)
5656
}
5757

5858
int
59-
PySys_SetObject(char *name, PyObject *v)
59+
PySys_SetObject(const char *name, PyObject *v)
6060
{
6161
PyThreadState *tstate = PyThreadState_GET();
6262
PyObject *sd = tstate->interp->sysdict;
@@ -819,7 +819,7 @@ PySys_ResetWarnOptions(void)
819819
}
820820

821821
void
822-
PySys_AddWarnOption(char *s)
822+
PySys_AddWarnOption(const char *s)
823823
{
824824
PyObject *str;
825825

@@ -1128,10 +1128,10 @@ _PySys_Init(void)
11281128
}
11291129

11301130
static PyObject *
1131-
makepathobject(char *path, int delim)
1131+
makepathobject(const char *path, int delim)
11321132
{
11331133
int i, n;
1134-
char *p;
1134+
const char *p;
11351135
PyObject *v, *w;
11361136

11371137
n = 1;
@@ -1161,7 +1161,7 @@ makepathobject(char *path, int delim)
11611161
}
11621162

11631163
void
1164-
PySys_SetPath(char *path)
1164+
PySys_SetPath(const char *path)
11651165
{
11661166
PyObject *v;
11671167
if ((v = makepathobject(path, DELIM)) == NULL)

0 commit comments

Comments
 (0)