|
@@ -196,12 +196,12 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) {
|
|
|
}
|
|
|
|
|
|
static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) {
|
|
|
- static char *kwlist[] = {"name", "bases", "dict", 0};
|
|
|
+ static const char *kwlist[] = {"name", "bases", "dict", 0};
|
|
|
PyObject *bases, *dict;
|
|
|
const char* name;
|
|
|
|
|
|
// Check arguments: (name, bases, dict)
|
|
|
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO!O!:type", kwlist,
|
|
|
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO!O!:type", const_cast<char**>(kwlist),
|
|
|
&name,
|
|
|
&PyTuple_Type, &bases,
|
|
|
&PyDict_Type, &dict)) {
|
|
@@ -546,7 +546,7 @@ PyObject* PickleError_class;
|
|
|
|
|
|
// Format an error message for unexpected types.
|
|
|
// Always return with an exception set.
|
|
|
-void FormatTypeError(PyObject* arg, char* expected_types) {
|
|
|
+void FormatTypeError(PyObject* arg, const char* expected_types) {
|
|
|
// This function is often called with an exception set.
|
|
|
// Clear it to call PyObject_Repr() in good conditions.
|
|
|
PyErr_Clear();
|
|
@@ -1679,9 +1679,9 @@ static PyObject* InternalSerializeToString(
|
|
|
CMessage* self, PyObject* args, PyObject* kwargs,
|
|
|
bool require_initialized) {
|
|
|
// Parse the "deterministic" kwarg; defaults to False.
|
|
|
- static char* kwlist[] = { "deterministic", 0 };
|
|
|
+ static const char* kwlist[] = { "deterministic", 0 };
|
|
|
PyObject* deterministic_obj = Py_None;
|
|
|
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", kwlist,
|
|
|
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", const_cast<char**>(kwlist),
|
|
|
&deterministic_obj)) {
|
|
|
return NULL;
|
|
|
}
|