From 15e62742fad688b026ba80bf17d1345c4cbd423b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 27 Feb 2006 16:46:16 +0000 Subject: Revert backwards-incompatible const changes. --- Include/modsupport.h | 4 ++-- Include/object.h | 8 ++++---- Modules/_cursesmodule.c | 2 +- Modules/_hashopenssl.c | 4 ++-- Modules/_lsprof.c | 4 ++-- Modules/_sre.c | 16 ++++++++-------- Modules/binascii.c | 4 ++-- Modules/bz2module.c | 6 +++--- Modules/cPickle.c | 6 +++--- Modules/nismodule.c | 6 +++--- Modules/pyexpat.c | 2 +- Modules/sha256module.c | 4 ++-- Modules/sha512module.c | 4 ++-- Modules/shamodule.c | 2 +- Objects/abstract.c | 2 +- Objects/boolobject.c | 2 +- Objects/classobject.c | 2 +- Objects/complexobject.c | 2 +- Objects/descrobject.c | 2 +- Objects/enumobject.c | 2 +- Objects/fileobject.c | 2 +- Objects/floatobject.c | 2 +- Objects/funcobject.c | 2 +- Objects/intobject.c | 2 +- Objects/listobject.c | 4 ++-- Objects/longobject.c | 2 +- Objects/moduleobject.c | 2 +- Objects/object.c | 4 ++-- Objects/stringobject.c | 2 +- Objects/structseq.c | 2 +- Objects/tupleobject.c | 2 +- Objects/typeobject.c | 2 +- Objects/unicodeobject.c | 2 +- Objects/weakrefobject.c | 4 ++-- Python/bltinmodule.c | 2 +- Python/getargs.c | 21 +++++++++++---------- 36 files changed, 71 insertions(+), 70 deletions(-) diff --git a/Include/modsupport.h b/Include/modsupport.h index fc9f2e8..a56d07c 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -24,14 +24,14 @@ extern "C" { PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, - const char *, const char **, ...); + const char *, char **, ...); PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, int, int, ...); PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, - const char *, const char **, va_list); + const char *, char **, va_list); PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); diff --git a/Include/object.h b/Include/object.h index 33b75be..9c91373 100644 --- a/Include/object.h +++ b/Include/object.h @@ -144,12 +144,12 @@ typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); typedef int (*getreadbufferproc)(PyObject *, int, void **); typedef int (*getwritebufferproc)(PyObject *, int, void **); typedef int (*getsegcountproc)(PyObject *, int *); -typedef int (*getcharbufferproc)(PyObject *, int, const char **); +typedef int (*getcharbufferproc)(PyObject *, int, char **); /* ssize_t-based buffer interface */ typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **); typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **); typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *); -typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, const char **); +typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **); typedef int (*objobjproc)(PyObject *, PyObject *); typedef int (*visitproc)(PyObject *, void *); @@ -239,9 +239,9 @@ typedef struct { typedef void (*freefunc)(void *); typedef void (*destructor)(PyObject *); typedef int (*printfunc)(PyObject *, FILE *, int); -typedef PyObject *(*getattrfunc)(PyObject *, const char *); +typedef PyObject *(*getattrfunc)(PyObject *, char *); typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); -typedef int (*setattrfunc)(PyObject *, const char *, PyObject *); +typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); typedef int (*cmpfunc)(PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 4c03602..71d7a69 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1886,7 +1886,7 @@ PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds) int err; char* termstr = NULL; - static const char *kwlist[] = {"term", "fd", NULL}; + static char *kwlist[] = {"term", "fd", NULL}; if (!PyArg_ParseTupleAndKeywords( args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) { diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 9bdd274..117cc4d 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -234,7 +234,7 @@ EVP_repr(PyObject *self) static int EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"name", "string", NULL}; + static char *kwlist[] = {"name", "string", NULL}; PyObject *name_obj = NULL; char *nameStr; unsigned char *cp = NULL; @@ -370,7 +370,7 @@ The MD5 and SHA1 algorithms are always supported.\n"); static PyObject * EVP_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"name", "string", NULL}; + static char *kwlist[] = {"name", "string", NULL}; PyObject *name_obj = NULL; char *name; const EVP_MD *digest; diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 8b74e38..8ffdf23 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -675,7 +675,7 @@ profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds) { int subcalls = -1; int builtins = -1; - static const char *kwlist[] = {"subcalls", "builtins", 0}; + static char *kwlist[] = {"subcalls", "builtins", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:enable", kwlist, &subcalls, &builtins)) return NULL; @@ -758,7 +758,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw) #else int builtins = 0; #endif - static const char *kwlist[] = {"timer", "timeunit", + static char *kwlist[] = {"timer", "timeunit", "subcalls", "builtins", 0}; if (!PyArg_ParseTupleAndKeywords(args, kw, "|Odii:Profiler", kwlist, diff --git a/Modules/_sre.c b/Modules/_sre.c index 3cc90d4..fb73f7f 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -2010,7 +2010,7 @@ pattern_match(PatternObject* self, PyObject* args, PyObject* kw) PyObject* string; int start = 0; int end = INT_MAX; - static const char* kwlist[] = { "pattern", "pos", "endpos", NULL }; + static char* kwlist[] = { "pattern", "pos", "endpos", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:match", kwlist, &string, &start, &end)) return NULL; @@ -2047,7 +2047,7 @@ pattern_search(PatternObject* self, PyObject* args, PyObject* kw) PyObject* string; int start = 0; int end = INT_MAX; - static const char* kwlist[] = { "pattern", "pos", "endpos", NULL }; + static char* kwlist[] = { "pattern", "pos", "endpos", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:search", kwlist, &string, &start, &end)) return NULL; @@ -2188,7 +2188,7 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw) PyObject* string; int start = 0; int end = INT_MAX; - static const char* kwlist[] = { "source", "pos", "endpos", NULL }; + static char* kwlist[] = { "source", "pos", "endpos", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:findall", kwlist, &string, &start, &end)) return NULL; @@ -2314,7 +2314,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw) PyObject* string; int maxsplit = 0; - static const char* kwlist[] = { "source", "maxsplit", NULL }; + static char* kwlist[] = { "source", "maxsplit", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "O|i:split", kwlist, &string, &maxsplit)) return NULL; @@ -2598,7 +2598,7 @@ pattern_sub(PatternObject* self, PyObject* args, PyObject* kw) PyObject* template; PyObject* string; int count = 0; - static const char* kwlist[] = { "repl", "string", "count", NULL }; + static char* kwlist[] = { "repl", "string", "count", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:sub", kwlist, &template, &string, &count)) return NULL; @@ -2612,7 +2612,7 @@ pattern_subn(PatternObject* self, PyObject* args, PyObject* kw) PyObject* template; PyObject* string; int count = 0; - static const char* kwlist[] = { "repl", "string", "count", NULL }; + static char* kwlist[] = { "repl", "string", "count", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:subn", kwlist, &template, &string, &count)) return NULL; @@ -2919,7 +2919,7 @@ match_groups(MatchObject* self, PyObject* args, PyObject* kw) int index; PyObject* def = Py_None; - static const char* kwlist[] = { "default", NULL }; + static char* kwlist[] = { "default", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groups", kwlist, &def)) return NULL; @@ -2948,7 +2948,7 @@ match_groupdict(MatchObject* self, PyObject* args, PyObject* kw) int index; PyObject* def = Py_None; - static const char* kwlist[] = { "default", NULL }; + static char* kwlist[] = { "default", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groupdict", kwlist, &def)) return NULL; diff --git a/Modules/binascii.c b/Modules/binascii.c index 4a2c268..3b9a44f 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -1032,7 +1032,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs) unsigned char *data, *odata; unsigned int datalen = 0; PyObject *rv; - static const char *kwlist[] = {"data", "header", NULL}; + static char *kwlist[] = {"data", "header", NULL}; int header = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", kwlist, &data, @@ -1133,7 +1133,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs) unsigned int datalen = 0, odatalen = 0; PyObject *rv; unsigned int linelen = 0; - static const char *kwlist[] = {"data", "quotetabs", "istext", + static char *kwlist[] = {"data", "quotetabs", "istext", "header", NULL}; int istext = 1; int quotetabs = 0; diff --git a/Modules/bz2module.c b/Modules/bz2module.c index c8fab7a..ed329b8 100644 --- a/Modules/bz2module.c +++ b/Modules/bz2module.c @@ -1275,7 +1275,7 @@ static PyMemberDef BZ2File_members[] = { static int BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs) { - static const char *kwlist[] = {"filename", "mode", "buffering", + static char *kwlist[] = {"filename", "mode", "buffering", "compresslevel", 0}; PyObject *name; char *mode = "r"; @@ -1664,7 +1664,7 @@ BZ2Comp_init(BZ2CompObject *self, PyObject *args, PyObject *kwargs) { int compresslevel = 9; int bzerror; - static const char *kwlist[] = {"compresslevel", 0}; + static char *kwlist[] = {"compresslevel", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:BZ2Compressor", kwlist, &compresslevel)) @@ -2009,7 +2009,7 @@ bz2_compress(PyObject *self, PyObject *args, PyObject *kwargs) bz_stream _bzs; bz_stream *bzs = &_bzs; int bzerror; - static const char *kwlist[] = {"data", "compresslevel", 0}; + static char *kwlist[] = {"data", "compresslevel", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", kwlist, &data, &datasize, diff --git a/Modules/cPickle.c b/Modules/cPickle.c index cb14627..727dcc9 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2868,7 +2868,7 @@ newPicklerobject(PyObject *file, int proto) static PyObject * get_Pickler(PyObject *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"file", "protocol", NULL}; + static char *kwlist[] = {"file", "protocol", NULL}; PyObject *file = NULL; int proto = 0; @@ -5388,7 +5388,7 @@ Unpickler_setattr(Unpicklerobject *self, char *name, PyObject *value) static PyObject * cpm_dump(PyObject *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"obj", "file", "protocol", NULL}; + static char *kwlist[] = {"obj", "file", "protocol", NULL}; PyObject *ob, *file, *res = NULL; Picklerobject *pickler = 0; int proto = 0; @@ -5417,7 +5417,7 @@ cpm_dump(PyObject *self, PyObject *args, PyObject *kwds) static PyObject * cpm_dumps(PyObject *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"obj", "protocol", NULL}; + static char *kwlist[] = {"obj", "protocol", NULL}; PyObject *ob, *file = 0, *res = NULL; Picklerobject *pickler = 0; int proto = 0; diff --git a/Modules/nismodule.c b/Modules/nismodule.c index 084852f..0811430 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -160,7 +160,7 @@ nis_match (PyObject *self, PyObject *args, PyObject *kwdict) int err; PyObject *res; int fix; - static const char *kwlist[] = {"key", "map", "domain", NULL}; + static char *kwlist[] = {"key", "map", "domain", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwdict, "t#s|s:match", kwlist, @@ -192,7 +192,7 @@ nis_cat (PyObject *self, PyObject *args, PyObject *kwdict) struct ypcallback_data data; PyObject *dict; int err; - static const char *kwlist[] = {"map", "domain", NULL}; + static char *kwlist[] = {"map", "domain", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwdict, "s|s:cat", kwlist, &map, &domain)) @@ -383,7 +383,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict) nismaplist *maps; PyObject *list; int err; - static const char *kwlist[] = {"domain", NULL}; + static char *kwlist[] = {"domain", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s:maps", kwlist, &domain)) diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 76b7cf9..b3001ea 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1726,7 +1726,7 @@ pyexpat_ParserCreate(PyObject *notused, PyObject *args, PyObject *kw) PyObject *intern = NULL; PyObject *result; int intern_decref = 0; - static const char *kwlist[] = {"encoding", "namespace_separator", + static char *kwlist[] = {"encoding", "namespace_separator", "intern", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kw, "|zzO:ParserCreate", kwlist, diff --git a/Modules/sha256module.c b/Modules/sha256module.c index e16338d..7037ca0 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -624,7 +624,7 @@ PyDoc_STRVAR(SHA256_new__doc__, static PyObject * SHA256_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"string", NULL}; + static char *kwlist[] = {"string", NULL}; SHAobject *new; unsigned char *cp = NULL; int len; @@ -655,7 +655,7 @@ PyDoc_STRVAR(SHA224_new__doc__, static PyObject * SHA224_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"string", NULL}; + static char *kwlist[] = {"string", NULL}; SHAobject *new; unsigned char *cp = NULL; int len; diff --git a/Modules/sha512module.c b/Modules/sha512module.c index 3837795..539204e 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -690,7 +690,7 @@ PyDoc_STRVAR(SHA512_new__doc__, static PyObject * SHA512_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"string", NULL}; + static char *kwlist[] = {"string", NULL}; SHAobject *new; unsigned char *cp = NULL; int len; @@ -721,7 +721,7 @@ PyDoc_STRVAR(SHA384_new__doc__, static PyObject * SHA384_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"string", NULL}; + static char *kwlist[] = {"string", NULL}; SHAobject *new; unsigned char *cp = NULL; int len; diff --git a/Modules/shamodule.c b/Modules/shamodule.c index 93a9224..058391d 100644 --- a/Modules/shamodule.c +++ b/Modules/shamodule.c @@ -543,7 +543,7 @@ hashed."); static PyObject * SHA_new(PyObject *self, PyObject *args, PyObject *kwdict) { - static const char *kwlist[] = {"string", NULL}; + static char *kwlist[] = {"string", NULL}; SHAobject *new; unsigned char *cp = NULL; int len; diff --git a/Objects/abstract.c b/Objects/abstract.c index a7cc0d6..dc46193 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -221,7 +221,7 @@ int PyObject_AsCharBuffer(PyObject *obj, Py_ssize_t *buffer_len) { PyBufferProcs *pb; - const char *pp; + char *pp; Py_ssize_t len; if (obj == NULL || buffer == NULL || buffer_len == NULL) { diff --git a/Objects/boolobject.c b/Objects/boolobject.c index 677a98b..f2429fe 100644 --- a/Objects/boolobject.c +++ b/Objects/boolobject.c @@ -50,7 +50,7 @@ PyObject *PyBool_FromLong(long ok) static PyObject * bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"x", 0}; + static char *kwlist[] = {"x", 0}; PyObject *x = Py_False; long ok; diff --git a/Objects/classobject.c b/Objects/classobject.c index 9a36f7d..34afb9e 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -159,7 +159,7 @@ static PyObject * class_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *name, *bases, *dict; - static const char *kwlist[] = {"name", "bases", "dict", 0}; + static char *kwlist[] = {"name", "bases", "dict", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO", kwlist, &name, &bases, &dict)) diff --git a/Objects/complexobject.c b/Objects/complexobject.c index f29a90f..5c84eff 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -829,7 +829,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) Py_complex cr, ci; int own_r = 0; static PyObject *complexstr; - static const char *kwlist[] = {"real", "imag", 0}; + static char *kwlist[] = {"real", "imag", 0}; r = Py_False; i = NULL; diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 6972a69..b96ad6e 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1182,7 +1182,7 @@ static int property_init(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL; - static const char *kwlist[] = {"fget", "fset", "fdel", "doc", 0}; + static char *kwlist[] = {"fget", "fset", "fdel", "doc", 0}; propertyobject *gs = (propertyobject *)self; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOOO:property", diff --git a/Objects/enumobject.c b/Objects/enumobject.c index ea85e3c..5999ae9 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -16,7 +16,7 @@ enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { enumobject *en; PyObject *seq = NULL; - static const char *kwlist[] = {"sequence", 0}; + static char *kwlist[] = {"sequence", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:enumerate", kwlist, &seq)) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index e4fffdd..d535869 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -1925,7 +1925,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) { PyFileObject *foself = (PyFileObject *)self; int ret = 0; - static const char *kwlist[] = {"name", "mode", "buffering", 0}; + static char *kwlist[] = {"name", "mode", "buffering", 0}; char *name = NULL; char *mode = "r"; int bufsize = -1; diff --git a/Objects/floatobject.c b/Objects/floatobject.c index e1e063b..bc19a5b 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -940,7 +940,7 @@ static PyObject * float_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = Py_False; /* Integer zero */ - static const char *kwlist[] = {"x", 0}; + static char *kwlist[] = {"x", 0}; if (type != &PyFloat_Type) return float_subtype_new(type, args, kwds); /* Wimp out */ diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 6c68349..00ae2eb 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -364,7 +364,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw) PyObject *closure = Py_None; PyFunctionObject *newfunc; Py_ssize_t nfree, nclosure; - static const char *kwlist[] = {"code", "globals", "name", + static char *kwlist[] = {"code", "globals", "name", "argdefs", "closure", 0}; if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!|OOO:function", diff --git a/Objects/intobject.c b/Objects/intobject.c index 352210c..b0876ae 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -950,7 +950,7 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; int base = -909; - static const char *kwlist[] = {"x", "base", 0}; + static char *kwlist[] = {"x", "base", 0}; if (type != &PyInt_Type) return int_subtype_new(type, args, kwds); /* Wimp out */ diff --git a/Objects/listobject.c b/Objects/listobject.c index 8b5771b..0ff61e2 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1986,7 +1986,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds) PyObject *keyfunc = NULL; Py_ssize_t i; PyObject *key, *value, *kvpair; - static const char *kwlist[] = {"cmp", "key", "reverse", 0}; + static char *kwlist[] = {"cmp", "key", "reverse", 0}; assert(self != NULL); assert (PyList_Check(self)); @@ -2360,7 +2360,7 @@ static int list_init(PyListObject *self, PyObject *args, PyObject *kw) { PyObject *arg = NULL; - static const char *kwlist[] = {"sequence", 0}; + static char *kwlist[] = {"sequence", 0}; if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:list", kwlist, &arg)) return -1; diff --git a/Objects/longobject.c b/Objects/longobject.c index 17aab35..345d3b4 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -3008,7 +3008,7 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; int base = -909; /* unlikely! */ - static const char *kwlist[] = {"x", "base", 0}; + static char *kwlist[] = {"x", "base", 0}; if (type != &PyLong_Type) return long_subtype_new(type, args, kwds); /* Wimp out */ diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index dfcf39c..8124968 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -149,7 +149,7 @@ _PyModule_Clear(PyObject *m) static int module_init(PyModuleObject *m, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"name", "doc", NULL}; + static char *kwlist[] = {"name", "doc", NULL}; PyObject *dict, *name = Py_None, *doc = Py_None; if (!PyArg_ParseTupleAndKeywords(args, kwds, "S|O:module.__init__", kwlist, &name, &doc)) diff --git a/Objects/object.c b/Objects/object.c index 2a1f45a..606b3fc 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1023,7 +1023,7 @@ PyObject_GetAttrString(PyObject *v, const char *name) PyObject *w, *res; if (v->ob_type->tp_getattr != NULL) - return (*v->ob_type->tp_getattr)(v, name); + return (*v->ob_type->tp_getattr)(v, (char*)name); w = PyString_InternFromString(name); if (w == NULL) return NULL; @@ -1051,7 +1051,7 @@ PyObject_SetAttrString(PyObject *v, const char *name, PyObject *w) int res; if (v->ob_type->tp_setattr != NULL) - return (*v->ob_type->tp_setattr)(v, name, w); + return (*v->ob_type->tp_setattr)(v, (char*)name, w); s = PyString_InternFromString(name); if (s == NULL) return -1; diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 8480308..4fe24a3 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3346,7 +3346,7 @@ static PyObject * string_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; - static const char *kwlist[] = {"object", 0}; + static char *kwlist[] = {"object", 0}; if (type != &PyString_Type) return str_subtype_new(type, args, kwds); diff --git a/Objects/structseq.c b/Objects/structseq.c index b266d6a..218d0b4 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -97,7 +97,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *ob; PyStructSequence *res = NULL; Py_ssize_t len, min_len, max_len, i, n_unnamed_fields; - static const char *kwlist[] = {"sequence", "dict", 0}; + static char *kwlist[] = {"sequence", "dict", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:structseq", kwlist, &arg, &dict)) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 95debbb..c0383a1 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -531,7 +531,7 @@ static PyObject * tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *arg = NULL; - static const char *kwlist[] = {"sequence", 0}; + static char *kwlist[] = {"sequence", 0}; if (type != &PyTuple_Type) return tuple_subtype_new(type, args, kwds); diff --git a/Objects/typeobject.c b/Objects/typeobject.c index fd23bfe..6072c08 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1593,7 +1593,7 @@ static PyObject * type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) { PyObject *name, *bases, *dict; - static const char *kwlist[] = {"name", "bases", "dict", 0}; + static char *kwlist[] = {"name", "bases", "dict", 0}; PyObject *slots, *tmp, *newslots; PyTypeObject *type, *base, *tmptype, *winner; PyHeapTypeObject *et; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d353f1f..3aaf98e 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -7259,7 +7259,7 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *x = NULL; - static const char *kwlist[] = {"string", "encoding", "errors", 0}; + static char *kwlist[] = {"string", "encoding", "errors", 0}; char *encoding = NULL; char *errors = NULL; diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 39c5db2..4a64ef7 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -126,9 +126,9 @@ gc_clear(PyWeakReference *self) static PyObject * weakref_call(PyWeakReference *self, PyObject *args, PyObject *kw) { - static const char *argnames[] = {NULL}; + static char *kwlist[] = {NULL}; - if (PyArg_ParseTupleAndKeywords(args, kw, ":__call__", argnames)) { + if (PyArg_ParseTupleAndKeywords(args, kw, ":__call__", kwlist)) { PyObject *object = PyWeakref_GET_OBJECT(self); Py_INCREF(object); return (object); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 49645181..24c99f4 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1907,7 +1907,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *newlist, *v, *seq, *compare=NULL, *keyfunc=NULL, *newargs; PyObject *callable; - static const char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0}; + static char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0}; int reverse; /* args 1-4 should match listsort in Objects/listobject.c */ diff --git a/Python/getargs.c b/Python/getargs.c index fbf5cef..2af9d88 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -11,9 +11,9 @@ int PyArg_ParseTuple(PyObject *, const char *, ...); int PyArg_VaParse(PyObject *, const char *, va_list); int PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, - const char *, const char **, ...); + const char *, char **, ...); int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, - const char *, const char **, va_list); + const char *, char **, va_list); #define FLAG_COMPAT 1 #define FLAG_SIZE_T 2 @@ -31,7 +31,7 @@ static char *convertsimple(PyObject *, const char **, va_list *, int, char *, static Py_ssize_t convertbuffer(PyObject *, void **p, char **); static int vgetargskeywords(PyObject *, PyObject *, - const char *, const char **, va_list *, int); + const char *, char **, va_list *, int); static char *skipitem(const char **, va_list *, int); int @@ -1141,7 +1141,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, } case 't': { /* 8-bit character buffer, read-only access */ - const char **p = va_arg(*p_va, const char **); + char **p = va_arg(*p_va, char **); PyBufferProcs *pb = arg->ob_type->tp_as_buffer; int count; @@ -1210,7 +1210,7 @@ int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *keywords, const char *format, - const char **kwlist, ...) + char **kwlist, ...) { int retval; va_list va; @@ -1234,7 +1234,7 @@ int _PyArg_ParseTupleAndKeywords_SizeT(PyObject *args, PyObject *keywords, const char *format, - const char **kwlist, ...) + char **kwlist, ...) { int retval; va_list va; @@ -1260,7 +1260,7 @@ int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *keywords, const char *format, - const char **kwlist, va_list va) + char **kwlist, va_list va) { int retval; va_list lva; @@ -1292,7 +1292,7 @@ int _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args, PyObject *keywords, const char *format, - const char **kwlist, va_list va) + char **kwlist, va_list va) { int retval; va_list lva; @@ -1324,7 +1324,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args, static int vgetargskeywords(PyObject *args, PyObject *keywords, const char *format, - const char **kwlist, va_list *p_va, int flags) + char **kwlist, va_list *p_va, int flags) { char msgbuf[512]; int levels[32]; @@ -1332,7 +1332,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format, int min, max; const char *formatsave; int i, len, nargs, nkeywords; - const char *msg, **p; + const char *msg; + char **p; PyObject *freelist = NULL; assert(args != NULL && PyTuple_Check(args)); -- cgit v0.12