From c3d12ac88ced9fe7de33a8f6654eef74c7f38ace Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sat, 24 Dec 2005 06:03:06 +0000 Subject: [PATCH] const poisoning, spreading to fix new const warnings in _winreg.c. --- Include/structmember.h | 6 +++--- PC/_winreg.c | 4 ++-- Python/structmember.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Include/structmember.h b/Include/structmember.h index 96d2331b044..91b23d5b5bb 100644 --- a/Include/structmember.h +++ b/Include/structmember.h @@ -79,11 +79,11 @@ typedef struct PyMemberDef { /* Obsolete API, for binary backwards compatibility */ -PyAPI_FUNC(PyObject *) PyMember_Get(char *, struct memberlist *, char *); -PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, char *, PyObject *); +PyAPI_FUNC(PyObject *) PyMember_Get(const char *, struct memberlist *, const char *); +PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, const char *, PyObject *); /* Current API, use this */ -PyAPI_FUNC(PyObject *) PyMember_GetOne(char *, struct PyMemberDef *); +PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); diff --git a/PC/_winreg.c b/PC/_winreg.c index a20b09a4ee0..34e4f6895a8 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -455,7 +455,7 @@ static PyNumberMethods PyHKEY_NumberMethods = /* fwd declare __getattr__ */ -static PyObject *PyHKEY_getattr(PyObject *self, char *name); +static PyObject *PyHKEY_getattr(PyObject *self, const char *name); /* The type itself */ PyTypeObject PyHKEY_Type = @@ -526,7 +526,7 @@ static struct PyMethodDef PyHKEY_methods[] = { }; /*static*/ PyObject * -PyHKEY_getattr(PyObject *self, char *name) +PyHKEY_getattr(PyObject *self, const char *name) { PyObject *res; diff --git a/Python/structmember.c b/Python/structmember.c index 1574c95cf8a..0a24d9d26cd 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -29,7 +29,7 @@ listmembers(struct memberlist *mlist) } PyObject * -PyMember_Get(char *addr, struct memberlist *mlist, char *name) +PyMember_Get(const char *addr, struct memberlist *mlist, const char *name) { struct memberlist *l; @@ -51,7 +51,7 @@ PyMember_Get(char *addr, struct memberlist *mlist, char *name) } PyObject * -PyMember_GetOne(char *addr, PyMemberDef *l) +PyMember_GetOne(const char *addr, PyMemberDef *l) { PyObject *v; if ((l->flags & READ_RESTRICTED) && @@ -134,7 +134,7 @@ PyMember_GetOne(char *addr, PyMemberDef *l) } int -PyMember_Set(char *addr, struct memberlist *mlist, char *name, PyObject *v) +PyMember_Set(char *addr, struct memberlist *mlist, const char *name, PyObject *v) { struct memberlist *l;