summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-19 18:03:34 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-19 18:03:34 (GMT)
commitc679227e31245b0e8dec74a1f7cc77710541d985 (patch)
tree0ed52ac2bd85d0cad42e39aec5437a603750425b /Include
parent80ab13067e9b8fbd02a05a4863e26b04938b77f5 (diff)
downloadcpython-c679227e31245b0e8dec74a1f7cc77710541d985.zip
cpython-c679227e31245b0e8dec74a1f7cc77710541d985.tar.gz
cpython-c679227e31245b0e8dec74a1f7cc77710541d985.tar.bz2
Issue #1772673: The type of `char*` arguments now changed to `const char*`.
Diffstat (limited to 'Include')
-rw-r--r--Include/abstract.h19
-rw-r--r--Include/fileobject.h5
-rw-r--r--Include/grammar.h6
-rw-r--r--Include/import.h18
-rw-r--r--Include/longobject.h6
-rw-r--r--Include/marshal.h3
-rw-r--r--Include/parsetok.h15
-rw-r--r--Include/pyport.h6
-rw-r--r--Include/pythonrun.h4
9 files changed, 44 insertions, 38 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index a1f0595..d258ad5 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -144,7 +144,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Implemented elsewhere:
- int PyObject_HasAttrString(PyObject *o, char *attr_name);
+ int PyObject_HasAttrString(PyObject *o, const char *attr_name);
Returns 1 if o has the attribute attr_name, and 0 otherwise.
This is equivalent to the Python expression:
@@ -156,7 +156,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Implemented elsewhere:
- PyObject* PyObject_GetAttrString(PyObject *o, char *attr_name);
+ PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
Retrieve an attributed named attr_name form object o.
Returns the attribute value on success, or NULL on failure.
@@ -189,7 +189,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Implemented elsewhere:
- int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v);
+ int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
Set the value of the attribute named attr_name, for object o,
to the value, v. Returns -1 on failure. This is
@@ -209,7 +209,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* implemented as a macro:
- int PyObject_DelAttrString(PyObject *o, char *attr_name);
+ int PyObject_DelAttrString(PyObject *o, const char *attr_name);
Delete attribute named attr_name, for object o. Returns
-1 on failure. This is the equivalent of the Python
@@ -434,7 +434,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
statement: o[key]=v.
*/
- PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key);
+ PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key);
/*
Remove the mapping for object, key, from the object *o.
@@ -1156,7 +1156,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
/* implemented as a macro:
- int PyMapping_DelItemString(PyObject *o, char *key);
+ int PyMapping_DelItemString(PyObject *o, const char *key);
Remove the mapping for object, key, from the object *o.
Returns -1 on failure. This is equivalent to
@@ -1174,7 +1174,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
*/
#define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
- PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, char *key);
+ PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key);
/*
On success, return 1 if the mapping object has the key, key,
@@ -1218,7 +1218,8 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
*/
- PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key);
+ PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
+ const char *key);
/*
Return element of o corresponding to the object, key, or NULL
@@ -1226,7 +1227,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
o[key].
*/
- PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, char *key,
+ PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key,
PyObject *value);
/*
diff --git a/Include/fileobject.h b/Include/fileobject.h
index a99c94d..0939744 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -8,8 +8,9 @@ extern "C" {
#define PY_STDIOTEXTMODE "b"
-PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *,
- char *, int);
+PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int,
+ const char *, const char *,
+ const char *, int);
PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
diff --git a/Include/grammar.h b/Include/grammar.h
index 862f6a8..ba7d19d 100644
--- a/Include/grammar.h
+++ b/Include/grammar.h
@@ -69,13 +69,13 @@ typedef struct {
/* FUNCTIONS */
grammar *newgrammar(int start);
-dfa *adddfa(grammar *g, int type, char *name);
+dfa *adddfa(grammar *g, int type, const char *name);
int addstate(dfa *d);
void addarc(dfa *d, int from, int to, int lbl);
dfa *PyGrammar_FindDFA(grammar *g, int type);
-int addlabel(labellist *ll, int type, char *str);
-int findlabel(labellist *ll, int type, char *str);
+int addlabel(labellist *ll, int type, const char *str);
+int findlabel(labellist *ll, int type, const char *str);
const char *PyGrammar_LabelRepr(label *lb);
void translatelabels(grammar *g);
diff --git a/Include/import.h b/Include/import.h
index 90049e0..4a515d5b 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -13,19 +13,19 @@ PyMODINIT_FUNC PyInit_imp(void);
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
- char *name, /* UTF-8 encoded string */
+ const char *name, /* UTF-8 encoded string */
PyObject *co
);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
- char *name, /* UTF-8 encoded string */
+ const char *name, /* UTF-8 encoded string */
PyObject *co,
- char *pathname /* decoded from the filesystem encoding */
+ const char *pathname /* decoded from the filesystem encoding */
);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
- char *name, /* UTF-8 encoded string */
+ const char *name, /* UTF-8 encoded string */
PyObject *co,
- char *pathname, /* decoded from the filesystem encoding */
- char *cpathname /* decoded from the filesystem encoding */
+ const char *pathname, /* decoded from the filesystem encoding */
+ const char *cpathname /* decoded from the filesystem encoding */
);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
PyObject *name,
@@ -72,7 +72,7 @@ PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
PyObject *name
);
PyAPI_FUNC(int) PyImport_ImportFrozenModule(
- char *name /* UTF-8 encoded string */
+ const char *name /* UTF-8 encoded string */
);
#ifndef Py_LIMITED_API
@@ -92,12 +92,12 @@ PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin(
PyAPI_FUNC(PyObject *)_PyImport_FindExtensionObject(PyObject *, PyObject *);
PyAPI_FUNC(int)_PyImport_FixupBuiltin(
PyObject *mod,
- char *name /* UTF-8 encoded string */
+ const char *name /* UTF-8 encoded string */
);
PyAPI_FUNC(int)_PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *);
struct _inittab {
- char *name; /* ASCII encoded string */
+ const char *name; /* ASCII encoded string */
PyObject* (*initfunc)(void);
};
PyAPI_DATA(struct _inittab *) PyImport_Inittab;
diff --git a/Include/longobject.h b/Include/longobject.h
index e62d954..7c3f6d0 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -93,7 +93,7 @@ PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
#endif /* HAVE_LONG_LONG */
-PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
+PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
@@ -189,8 +189,8 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
/* These aren't really part of the int object, but they're handy. The
functions are in Python/mystrtoul.c.
*/
-PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
-PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
+PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int);
+PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
#ifdef __cplusplus
}
diff --git a/Include/marshal.h b/Include/marshal.h
index 77d9c5e..09d9337 100644
--- a/Include/marshal.h
+++ b/Include/marshal.h
@@ -19,7 +19,8 @@ PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
#endif
-PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
+PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
+ Py_ssize_t);
#ifdef __cplusplus
}
diff --git a/Include/parsetok.h b/Include/parsetok.h
index 68b59bc..2acb854 100644
--- a/Include/parsetok.h
+++ b/Include/parsetok.h
@@ -38,7 +38,8 @@ typedef struct {
PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
perrdetail *);
PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
- char *, char *, perrdetail *);
+ const char *, const char *,
+ perrdetail *);
PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
perrdetail *, int);
@@ -48,8 +49,8 @@ PyAPI_FUNC(node *) PyParser_ParseFileFlags(
const char *enc,
grammar *g,
int start,
- char *ps1,
- char *ps2,
+ const char *ps1,
+ const char *ps2,
perrdetail *err_ret,
int flags);
PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
@@ -58,8 +59,8 @@ PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
const char *enc,
grammar *g,
int start,
- char *ps1,
- char *ps2,
+ const char *ps1,
+ const char *ps2,
perrdetail *err_ret,
int *flags);
PyAPI_FUNC(node *) PyParser_ParseFileObject(
@@ -68,8 +69,8 @@ PyAPI_FUNC(node *) PyParser_ParseFileObject(
const char *enc,
grammar *g,
int start,
- char *ps1,
- char *ps2,
+ const char *ps1,
+ const char *ps2,
perrdetail *err_ret,
int *flags);
diff --git a/Include/pyport.h b/Include/pyport.h
index ca20b22..17dad41 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -673,8 +673,10 @@ extern char * _getpty(int *, int, mode_t, int);
/* BSDI does not supply a prototype for the 'openpty' and 'forkpty'
functions, even though they are included in libutil. */
#include <termios.h>
-extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
-extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
+extern int openpty(int *, int *, char *,
+ const struct termios *, const struct winsize *);
+extern pid_t forkpty(int *, char *,
+ const struct termios *, const struct winsize *);
#endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */
#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 7f67ab7..ec0565e 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -261,10 +261,10 @@ PyAPI_DATA(PyThreadState *) _Py_Finalizing;
/* Stuff with no proper home (yet) */
#ifndef Py_LIMITED_API
-PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
+PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
#endif
PyAPI_DATA(int) (*PyOS_InputHook)(void);
-PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
#ifndef Py_LIMITED_API
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
#endif