Add const to error and newstring functions

This commit is contained in:
Guido van Rossum 1996-12-10 15:33:34 +00:00
parent 36dd0d27c4
commit 067998f35e
4 changed files with 6 additions and 6 deletions

View File

@ -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 **));

View File

@ -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 *));

View File

@ -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;

View File

@ -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);