summaryrefslogtreecommitdiffstats
path: root/Python/modsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 3b4c517..e77cb36 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -26,7 +26,7 @@ static char api_version_warning[] =
This Python has API version %d, module %.100s has version %d.";
PyObject *
-Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
+Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc,
PyObject *passthrough, int module_api_version)
{
PyObject *m, *d, *v, *n;
@@ -99,7 +99,7 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
/* Helper for mkvalue() to scan the length of a format */
static int
-countformat(char *format, int endchar)
+countformat(const char *format, int endchar)
{
int count = 0;
int level = 0;
@@ -142,14 +142,14 @@ countformat(char *format, int endchar)
/* Generic function to create a value -- the inverse of getargs() */
/* After an original idea and first implementation by Steven Miale */
-static PyObject *do_mktuple(char**, va_list *, int, int);
-static PyObject *do_mklist(char**, va_list *, int, int);
-static PyObject *do_mkdict(char**, va_list *, int, int);
-static PyObject *do_mkvalue(char**, va_list *);
+static PyObject *do_mktuple(const char**, va_list *, int, int);
+static PyObject *do_mklist(const char**, va_list *, int, int);
+static PyObject *do_mkdict(const char**, va_list *, int, int);
+static PyObject *do_mkvalue(const char**, va_list *);
static PyObject *
-do_mkdict(char **p_format, va_list *p_va, int endchar, int n)
+do_mkdict(const char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *d;
int i;
@@ -195,7 +195,7 @@ do_mkdict(char **p_format, va_list *p_va, int endchar, int n)
}
static PyObject *
-do_mklist(char **p_format, va_list *p_va, int endchar, int n)
+do_mklist(const char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *v;
int i;
@@ -242,7 +242,7 @@ _ustrlen(Py_UNICODE *u)
#endif
static PyObject *
-do_mktuple(char **p_format, va_list *p_va, int endchar, int n)
+do_mktuple(const char **p_format, va_list *p_va, int endchar, int n)
{
PyObject *v;
int i;
@@ -278,7 +278,7 @@ do_mktuple(char **p_format, va_list *p_va, int endchar, int n)
}
static PyObject *
-do_mkvalue(char **p_format, va_list *p_va)
+do_mkvalue(const char **p_format, va_list *p_va)
{
for (;;) {
switch (*(*p_format)++) {
@@ -454,7 +454,7 @@ do_mkvalue(char **p_format, va_list *p_va)
PyObject *
-Py_BuildValue(char *format, ...)
+Py_BuildValue(const char *format, ...)
{
va_list va;
PyObject* retval;
@@ -465,9 +465,9 @@ Py_BuildValue(char *format, ...)
}
PyObject *
-Py_VaBuildValue(char *format, va_list va)
+Py_VaBuildValue(const char *format, va_list va)
{
- char *f = format;
+ const char *f = format;
int n = countformat(f, '\0');
va_list lva;
@@ -494,7 +494,7 @@ Py_VaBuildValue(char *format, va_list va)
PyObject *
-PyEval_CallFunction(PyObject *obj, char *format, ...)
+PyEval_CallFunction(PyObject *obj, const char *format, ...)
{
va_list vargs;
PyObject *args;
@@ -516,7 +516,7 @@ PyEval_CallFunction(PyObject *obj, char *format, ...)
PyObject *
-PyEval_CallMethod(PyObject *obj, char *methodname, char *format, ...)
+PyEval_CallMethod(PyObject *obj, const char *methodname, const char *format, ...)
{
va_list vargs;
PyObject *meth;
@@ -545,7 +545,7 @@ PyEval_CallMethod(PyObject *obj, char *methodname, char *format, ...)
}
int
-PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+PyModule_AddObject(PyObject *m, const char *name, PyObject *o)
{
PyObject *dict;
if (!PyModule_Check(m)) {
@@ -574,13 +574,13 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
}
int
-PyModule_AddIntConstant(PyObject *m, char *name, long value)
+PyModule_AddIntConstant(PyObject *m, const char *name, long value)
{
return PyModule_AddObject(m, name, PyInt_FromLong(value));
}
int
-PyModule_AddStringConstant(PyObject *m, char *name, char *value)
+PyModule_AddStringConstant(PyObject *m, const char *name, const char *value)
{
return PyModule_AddObject(m, name, PyString_FromString(value));
}