Kaydet (Commit) b382b84a authored tarafından Neal Norwitz's avatar Neal Norwitz

Add const to some strings that are not modified

üst cd795963
...@@ -167,10 +167,10 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); ...@@ -167,10 +167,10 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *); PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
#ifdef Py_WIN_WIDE_FILENAMES #ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, Py_UNICODE *); PyObject *, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...); PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
...@@ -198,13 +198,13 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); ...@@ -198,13 +198,13 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
/* Export the old function so that the existing API remains available: */ /* Export the old function so that the existing API remains available: */
PyAPI_FUNC(void) PyErr_BadInternalCall(void); PyAPI_FUNC(void) PyErr_BadInternalCall(void);
PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno); PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno);
/* Mask the old API with a call to the new API for code compiled under /* Mask the old API with a call to the new API for code compiled under
Python 2.0: */ Python 2.0: */
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
/* Function to create a new exception */ /* Function to create a new exception */
PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base, PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base,
PyObject *dict); PyObject *dict);
PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
......
...@@ -348,7 +348,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject) ...@@ -348,7 +348,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
PyObject * PyObject *
PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
{ {
PyObject *name = filename ? PyUnicode_FromString(filename) : NULL; PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name); PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
...@@ -358,7 +358,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) ...@@ -358,7 +358,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
#ifdef Py_WIN_WIDE_FILENAMES #ifdef Py_WIN_WIDE_FILENAMES
PyObject * PyObject *
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, Py_UNICODE *filename) PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
{ {
PyObject *name = filename ? PyObject *name = filename ?
PyUnicode_FromUnicode(filename, wcslen(filename)) : PyUnicode_FromUnicode(filename, wcslen(filename)) :
...@@ -494,7 +494,7 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( ...@@ -494,7 +494,7 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
void void
_PyErr_BadInternalCall(char *filename, int lineno) _PyErr_BadInternalCall(const char *filename, int lineno)
{ {
PyErr_Format(PyExc_SystemError, PyErr_Format(PyExc_SystemError,
"%s:%d: bad argument to internal function", "%s:%d: bad argument to internal function",
...@@ -536,9 +536,9 @@ PyErr_Format(PyObject *exception, const char *format, ...) ...@@ -536,9 +536,9 @@ PyErr_Format(PyObject *exception, const char *format, ...)
PyObject * PyObject *
PyErr_NewException(char *name, PyObject *base, PyObject *dict) PyErr_NewException(const char *name, PyObject *base, PyObject *dict)
{ {
char *dot; const char *dot;
PyObject *modulename = NULL; PyObject *modulename = NULL;
PyObject *classname = NULL; PyObject *classname = NULL;
PyObject *mydict = NULL; PyObject *mydict = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment