Revert backwards-incompatible const changes.

This commit is contained in:
Martin v. Löwis 2006-02-27 16:46:16 +00:00
parent f9f61b4aa2
commit 15e62742fa
36 changed files with 71 additions and 70 deletions

View File

@ -24,14 +24,14 @@ extern "C" {
PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, 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(int) PyArg_UnpackTuple(PyObject *, const char *, int, int, ...);
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, 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(PyObject *) Py_VaBuildValue(const char *, va_list);
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);

View File

@ -144,12 +144,12 @@ typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
typedef int (*getreadbufferproc)(PyObject *, int, void **); typedef int (*getreadbufferproc)(PyObject *, int, void **);
typedef int (*getwritebufferproc)(PyObject *, int, void **); typedef int (*getwritebufferproc)(PyObject *, int, void **);
typedef int (*getsegcountproc)(PyObject *, int *); typedef int (*getsegcountproc)(PyObject *, int *);
typedef int (*getcharbufferproc)(PyObject *, int, const char **); typedef int (*getcharbufferproc)(PyObject *, int, char **);
/* ssize_t-based buffer interface */ /* ssize_t-based buffer interface */
typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **); typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
typedef Py_ssize_t (*writebufferproc)(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 (*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 (*objobjproc)(PyObject *, PyObject *);
typedef int (*visitproc)(PyObject *, void *); typedef int (*visitproc)(PyObject *, void *);
@ -239,9 +239,9 @@ typedef struct {
typedef void (*freefunc)(void *); typedef void (*freefunc)(void *);
typedef void (*destructor)(PyObject *); typedef void (*destructor)(PyObject *);
typedef int (*printfunc)(PyObject *, FILE *, int); typedef int (*printfunc)(PyObject *, FILE *, int);
typedef PyObject *(*getattrfunc)(PyObject *, const char *); typedef PyObject *(*getattrfunc)(PyObject *, char *);
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); 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 (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef int (*cmpfunc)(PyObject *, PyObject *); typedef int (*cmpfunc)(PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *); typedef PyObject *(*reprfunc)(PyObject *);

View File

@ -1886,7 +1886,7 @@ PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds)
int err; int err;
char* termstr = NULL; char* termstr = NULL;
static const char *kwlist[] = {"term", "fd", NULL}; static char *kwlist[] = {"term", "fd", NULL};
if (!PyArg_ParseTupleAndKeywords( if (!PyArg_ParseTupleAndKeywords(
args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) { args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) {

View File

@ -234,7 +234,7 @@ EVP_repr(PyObject *self)
static int static int
EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) 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; PyObject *name_obj = NULL;
char *nameStr; char *nameStr;
unsigned char *cp = NULL; unsigned char *cp = NULL;
@ -370,7 +370,7 @@ The MD5 and SHA1 algorithms are always supported.\n");
static PyObject * static PyObject *
EVP_new(PyObject *self, PyObject *args, PyObject *kwdict) 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; PyObject *name_obj = NULL;
char *name; char *name;
const EVP_MD *digest; const EVP_MD *digest;

View File

@ -675,7 +675,7 @@ profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds)
{ {
int subcalls = -1; int subcalls = -1;
int builtins = -1; int builtins = -1;
static const char *kwlist[] = {"subcalls", "builtins", 0}; static char *kwlist[] = {"subcalls", "builtins", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:enable", if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:enable",
kwlist, &subcalls, &builtins)) kwlist, &subcalls, &builtins))
return NULL; return NULL;
@ -758,7 +758,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
#else #else
int builtins = 0; int builtins = 0;
#endif #endif
static const char *kwlist[] = {"timer", "timeunit", static char *kwlist[] = {"timer", "timeunit",
"subcalls", "builtins", 0}; "subcalls", "builtins", 0};
if (!PyArg_ParseTupleAndKeywords(args, kw, "|Odii:Profiler", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kw, "|Odii:Profiler", kwlist,

View File

@ -2010,7 +2010,7 @@ pattern_match(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* string; PyObject* string;
int start = 0; int start = 0;
int end = INT_MAX; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:match", kwlist,
&string, &start, &end)) &string, &start, &end))
return NULL; return NULL;
@ -2047,7 +2047,7 @@ pattern_search(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* string; PyObject* string;
int start = 0; int start = 0;
int end = INT_MAX; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:search", kwlist,
&string, &start, &end)) &string, &start, &end))
return NULL; return NULL;
@ -2188,7 +2188,7 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* string; PyObject* string;
int start = 0; int start = 0;
int end = INT_MAX; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:findall", kwlist,
&string, &start, &end)) &string, &start, &end))
return NULL; return NULL;
@ -2314,7 +2314,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* string; PyObject* string;
int maxsplit = 0; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "O|i:split", kwlist,
&string, &maxsplit)) &string, &maxsplit))
return NULL; return NULL;
@ -2598,7 +2598,7 @@ pattern_sub(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* template; PyObject* template;
PyObject* string; PyObject* string;
int count = 0; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:sub", kwlist,
&template, &string, &count)) &template, &string, &count))
return NULL; return NULL;
@ -2612,7 +2612,7 @@ pattern_subn(PatternObject* self, PyObject* args, PyObject* kw)
PyObject* template; PyObject* template;
PyObject* string; PyObject* string;
int count = 0; 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, if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:subn", kwlist,
&template, &string, &count)) &template, &string, &count))
return NULL; return NULL;
@ -2919,7 +2919,7 @@ match_groups(MatchObject* self, PyObject* args, PyObject* kw)
int index; int index;
PyObject* def = Py_None; PyObject* def = Py_None;
static const char* kwlist[] = { "default", NULL }; static char* kwlist[] = { "default", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groups", kwlist, &def)) if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groups", kwlist, &def))
return NULL; return NULL;
@ -2948,7 +2948,7 @@ match_groupdict(MatchObject* self, PyObject* args, PyObject* kw)
int index; int index;
PyObject* def = Py_None; PyObject* def = Py_None;
static const char* kwlist[] = { "default", NULL }; static char* kwlist[] = { "default", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groupdict", kwlist, &def)) if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groupdict", kwlist, &def))
return NULL; return NULL;

View File

@ -1032,7 +1032,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
unsigned char *data, *odata; unsigned char *data, *odata;
unsigned int datalen = 0; unsigned int datalen = 0;
PyObject *rv; PyObject *rv;
static const char *kwlist[] = {"data", "header", NULL}; static char *kwlist[] = {"data", "header", NULL};
int header = 0; int header = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", kwlist, &data, 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; unsigned int datalen = 0, odatalen = 0;
PyObject *rv; PyObject *rv;
unsigned int linelen = 0; unsigned int linelen = 0;
static const char *kwlist[] = {"data", "quotetabs", "istext", static char *kwlist[] = {"data", "quotetabs", "istext",
"header", NULL}; "header", NULL};
int istext = 1; int istext = 1;
int quotetabs = 0; int quotetabs = 0;

View File

@ -1275,7 +1275,7 @@ static PyMemberDef BZ2File_members[] = {
static int static int
BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs) BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
{ {
static const char *kwlist[] = {"filename", "mode", "buffering", static char *kwlist[] = {"filename", "mode", "buffering",
"compresslevel", 0}; "compresslevel", 0};
PyObject *name; PyObject *name;
char *mode = "r"; char *mode = "r";
@ -1664,7 +1664,7 @@ BZ2Comp_init(BZ2CompObject *self, PyObject *args, PyObject *kwargs)
{ {
int compresslevel = 9; int compresslevel = 9;
int bzerror; int bzerror;
static const char *kwlist[] = {"compresslevel", 0}; static char *kwlist[] = {"compresslevel", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:BZ2Compressor", if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:BZ2Compressor",
kwlist, &compresslevel)) kwlist, &compresslevel))
@ -2009,7 +2009,7 @@ bz2_compress(PyObject *self, PyObject *args, PyObject *kwargs)
bz_stream _bzs; bz_stream _bzs;
bz_stream *bzs = &_bzs; bz_stream *bzs = &_bzs;
int bzerror; int bzerror;
static const char *kwlist[] = {"data", "compresslevel", 0}; static char *kwlist[] = {"data", "compresslevel", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i",
kwlist, &data, &datasize, kwlist, &data, &datasize,

View File

@ -2868,7 +2868,7 @@ newPicklerobject(PyObject *file, int proto)
static PyObject * static PyObject *
get_Pickler(PyObject *self, PyObject *args, PyObject *kwds) get_Pickler(PyObject *self, PyObject *args, PyObject *kwds)
{ {
static const char *kwlist[] = {"file", "protocol", NULL}; static char *kwlist[] = {"file", "protocol", NULL};
PyObject *file = NULL; PyObject *file = NULL;
int proto = 0; int proto = 0;
@ -5388,7 +5388,7 @@ Unpickler_setattr(Unpicklerobject *self, char *name, PyObject *value)
static PyObject * static PyObject *
cpm_dump(PyObject *self, PyObject *args, PyObject *kwds) 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; PyObject *ob, *file, *res = NULL;
Picklerobject *pickler = 0; Picklerobject *pickler = 0;
int proto = 0; int proto = 0;
@ -5417,7 +5417,7 @@ cpm_dump(PyObject *self, PyObject *args, PyObject *kwds)
static PyObject * static PyObject *
cpm_dumps(PyObject *self, PyObject *args, PyObject *kwds) 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; PyObject *ob, *file = 0, *res = NULL;
Picklerobject *pickler = 0; Picklerobject *pickler = 0;
int proto = 0; int proto = 0;

View File

@ -160,7 +160,7 @@ nis_match (PyObject *self, PyObject *args, PyObject *kwdict)
int err; int err;
PyObject *res; PyObject *res;
int fix; int fix;
static const char *kwlist[] = {"key", "map", "domain", NULL}; static char *kwlist[] = {"key", "map", "domain", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwdict, if (!PyArg_ParseTupleAndKeywords(args, kwdict,
"t#s|s:match", kwlist, "t#s|s:match", kwlist,
@ -192,7 +192,7 @@ nis_cat (PyObject *self, PyObject *args, PyObject *kwdict)
struct ypcallback_data data; struct ypcallback_data data;
PyObject *dict; PyObject *dict;
int err; int err;
static const char *kwlist[] = {"map", "domain", NULL}; static char *kwlist[] = {"map", "domain", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwdict, "s|s:cat", if (!PyArg_ParseTupleAndKeywords(args, kwdict, "s|s:cat",
kwlist, &map, &domain)) kwlist, &map, &domain))
@ -383,7 +383,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
nismaplist *maps; nismaplist *maps;
PyObject *list; PyObject *list;
int err; int err;
static const char *kwlist[] = {"domain", NULL}; static char *kwlist[] = {"domain", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwdict, if (!PyArg_ParseTupleAndKeywords(args, kwdict,
"|s:maps", kwlist, &domain)) "|s:maps", kwlist, &domain))

View File

@ -1726,7 +1726,7 @@ pyexpat_ParserCreate(PyObject *notused, PyObject *args, PyObject *kw)
PyObject *intern = NULL; PyObject *intern = NULL;
PyObject *result; PyObject *result;
int intern_decref = 0; int intern_decref = 0;
static const char *kwlist[] = {"encoding", "namespace_separator", static char *kwlist[] = {"encoding", "namespace_separator",
"intern", NULL}; "intern", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "|zzO:ParserCreate", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kw, "|zzO:ParserCreate", kwlist,

View File

@ -624,7 +624,7 @@ PyDoc_STRVAR(SHA256_new__doc__,
static PyObject * static PyObject *
SHA256_new(PyObject *self, PyObject *args, PyObject *kwdict) SHA256_new(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
static const char *kwlist[] = {"string", NULL}; static char *kwlist[] = {"string", NULL};
SHAobject *new; SHAobject *new;
unsigned char *cp = NULL; unsigned char *cp = NULL;
int len; int len;
@ -655,7 +655,7 @@ PyDoc_STRVAR(SHA224_new__doc__,
static PyObject * static PyObject *
SHA224_new(PyObject *self, PyObject *args, PyObject *kwdict) SHA224_new(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
static const char *kwlist[] = {"string", NULL}; static char *kwlist[] = {"string", NULL};
SHAobject *new; SHAobject *new;
unsigned char *cp = NULL; unsigned char *cp = NULL;
int len; int len;

View File

@ -690,7 +690,7 @@ PyDoc_STRVAR(SHA512_new__doc__,
static PyObject * static PyObject *
SHA512_new(PyObject *self, PyObject *args, PyObject *kwdict) SHA512_new(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
static const char *kwlist[] = {"string", NULL}; static char *kwlist[] = {"string", NULL};
SHAobject *new; SHAobject *new;
unsigned char *cp = NULL; unsigned char *cp = NULL;
int len; int len;
@ -721,7 +721,7 @@ PyDoc_STRVAR(SHA384_new__doc__,
static PyObject * static PyObject *
SHA384_new(PyObject *self, PyObject *args, PyObject *kwdict) SHA384_new(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
static const char *kwlist[] = {"string", NULL}; static char *kwlist[] = {"string", NULL};
SHAobject *new; SHAobject *new;
unsigned char *cp = NULL; unsigned char *cp = NULL;
int len; int len;

View File

@ -543,7 +543,7 @@ hashed.");
static PyObject * static PyObject *
SHA_new(PyObject *self, PyObject *args, PyObject *kwdict) SHA_new(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
static const char *kwlist[] = {"string", NULL}; static char *kwlist[] = {"string", NULL};
SHAobject *new; SHAobject *new;
unsigned char *cp = NULL; unsigned char *cp = NULL;
int len; int len;

View File

@ -221,7 +221,7 @@ int PyObject_AsCharBuffer(PyObject *obj,
Py_ssize_t *buffer_len) Py_ssize_t *buffer_len)
{ {
PyBufferProcs *pb; PyBufferProcs *pb;
const char *pp; char *pp;
Py_ssize_t len; Py_ssize_t len;
if (obj == NULL || buffer == NULL || buffer_len == NULL) { if (obj == NULL || buffer == NULL || buffer_len == NULL) {

View File

@ -50,7 +50,7 @@ PyObject *PyBool_FromLong(long ok)
static PyObject * static PyObject *
bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds) bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
static const char *kwlist[] = {"x", 0}; static char *kwlist[] = {"x", 0};
PyObject *x = Py_False; PyObject *x = Py_False;
long ok; long ok;

View File

@ -159,7 +159,7 @@ static PyObject *
class_new(PyTypeObject *type, PyObject *args, PyObject *kwds) class_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *name, *bases, *dict; 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, if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO", kwlist,
&name, &bases, &dict)) &name, &bases, &dict))

View File

@ -829,7 +829,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_complex cr, ci; Py_complex cr, ci;
int own_r = 0; int own_r = 0;
static PyObject *complexstr; static PyObject *complexstr;
static const char *kwlist[] = {"real", "imag", 0}; static char *kwlist[] = {"real", "imag", 0};
r = Py_False; r = Py_False;
i = NULL; i = NULL;

View File

@ -1182,7 +1182,7 @@ static int
property_init(PyObject *self, PyObject *args, PyObject *kwds) property_init(PyObject *self, PyObject *args, PyObject *kwds)
{ {
PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL; 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; propertyobject *gs = (propertyobject *)self;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOOO:property", if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOOO:property",

View File

@ -16,7 +16,7 @@ enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
enumobject *en; enumobject *en;
PyObject *seq = NULL; PyObject *seq = NULL;
static const char *kwlist[] = {"sequence", 0}; static char *kwlist[] = {"sequence", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:enumerate", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:enumerate", kwlist,
&seq)) &seq))

View File

@ -1925,7 +1925,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds)
{ {
PyFileObject *foself = (PyFileObject *)self; PyFileObject *foself = (PyFileObject *)self;
int ret = 0; int ret = 0;
static const char *kwlist[] = {"name", "mode", "buffering", 0}; static char *kwlist[] = {"name", "mode", "buffering", 0};
char *name = NULL; char *name = NULL;
char *mode = "r"; char *mode = "r";
int bufsize = -1; int bufsize = -1;

View File

@ -940,7 +940,7 @@ static PyObject *
float_new(PyTypeObject *type, PyObject *args, PyObject *kwds) float_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *x = Py_False; /* Integer zero */ PyObject *x = Py_False; /* Integer zero */
static const char *kwlist[] = {"x", 0}; static char *kwlist[] = {"x", 0};
if (type != &PyFloat_Type) if (type != &PyFloat_Type)
return float_subtype_new(type, args, kwds); /* Wimp out */ return float_subtype_new(type, args, kwds); /* Wimp out */

View File

@ -364,7 +364,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
PyObject *closure = Py_None; PyObject *closure = Py_None;
PyFunctionObject *newfunc; PyFunctionObject *newfunc;
Py_ssize_t nfree, nclosure; Py_ssize_t nfree, nclosure;
static const char *kwlist[] = {"code", "globals", "name", static char *kwlist[] = {"code", "globals", "name",
"argdefs", "closure", 0}; "argdefs", "closure", 0};
if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!|OOO:function", if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!|OOO:function",

View File

@ -950,7 +950,7 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *x = NULL; PyObject *x = NULL;
int base = -909; int base = -909;
static const char *kwlist[] = {"x", "base", 0}; static char *kwlist[] = {"x", "base", 0};
if (type != &PyInt_Type) if (type != &PyInt_Type)
return int_subtype_new(type, args, kwds); /* Wimp out */ return int_subtype_new(type, args, kwds); /* Wimp out */

View File

@ -1986,7 +1986,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
PyObject *keyfunc = NULL; PyObject *keyfunc = NULL;
Py_ssize_t i; Py_ssize_t i;
PyObject *key, *value, *kvpair; PyObject *key, *value, *kvpair;
static const char *kwlist[] = {"cmp", "key", "reverse", 0}; static char *kwlist[] = {"cmp", "key", "reverse", 0};
assert(self != NULL); assert(self != NULL);
assert (PyList_Check(self)); assert (PyList_Check(self));
@ -2360,7 +2360,7 @@ static int
list_init(PyListObject *self, PyObject *args, PyObject *kw) list_init(PyListObject *self, PyObject *args, PyObject *kw)
{ {
PyObject *arg = NULL; PyObject *arg = NULL;
static const char *kwlist[] = {"sequence", 0}; static char *kwlist[] = {"sequence", 0};
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:list", kwlist, &arg)) if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:list", kwlist, &arg))
return -1; return -1;

View File

@ -3008,7 +3008,7 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *x = NULL; PyObject *x = NULL;
int base = -909; /* unlikely! */ int base = -909; /* unlikely! */
static const char *kwlist[] = {"x", "base", 0}; static char *kwlist[] = {"x", "base", 0};
if (type != &PyLong_Type) if (type != &PyLong_Type)
return long_subtype_new(type, args, kwds); /* Wimp out */ return long_subtype_new(type, args, kwds); /* Wimp out */

View File

@ -149,7 +149,7 @@ _PyModule_Clear(PyObject *m)
static int static int
module_init(PyModuleObject *m, PyObject *args, PyObject *kwds) 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; PyObject *dict, *name = Py_None, *doc = Py_None;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "S|O:module.__init__", if (!PyArg_ParseTupleAndKeywords(args, kwds, "S|O:module.__init__",
kwlist, &name, &doc)) kwlist, &name, &doc))

View File

@ -1023,7 +1023,7 @@ PyObject_GetAttrString(PyObject *v, const char *name)
PyObject *w, *res; PyObject *w, *res;
if (v->ob_type->tp_getattr != NULL) 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); w = PyString_InternFromString(name);
if (w == NULL) if (w == NULL)
return NULL; return NULL;
@ -1051,7 +1051,7 @@ PyObject_SetAttrString(PyObject *v, const char *name, PyObject *w)
int res; int res;
if (v->ob_type->tp_setattr != NULL) 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); s = PyString_InternFromString(name);
if (s == NULL) if (s == NULL)
return -1; return -1;

View File

@ -3346,7 +3346,7 @@ static PyObject *
string_new(PyTypeObject *type, PyObject *args, PyObject *kwds) string_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *x = NULL; PyObject *x = NULL;
static const char *kwlist[] = {"object", 0}; static char *kwlist[] = {"object", 0};
if (type != &PyString_Type) if (type != &PyString_Type)
return str_subtype_new(type, args, kwds); return str_subtype_new(type, args, kwds);

View File

@ -97,7 +97,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *ob; PyObject *ob;
PyStructSequence *res = NULL; PyStructSequence *res = NULL;
Py_ssize_t len, min_len, max_len, i, n_unnamed_fields; 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", if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:structseq",
kwlist, &arg, &dict)) kwlist, &arg, &dict))

View File

@ -531,7 +531,7 @@ static PyObject *
tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds) tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *arg = NULL; PyObject *arg = NULL;
static const char *kwlist[] = {"sequence", 0}; static char *kwlist[] = {"sequence", 0};
if (type != &PyTuple_Type) if (type != &PyTuple_Type)
return tuple_subtype_new(type, args, kwds); return tuple_subtype_new(type, args, kwds);

View File

@ -1593,7 +1593,7 @@ static PyObject *
type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
{ {
PyObject *name, *bases, *dict; PyObject *name, *bases, *dict;
static const char *kwlist[] = {"name", "bases", "dict", 0}; static char *kwlist[] = {"name", "bases", "dict", 0};
PyObject *slots, *tmp, *newslots; PyObject *slots, *tmp, *newslots;
PyTypeObject *type, *base, *tmptype, *winner; PyTypeObject *type, *base, *tmptype, *winner;
PyHeapTypeObject *et; PyHeapTypeObject *et;

View File

@ -7259,7 +7259,7 @@ static PyObject *
unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
PyObject *x = NULL; PyObject *x = NULL;
static const char *kwlist[] = {"string", "encoding", "errors", 0}; static char *kwlist[] = {"string", "encoding", "errors", 0};
char *encoding = NULL; char *encoding = NULL;
char *errors = NULL; char *errors = NULL;

View File

@ -126,9 +126,9 @@ gc_clear(PyWeakReference *self)
static PyObject * static PyObject *
weakref_call(PyWeakReference *self, PyObject *args, PyObject *kw) 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); PyObject *object = PyWeakref_GET_OBJECT(self);
Py_INCREF(object); Py_INCREF(object);
return (object); return (object);

View File

@ -1907,7 +1907,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
{ {
PyObject *newlist, *v, *seq, *compare=NULL, *keyfunc=NULL, *newargs; PyObject *newlist, *v, *seq, *compare=NULL, *keyfunc=NULL, *newargs;
PyObject *callable; PyObject *callable;
static const char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0}; static char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0};
int reverse; int reverse;
/* args 1-4 should match listsort in Objects/listobject.c */ /* args 1-4 should match listsort in Objects/listobject.c */

View File

@ -11,9 +11,9 @@ int PyArg_ParseTuple(PyObject *, const char *, ...);
int PyArg_VaParse(PyObject *, const char *, va_list); int PyArg_VaParse(PyObject *, const char *, va_list);
int PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, int PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
const char *, const char **, ...); const char *, char **, ...);
int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
const char *, const char **, va_list); const char *, char **, va_list);
#define FLAG_COMPAT 1 #define FLAG_COMPAT 1
#define FLAG_SIZE_T 2 #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 Py_ssize_t convertbuffer(PyObject *, void **p, char **);
static int vgetargskeywords(PyObject *, PyObject *, 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); static char *skipitem(const char **, va_list *, int);
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 */ 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; PyBufferProcs *pb = arg->ob_type->tp_as_buffer;
int count; int count;
@ -1210,7 +1210,7 @@ int
PyArg_ParseTupleAndKeywords(PyObject *args, PyArg_ParseTupleAndKeywords(PyObject *args,
PyObject *keywords, PyObject *keywords,
const char *format, const char *format,
const char **kwlist, ...) char **kwlist, ...)
{ {
int retval; int retval;
va_list va; va_list va;
@ -1234,7 +1234,7 @@ int
_PyArg_ParseTupleAndKeywords_SizeT(PyObject *args, _PyArg_ParseTupleAndKeywords_SizeT(PyObject *args,
PyObject *keywords, PyObject *keywords,
const char *format, const char *format,
const char **kwlist, ...) char **kwlist, ...)
{ {
int retval; int retval;
va_list va; va_list va;
@ -1260,7 +1260,7 @@ int
PyArg_VaParseTupleAndKeywords(PyObject *args, PyArg_VaParseTupleAndKeywords(PyObject *args,
PyObject *keywords, PyObject *keywords,
const char *format, const char *format,
const char **kwlist, va_list va) char **kwlist, va_list va)
{ {
int retval; int retval;
va_list lva; va_list lva;
@ -1292,7 +1292,7 @@ int
_PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args, _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
PyObject *keywords, PyObject *keywords,
const char *format, const char *format,
const char **kwlist, va_list va) char **kwlist, va_list va)
{ {
int retval; int retval;
va_list lva; va_list lva;
@ -1324,7 +1324,7 @@ _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *args,
static int static int
vgetargskeywords(PyObject *args, PyObject *keywords, const char *format, 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]; char msgbuf[512];
int levels[32]; int levels[32];
@ -1332,7 +1332,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
int min, max; int min, max;
const char *formatsave; const char *formatsave;
int i, len, nargs, nkeywords; int i, len, nargs, nkeywords;
const char *msg, **p; const char *msg;
char **p;
PyObject *freelist = NULL; PyObject *freelist = NULL;
assert(args != NULL && PyTuple_Check(args)); assert(args != NULL && PyTuple_Check(args));