[Python-3000-checkins] r57439 - in python/branches/py3k: Include/sysmodule.h Python/sysmodule.c
neal.norwitz
python-3000-checkins at python.org
Sat Aug 25 02:32:45 CEST 2007
Author: neal.norwitz
Date: Sat Aug 25 02:32:45 2007
New Revision: 57439
Modified:
python/branches/py3k/Include/sysmodule.h
python/branches/py3k/Python/sysmodule.c
Log:
Add const to input string parameters
Modified: python/branches/py3k/Include/sysmodule.h
==============================================================================
--- python/branches/py3k/Include/sysmodule.h (original)
+++ python/branches/py3k/Include/sysmodule.h Sat Aug 25 02:32:45 2007
@@ -7,10 +7,10 @@
extern "C" {
#endif
-PyAPI_FUNC(PyObject *) PySys_GetObject(char *);
-PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *);
+PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
+PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
PyAPI_FUNC(void) PySys_SetArgv(int, char **);
-PyAPI_FUNC(void) PySys_SetPath(char *);
+PyAPI_FUNC(void) PySys_SetPath(const char *);
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
@@ -21,7 +21,7 @@
PyAPI_DATA(int) _PySys_CheckInterval;
PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
-PyAPI_FUNC(void) PySys_AddWarnOption(char *);
+PyAPI_FUNC(void) PySys_AddWarnOption(const char *);
#ifdef __cplusplus
}
Modified: python/branches/py3k/Python/sysmodule.c
==============================================================================
--- python/branches/py3k/Python/sysmodule.c (original)
+++ python/branches/py3k/Python/sysmodule.c Sat Aug 25 02:32:45 2007
@@ -46,7 +46,7 @@
#endif
PyObject *
-PySys_GetObject(char *name)
+PySys_GetObject(const char *name)
{
PyThreadState *tstate = PyThreadState_GET();
PyObject *sd = tstate->interp->sysdict;
@@ -56,7 +56,7 @@
}
int
-PySys_SetObject(char *name, PyObject *v)
+PySys_SetObject(const char *name, PyObject *v)
{
PyThreadState *tstate = PyThreadState_GET();
PyObject *sd = tstate->interp->sysdict;
@@ -819,7 +819,7 @@
}
void
-PySys_AddWarnOption(char *s)
+PySys_AddWarnOption(const char *s)
{
PyObject *str;
@@ -1128,10 +1128,10 @@
}
static PyObject *
-makepathobject(char *path, int delim)
+makepathobject(const char *path, int delim)
{
int i, n;
- char *p;
+ const char *p;
PyObject *v, *w;
n = 1;
@@ -1161,7 +1161,7 @@
}
void
-PySys_SetPath(char *path)
+PySys_SetPath(const char *path)
{
PyObject *v;
if ((v = makepathobject(path, DELIM)) == NULL)
More information about the Python-3000-checkins
mailing list