Commit 23ed1a34 authored by Boxiang Sun's avatar Boxiang Sun

some Pyston change to structseq

parent df3e7ee9
......@@ -8,14 +8,15 @@
extern "C" {
#endif
// Pyston changes: change char* to const char*
typedef struct PyStructSequence_Field {
char *name;
char *doc;
const char *name;
const char *doc;
} PyStructSequence_Field;
typedef struct PyStructSequence_Desc {
char *name;
char *doc;
const char *name;
const char *doc;
struct PyStructSequence_Field *fields;
int n_in_sequence;
} PyStructSequence_Desc;
......@@ -25,7 +26,8 @@ extern char* PyStructSequence_UnnamedField;
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc) PYSTON_NOEXCEPT;
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type) PYSTON_NOEXCEPT;
// Pyston change, change PyTypeObject to struct _typeobject
PyAPI_FUNC(PyObject *) PyStructSequence_New(struct _typeobject* type) PYSTON_NOEXCEPT;
typedef struct {
PyObject_VAR_HEAD
......
......@@ -519,12 +519,12 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
for (i = k = 0; i < n_members; ++i) {
if (desc->fields[i].name == PyStructSequence_UnnamedField)
continue;
members[k].name = desc->fields[i].name;
members[k].name = (char*)desc->fields[i].name;
members[k].type = T_OBJECT;
members[k].offset = offsetof(PyStructSequence, ob_item)
+ i * sizeof(PyObject*);
members[k].flags = READONLY;
members[k].doc = desc->fields[i].doc;
members[k].doc = (char*)desc->fields[i].doc;
k++;
}
members[k].name = NULL;
......
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