Skip to content

Commit a61ffb2

Browse files
author
martin.v.loewis
committed
Revert backwards-incompatible const changes.
git-svn-id: http://svn.python.org/projects/python/trunk@42596 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 83e5f06 commit a61ffb2

36 files changed

Lines changed: 71 additions & 70 deletions

Include/modsupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ extern "C" {
2424
PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
2525
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
2626
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
27-
const char *, const char **, ...);
27+
const char *, char **, ...);
2828
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, int, int, ...);
2929
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
3030
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
3131

3232
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
3333
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
34-
const char *, const char **, va_list);
34+
const char *, char **, va_list);
3535
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
3636

3737
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);

Include/object.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
144144
typedef int (*getreadbufferproc)(PyObject *, int, void **);
145145
typedef int (*getwritebufferproc)(PyObject *, int, void **);
146146
typedef int (*getsegcountproc)(PyObject *, int *);
147-
typedef int (*getcharbufferproc)(PyObject *, int, const char **);
147+
typedef int (*getcharbufferproc)(PyObject *, int, char **);
148148
/* ssize_t-based buffer interface */
149149
typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
150150
typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
151151
typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);
152-
typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, const char **);
152+
typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
153153

154154
typedef int (*objobjproc)(PyObject *, PyObject *);
155155
typedef int (*visitproc)(PyObject *, void *);
@@ -239,9 +239,9 @@ typedef struct {
239239
typedef void (*freefunc)(void *);
240240
typedef void (*destructor)(PyObject *);
241241
typedef int (*printfunc)(PyObject *, FILE *, int);
242-
typedef PyObject *(*getattrfunc)(PyObject *, const char *);
242+
typedef PyObject *(*getattrfunc)(PyObject *, char *);
243243
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
244-
typedef int (*setattrfunc)(PyObject *, const char *, PyObject *);
244+
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
245245
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
246246
typedef int (*cmpfunc)(PyObject *, PyObject *);
247247
typedef PyObject *(*reprfunc)(PyObject *);

Modules/_cursesmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,7 @@ PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds)
18861886
int err;
18871887
char* termstr = NULL;
18881888

1889-
static const char *kwlist[] = {"term", "fd", NULL};
1889+
static char *kwlist[] = {"term", "fd", NULL};
18901890

18911891
if (!PyArg_ParseTupleAndKeywords(
18921892
args, keywds, "|zi:setupterm", kwlist, &termstr, &fd)) {

Modules/_hashopenssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ EVP_repr(PyObject *self)
234234
static int
235235
EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
236236
{
237-
static const char *kwlist[] = {"name", "string", NULL};
237+
static char *kwlist[] = {"name", "string", NULL};
238238
PyObject *name_obj = NULL;
239239
char *nameStr;
240240
unsigned char *cp = NULL;
@@ -370,7 +370,7 @@ The MD5 and SHA1 algorithms are always supported.\n");
370370
static PyObject *
371371
EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
372372
{
373-
static const char *kwlist[] = {"name", "string", NULL};
373+
static char *kwlist[] = {"name", "string", NULL};
374374
PyObject *name_obj = NULL;
375375
char *name;
376376
const EVP_MD *digest;

Modules/_lsprof.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds)
675675
{
676676
int subcalls = -1;
677677
int builtins = -1;
678-
static const char *kwlist[] = {"subcalls", "builtins", 0};
678+
static char *kwlist[] = {"subcalls", "builtins", 0};
679679
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:enable",
680680
kwlist, &subcalls, &builtins))
681681
return NULL;
@@ -758,7 +758,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
758758
#else
759759
int builtins = 0;
760760
#endif
761-
static const char *kwlist[] = {"timer", "timeunit",
761+
static char *kwlist[] = {"timer", "timeunit",
762762
"subcalls", "builtins", 0};
763763

764764
if (!PyArg_ParseTupleAndKeywords(args, kw, "|Odii:Profiler", kwlist,

Modules/_sre.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ pattern_match(PatternObject* self, PyObject* args, PyObject* kw)
20102010
PyObject* string;
20112011
int start = 0;
20122012
int end = INT_MAX;
2013-
static const char* kwlist[] = { "pattern", "pos", "endpos", NULL };
2013+
static char* kwlist[] = { "pattern", "pos", "endpos", NULL };
20142014
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:match", kwlist,
20152015
&string, &start, &end))
20162016
return NULL;
@@ -2047,7 +2047,7 @@ pattern_search(PatternObject* self, PyObject* args, PyObject* kw)
20472047
PyObject* string;
20482048
int start = 0;
20492049
int end = INT_MAX;
2050-
static const char* kwlist[] = { "pattern", "pos", "endpos", NULL };
2050+
static char* kwlist[] = { "pattern", "pos", "endpos", NULL };
20512051
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:search", kwlist,
20522052
&string, &start, &end))
20532053
return NULL;
@@ -2188,7 +2188,7 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
21882188
PyObject* string;
21892189
int start = 0;
21902190
int end = INT_MAX;
2191-
static const char* kwlist[] = { "source", "pos", "endpos", NULL };
2191+
static char* kwlist[] = { "source", "pos", "endpos", NULL };
21922192
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:findall", kwlist,
21932193
&string, &start, &end))
21942194
return NULL;
@@ -2314,7 +2314,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
23142314

23152315
PyObject* string;
23162316
int maxsplit = 0;
2317-
static const char* kwlist[] = { "source", "maxsplit", NULL };
2317+
static char* kwlist[] = { "source", "maxsplit", NULL };
23182318
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|i:split", kwlist,
23192319
&string, &maxsplit))
23202320
return NULL;
@@ -2598,7 +2598,7 @@ pattern_sub(PatternObject* self, PyObject* args, PyObject* kw)
25982598
PyObject* template;
25992599
PyObject* string;
26002600
int count = 0;
2601-
static const char* kwlist[] = { "repl", "string", "count", NULL };
2601+
static char* kwlist[] = { "repl", "string", "count", NULL };
26022602
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:sub", kwlist,
26032603
&template, &string, &count))
26042604
return NULL;
@@ -2612,7 +2612,7 @@ pattern_subn(PatternObject* self, PyObject* args, PyObject* kw)
26122612
PyObject* template;
26132613
PyObject* string;
26142614
int count = 0;
2615-
static const char* kwlist[] = { "repl", "string", "count", NULL };
2615+
static char* kwlist[] = { "repl", "string", "count", NULL };
26162616
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|i:subn", kwlist,
26172617
&template, &string, &count))
26182618
return NULL;
@@ -2919,7 +2919,7 @@ match_groups(MatchObject* self, PyObject* args, PyObject* kw)
29192919
int index;
29202920

29212921
PyObject* def = Py_None;
2922-
static const char* kwlist[] = { "default", NULL };
2922+
static char* kwlist[] = { "default", NULL };
29232923
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groups", kwlist, &def))
29242924
return NULL;
29252925

@@ -2948,7 +2948,7 @@ match_groupdict(MatchObject* self, PyObject* args, PyObject* kw)
29482948
int index;
29492949

29502950
PyObject* def = Py_None;
2951-
static const char* kwlist[] = { "default", NULL };
2951+
static char* kwlist[] = { "default", NULL };
29522952
if (!PyArg_ParseTupleAndKeywords(args, kw, "|O:groupdict", kwlist, &def))
29532953
return NULL;
29542954

Modules/binascii.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
10321032
unsigned char *data, *odata;
10331033
unsigned int datalen = 0;
10341034
PyObject *rv;
1035-
static const char *kwlist[] = {"data", "header", NULL};
1035+
static char *kwlist[] = {"data", "header", NULL};
10361036
int header = 0;
10371037

10381038
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i", kwlist, &data,
@@ -1133,7 +1133,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
11331133
unsigned int datalen = 0, odatalen = 0;
11341134
PyObject *rv;
11351135
unsigned int linelen = 0;
1136-
static const char *kwlist[] = {"data", "quotetabs", "istext",
1136+
static char *kwlist[] = {"data", "quotetabs", "istext",
11371137
"header", NULL};
11381138
int istext = 1;
11391139
int quotetabs = 0;

Modules/bz2module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ static PyMemberDef BZ2File_members[] = {
12751275
static int
12761276
BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
12771277
{
1278-
static const char *kwlist[] = {"filename", "mode", "buffering",
1278+
static char *kwlist[] = {"filename", "mode", "buffering",
12791279
"compresslevel", 0};
12801280
PyObject *name;
12811281
char *mode = "r";
@@ -1664,7 +1664,7 @@ BZ2Comp_init(BZ2CompObject *self, PyObject *args, PyObject *kwargs)
16641664
{
16651665
int compresslevel = 9;
16661666
int bzerror;
1667-
static const char *kwlist[] = {"compresslevel", 0};
1667+
static char *kwlist[] = {"compresslevel", 0};
16681668

16691669
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:BZ2Compressor",
16701670
kwlist, &compresslevel))
@@ -2009,7 +2009,7 @@ bz2_compress(PyObject *self, PyObject *args, PyObject *kwargs)
20092009
bz_stream _bzs;
20102010
bz_stream *bzs = &_bzs;
20112011
int bzerror;
2012-
static const char *kwlist[] = {"data", "compresslevel", 0};
2012+
static char *kwlist[] = {"data", "compresslevel", 0};
20132013

20142014
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|i",
20152015
kwlist, &data, &datasize,

Modules/cPickle.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,7 @@ newPicklerobject(PyObject *file, int proto)
28682868
static PyObject *
28692869
get_Pickler(PyObject *self, PyObject *args, PyObject *kwds)
28702870
{
2871-
static const char *kwlist[] = {"file", "protocol", NULL};
2871+
static char *kwlist[] = {"file", "protocol", NULL};
28722872
PyObject *file = NULL;
28732873
int proto = 0;
28742874

@@ -5388,7 +5388,7 @@ Unpickler_setattr(Unpicklerobject *self, char *name, PyObject *value)
53885388
static PyObject *
53895389
cpm_dump(PyObject *self, PyObject *args, PyObject *kwds)
53905390
{
5391-
static const char *kwlist[] = {"obj", "file", "protocol", NULL};
5391+
static char *kwlist[] = {"obj", "file", "protocol", NULL};
53925392
PyObject *ob, *file, *res = NULL;
53935393
Picklerobject *pickler = 0;
53945394
int proto = 0;
@@ -5417,7 +5417,7 @@ cpm_dump(PyObject *self, PyObject *args, PyObject *kwds)
54175417
static PyObject *
54185418
cpm_dumps(PyObject *self, PyObject *args, PyObject *kwds)
54195419
{
5420-
static const char *kwlist[] = {"obj", "protocol", NULL};
5420+
static char *kwlist[] = {"obj", "protocol", NULL};
54215421
PyObject *ob, *file = 0, *res = NULL;
54225422
Picklerobject *pickler = 0;
54235423
int proto = 0;

Modules/nismodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ nis_match (PyObject *self, PyObject *args, PyObject *kwdict)
160160
int err;
161161
PyObject *res;
162162
int fix;
163-
static const char *kwlist[] = {"key", "map", "domain", NULL};
163+
static char *kwlist[] = {"key", "map", "domain", NULL};
164164

165165
if (!PyArg_ParseTupleAndKeywords(args, kwdict,
166166
"t#s|s:match", kwlist,
@@ -192,7 +192,7 @@ nis_cat (PyObject *self, PyObject *args, PyObject *kwdict)
192192
struct ypcallback_data data;
193193
PyObject *dict;
194194
int err;
195-
static const char *kwlist[] = {"map", "domain", NULL};
195+
static char *kwlist[] = {"map", "domain", NULL};
196196

197197
if (!PyArg_ParseTupleAndKeywords(args, kwdict, "s|s:cat",
198198
kwlist, &map, &domain))
@@ -383,7 +383,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
383383
nismaplist *maps;
384384
PyObject *list;
385385
int err;
386-
static const char *kwlist[] = {"domain", NULL};
386+
static char *kwlist[] = {"domain", NULL};
387387

388388
if (!PyArg_ParseTupleAndKeywords(args, kwdict,
389389
"|s:maps", kwlist, &domain))

0 commit comments

Comments
 (0)