From 067998f35ec3013e9a55aad29f0e3dbe4560d11c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 10 Dec 1996 15:33:34 +0000 Subject: Add const to error and newstring functions --- Include/pyerrors.h | 2 +- Include/stringobject.h | 4 ++-- Objects/stringobject.c | 4 ++-- Python/errors.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 21a4833..51d8e44 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -39,7 +39,7 @@ PERFORMANCE OF THIS SOFTWARE. void PyErr_SetNone Py_PROTO((PyObject *)); void PyErr_SetObject Py_PROTO((PyObject *, PyObject *)); -void PyErr_SetString Py_PROTO((PyObject *, char *)); +void PyErr_SetString Py_PROTO((PyObject *, const char *)); PyObject *PyErr_Occurred Py_PROTO((void)); void PyErr_Clear Py_PROTO((void)); void PyErr_Fetch Py_PROTO((PyObject **, PyObject **, PyObject **)); diff --git a/Include/stringobject.h b/Include/stringobject.h index 06e572d..2c3e568 100644 --- a/Include/stringobject.h +++ b/Include/stringobject.h @@ -69,8 +69,8 @@ extern DL_IMPORT(PyTypeObject) PyString_Type; #define PyString_Check(op) ((op)->ob_type == &PyString_Type) -extern PyObject *PyString_FromStringAndSize Py_PROTO((char *, int)); -extern PyObject *PyString_FromString Py_PROTO((char *)); +extern PyObject *PyString_FromStringAndSize Py_PROTO((const char *, int)); +extern PyObject *PyString_FromString Py_PROTO((const char *)); extern int PyString_Size Py_PROTO((PyObject *)); extern char *PyString_AsString Py_PROTO((PyObject *)); extern void PyString_Concat Py_PROTO((PyObject **, PyObject *)); diff --git a/Objects/stringobject.c b/Objects/stringobject.c index b880891..048b83c 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -69,7 +69,7 @@ static stringobject *nullstring; */ object * newsizedstringobject(str, size) - char *str; + const char *str; int size; { register stringobject *op; @@ -116,7 +116,7 @@ newsizedstringobject(str, size) object * newstringobject(str) - char *str; + const char *str; { register unsigned int size = strlen(str); register stringobject *op; diff --git a/Python/errors.c b/Python/errors.c index 29f3cfd..a1ab4b8 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -124,7 +124,7 @@ err_set(exception) void err_setstr(exception, string) object *exception; - char *string; + const char *string; { object *value = newstringobject(string); err_setval(exception, value); -- cgit v0.12