mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Revert backwards-incompatible const changes.
This commit is contained in:
parent
f9f61b4aa2
commit
15e62742fa
36 changed files with 71 additions and 70 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue