Commit 02cbf4ae authored by Martin v. Löwis's avatar Martin v. Löwis

More unconsting.

parent f4e6928c
...@@ -40,7 +40,7 @@ bisect_right(PyObject *self, PyObject *args, PyObject *kw) ...@@ -40,7 +40,7 @@ bisect_right(PyObject *self, PyObject *args, PyObject *kw)
int lo = 0; int lo = 0;
int hi = -1; int hi = -1;
int index; int index;
static const char *keywords[] = {"a", "x", "lo", "hi", NULL}; static char *keywords[] = {"a", "x", "lo", "hi", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:bisect_right", if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:bisect_right",
keywords, &list, &item, &lo, &hi)) keywords, &list, &item, &lo, &hi))
...@@ -70,7 +70,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw) ...@@ -70,7 +70,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
int lo = 0; int lo = 0;
int hi = -1; int hi = -1;
int index; int index;
static const char *keywords[] = {"a", "x", "lo", "hi", NULL}; static char *keywords[] = {"a", "x", "lo", "hi", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:insort_right", if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:insort_right",
keywords, &list, &item, &lo, &hi)) keywords, &list, &item, &lo, &hi))
...@@ -137,7 +137,7 @@ bisect_left(PyObject *self, PyObject *args, PyObject *kw) ...@@ -137,7 +137,7 @@ bisect_left(PyObject *self, PyObject *args, PyObject *kw)
int lo = 0; int lo = 0;
int hi = -1; int hi = -1;
int index; int index;
static const char *keywords[] = {"a", "x", "lo", "hi", NULL}; static char *keywords[] = {"a", "x", "lo", "hi", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:bisect_left", if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:bisect_left",
keywords, &list, &item, &lo, &hi)) keywords, &list, &item, &lo, &hi))
...@@ -167,7 +167,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw) ...@@ -167,7 +167,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
int lo = 0; int lo = 0;
int hi = -1; int hi = -1;
int index; int index;
static const char *keywords[] = {"a", "x", "lo", "hi", NULL}; static char *keywords[] = {"a", "x", "lo", "hi", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:insort_left", if (!PyArg_ParseTupleAndKeywords(args, kw, "OO|ii:insort_left",
keywords, &list, &item, &lo, &hi)) keywords, &list, &item, &lo, &hi))
......
This diff is collapsed.
...@@ -291,7 +291,7 @@ Dialect_dealloc(DialectObj *self) ...@@ -291,7 +291,7 @@ Dialect_dealloc(DialectObj *self)
self->ob_type->tp_free((PyObject *)self); self->ob_type->tp_free((PyObject *)self);
} }
static const char *dialect_kws[] = { static char *dialect_kws[] = {
"dialect", "dialect",
"delimiter", "delimiter",
"doublequote", "doublequote",
......
...@@ -106,12 +106,6 @@ typedef int Py_ssize_t; ...@@ -106,12 +106,6 @@ typedef int Py_ssize_t;
#endif #endif
#endif #endif
#if (PY_VERSION_HEX >= 0x02050000)
#define PY_CONST const /* 2.5 adds const to some API:s */
#else
#define PY_CONST
#endif
#if !defined(Py_RETURN_NONE) #if !defined(Py_RETURN_NONE)
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#endif #endif
...@@ -2192,7 +2186,7 @@ xmlparser(PyObject* _self, PyObject* args, PyObject* kw) ...@@ -2192,7 +2186,7 @@ xmlparser(PyObject* _self, PyObject* args, PyObject* kw)
PyObject* target = NULL; PyObject* target = NULL;
char* encoding = NULL; char* encoding = NULL;
static PY_CONST char* kwlist[] = { "target", "encoding", NULL }; static char* kwlist[] = { "target", "encoding", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kw, "|Oz:XMLParser", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kw, "|Oz:XMLParser", kwlist,
&target, &encoding)) &target, &encoding))
return NULL; return NULL;
......
...@@ -45,8 +45,8 @@ PyDoc_STRVAR(MultibyteCodec_StreamReader__doc__, ...@@ -45,8 +45,8 @@ PyDoc_STRVAR(MultibyteCodec_StreamReader__doc__,
PyDoc_STRVAR(MultibyteCodec_StreamWriter__doc__, PyDoc_STRVAR(MultibyteCodec_StreamWriter__doc__,
"I.StreamWriter(stream[, errors]) -> StreamWriter instance"); "I.StreamWriter(stream[, errors]) -> StreamWriter instance");
static const char *codeckwarglist[] = {"input", "errors", NULL}; static char *codeckwarglist[] = {"input", "errors", NULL};
static const char *streamkwarglist[] = {"stream", "errors", NULL}; static char *streamkwarglist[] = {"stream", "errors", NULL};
static PyObject *multibytecodec_encode(MultibyteCodec *, static PyObject *multibytecodec_encode(MultibyteCodec *,
MultibyteCodec_State *, const Py_UNICODE **, size_t, MultibyteCodec_State *, const Py_UNICODE **, size_t,
......
...@@ -1891,7 +1891,7 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw) ...@@ -1891,7 +1891,7 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
PyObject *y = NULL; /* temp sum of microseconds */ PyObject *y = NULL; /* temp sum of microseconds */
double leftover_us = 0.0; double leftover_us = 0.0;
static const char *keywords[] = { static char *keywords[] = {
"days", "seconds", "microseconds", "milliseconds", "days", "seconds", "microseconds", "milliseconds",
"minutes", "hours", "weeks", NULL "minutes", "hours", "weeks", NULL
}; };
...@@ -2194,7 +2194,7 @@ static PyGetSetDef date_getset[] = { ...@@ -2194,7 +2194,7 @@ static PyGetSetDef date_getset[] = {
/* Constructors. */ /* Constructors. */
static const char *date_kws[] = {"year", "month", "day", NULL}; static char *date_kws[] = {"year", "month", "day", NULL};
static PyObject * static PyObject *
date_new(PyTypeObject *type, PyObject *args, PyObject *kw) date_new(PyTypeObject *type, PyObject *args, PyObject *kw)
...@@ -2448,7 +2448,7 @@ date_strftime(PyDateTime_Date *self, PyObject *args, PyObject *kw) ...@@ -2448,7 +2448,7 @@ date_strftime(PyDateTime_Date *self, PyObject *args, PyObject *kw)
PyObject *result; PyObject *result;
PyObject *format; PyObject *format;
PyObject *tuple; PyObject *tuple;
static const char *keywords[] = {"format", NULL}; static char *keywords[] = {"format", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:strftime", keywords, if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:strftime", keywords,
&PyString_Type, &format)) &PyString_Type, &format))
...@@ -3028,7 +3028,7 @@ static PyGetSetDef time_getset[] = { ...@@ -3028,7 +3028,7 @@ static PyGetSetDef time_getset[] = {
* Constructors. * Constructors.
*/ */
static const char *time_kws[] = {"hour", "minute", "second", "microsecond", static char *time_kws[] = {"hour", "minute", "second", "microsecond",
"tzinfo", NULL}; "tzinfo", NULL};
static PyObject * static PyObject *
...@@ -3196,7 +3196,7 @@ time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw) ...@@ -3196,7 +3196,7 @@ time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw)
PyObject *result; PyObject *result;
PyObject *format; PyObject *format;
PyObject *tuple; PyObject *tuple;
static const char *keywords[] = {"format", NULL}; static char *keywords[] = {"format", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:strftime", keywords, if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:strftime", keywords,
&PyString_Type, &format)) &PyString_Type, &format))
...@@ -3548,7 +3548,7 @@ static PyGetSetDef datetime_getset[] = { ...@@ -3548,7 +3548,7 @@ static PyGetSetDef datetime_getset[] = {
* Constructors. * Constructors.
*/ */
static const char *datetime_kws[] = { static char *datetime_kws[] = {
"year", "month", "day", "hour", "minute", "second", "year", "month", "day", "hour", "minute", "second",
"microsecond", "tzinfo", NULL "microsecond", "tzinfo", NULL
}; };
...@@ -3729,7 +3729,7 @@ datetime_now(PyObject *cls, PyObject *args, PyObject *kw) ...@@ -3729,7 +3729,7 @@ datetime_now(PyObject *cls, PyObject *args, PyObject *kw)
{ {
PyObject *self; PyObject *self;
PyObject *tzinfo = Py_None; PyObject *tzinfo = Py_None;
static const char *keywords[] = {"tz", NULL}; static char *keywords[] = {"tz", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:now", keywords, if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:now", keywords,
&tzinfo)) &tzinfo))
...@@ -3765,7 +3765,7 @@ datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw) ...@@ -3765,7 +3765,7 @@ datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
PyObject *self; PyObject *self;
double timestamp; double timestamp;
PyObject *tzinfo = Py_None; PyObject *tzinfo = Py_None;
static const char *keywords[] = {"timestamp", "tz", NULL}; static char *keywords[] = {"timestamp", "tz", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "d|O:fromtimestamp", if (! PyArg_ParseTupleAndKeywords(args, kw, "d|O:fromtimestamp",
keywords, &timestamp, &tzinfo)) keywords, &timestamp, &tzinfo))
...@@ -3843,7 +3843,7 @@ datetime_strptime(PyObject *cls, PyObject *args) ...@@ -3843,7 +3843,7 @@ datetime_strptime(PyObject *cls, PyObject *args)
static PyObject * static PyObject *
datetime_combine(PyObject *cls, PyObject *args, PyObject *kw) datetime_combine(PyObject *cls, PyObject *args, PyObject *kw)
{ {
static const char *keywords[] = {"date", "time", NULL}; static char *keywords[] = {"date", "time", NULL};
PyObject *date; PyObject *date;
PyObject *time; PyObject *time;
PyObject *result = NULL; PyObject *result = NULL;
...@@ -4070,7 +4070,7 @@ static PyObject * ...@@ -4070,7 +4070,7 @@ static PyObject *
datetime_isoformat(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) datetime_isoformat(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
{ {
char sep = 'T'; char sep = 'T';
static const char *keywords[] = {"sep", NULL}; static char *keywords[] = {"sep", NULL};
char buffer[100]; char buffer[100];
char *cp; char *cp;
PyObject *result; PyObject *result;
...@@ -4261,7 +4261,7 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) ...@@ -4261,7 +4261,7 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
int offset, none; int offset, none;
PyObject *tzinfo; PyObject *tzinfo;
static const char *keywords[] = {"tz", NULL}; static char *keywords[] = {"tz", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:astimezone", keywords, if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:astimezone", keywords,
&PyDateTime_TZInfoType, &tzinfo)) &PyDateTime_TZInfoType, &tzinfo))
......
...@@ -26,7 +26,7 @@ static PyObject *_grouper_create(groupbyobject *, PyObject *); ...@@ -26,7 +26,7 @@ static PyObject *_grouper_create(groupbyobject *, PyObject *);
static PyObject * static PyObject *
groupby_new(PyTypeObject *type, PyObject *args, PyObject *kwds) groupby_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
static const char *kwargs[] = {"iterable", "key", NULL}; static char *kwargs[] = {"iterable", "key", NULL};
groupbyobject *gbo; groupbyobject *gbo;
PyObject *it, *keyfunc = Py_None; PyObject *it, *keyfunc = Py_None;
......
...@@ -874,7 +874,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) ...@@ -874,7 +874,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ; int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ;
int devzero = -1; int devzero = -1;
int access = (int)ACCESS_DEFAULT; int access = (int)ACCESS_DEFAULT;
static const char *keywords[] = {"fileno", "length", static char *keywords[] = {"fileno", "length",
"flags", "prot", "flags", "prot",
"access", NULL}; "access", NULL};
...@@ -992,7 +992,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) ...@@ -992,7 +992,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
HANDLE fh = 0; HANDLE fh = 0;
int access = (access_mode)ACCESS_DEFAULT; int access = (access_mode)ACCESS_DEFAULT;
DWORD flProtect, dwDesiredAccess; DWORD flProtect, dwDesiredAccess;
static const char *keywords[] = { "fileno", "length", static char *keywords[] = { "fileno", "length",
"tagname", "tagname",
"access", NULL }; "access", NULL };
......
...@@ -2566,7 +2566,7 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -2566,7 +2566,7 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwds)
PySocketSockObject *s = (PySocketSockObject *)self; PySocketSockObject *s = (PySocketSockObject *)self;
SOCKET_T fd; SOCKET_T fd;
int family = AF_INET, type = SOCK_STREAM, proto = 0; int family = AF_INET, type = SOCK_STREAM, proto = 0;
static const char *keywords[] = {"family", "type", "proto", 0}; static char *keywords[] = {"family", "type", "proto", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds, if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|iii:socket", keywords, "|iii:socket", keywords,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment