remove the redundany _new functions

This commit is contained in:
krangelov
2021-09-26 21:02:57 +02:00
parent 729a3102b4
commit 3716990b8d

View File

@@ -259,7 +259,7 @@ PyTypeObject pgf_ExprType = {
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, //(hashfunc) Expr_hash, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, /*tp_call*/
(reprfunc) Expr_str, /*tp_str*/ (reprfunc) Expr_str, /*tp_str*/
0, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
@@ -287,13 +287,6 @@ PyTypeObject pgf_ExprType = {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprAbsObject *
ExprAbs_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprAbsObject* self = (ExprAbsObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprAbs_init(ExprAbsObject *self, PyObject *args, PyObject *kwds) ExprAbs_init(ExprAbsObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -366,10 +359,10 @@ PyTypeObject pgf_ExprAbsType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprAbs_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -380,9 +373,9 @@ PyTypeObject pgf_ExprAbsType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprAbs_members, /*tp_members */ ExprAbs_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -390,18 +383,11 @@ PyTypeObject pgf_ExprAbsType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprAbs_init, /*tp_init */ (initproc) ExprAbs_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprAbs_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprAppObject *
ExprApp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprAppObject* self = (ExprAppObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprApp_init(ExprAppObject *self, PyObject *args, PyObject *kwds) ExprApp_init(ExprAppObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -468,10 +454,10 @@ PyTypeObject pgf_ExprAppType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprApp_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -482,9 +468,9 @@ PyTypeObject pgf_ExprAppType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprApp_members, /*tp_members */ ExprApp_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -492,18 +478,11 @@ PyTypeObject pgf_ExprAppType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprApp_init, /*tp_init */ (initproc) ExprApp_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprApp_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprLitObject *
ExprLit_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprLitObject* self = (ExprLitObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprLit_init(ExprLitObject *self, PyObject *args, PyObject *kwds) ExprLit_init(ExprLitObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -585,10 +564,10 @@ PyTypeObject pgf_ExprLitType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprLit_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -609,18 +588,11 @@ PyTypeObject pgf_ExprLitType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprLit_init, /*tp_init */ (initproc) ExprLit_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprLit_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprMetaObject *
ExprMeta_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprMetaObject* self = (ExprMetaObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprMeta_init(ExprMetaObject *self, PyObject *args, PyObject *kwds) ExprMeta_init(ExprMetaObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -691,10 +663,10 @@ PyTypeObject pgf_ExprMetaType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprMeta_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -705,9 +677,9 @@ PyTypeObject pgf_ExprMetaType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprMeta_members, /*tp_members */ ExprMeta_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -715,18 +687,11 @@ PyTypeObject pgf_ExprMetaType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprMeta_init, /*tp_init */ (initproc) ExprMeta_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprMeta_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprFunObject *
ExprFun_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprFunObject* self = (ExprFunObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprFun_init(ExprFunObject *self, PyObject *args, PyObject *kwds) ExprFun_init(ExprFunObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -787,10 +752,10 @@ PyTypeObject pgf_ExprFunType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprFun_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -801,9 +766,9 @@ PyTypeObject pgf_ExprFunType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprFun_members, /*tp_members */ ExprFun_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -811,18 +776,11 @@ PyTypeObject pgf_ExprFunType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprFun_init, /*tp_init */ (initproc) ExprFun_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprFun_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprVarObject *
ExprVar_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprVarObject* self = (ExprVarObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprVar_init(ExprVarObject *self, PyObject *args, PyObject *kwds) ExprVar_init(ExprVarObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -893,10 +851,10 @@ PyTypeObject pgf_ExprVarType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprVar_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -907,9 +865,9 @@ PyTypeObject pgf_ExprVarType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprVar_members, /*tp_members */ ExprVar_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -917,18 +875,11 @@ PyTypeObject pgf_ExprVarType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprVar_init, /*tp_init */ (initproc) ExprVar_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprVar_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprTypedObject *
ExprTyped_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprTypedObject* self = (ExprTypedObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprTyped_init(ExprTypedObject *self, PyObject *args, PyObject *kwds) ExprTyped_init(ExprTypedObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -995,10 +946,10 @@ PyTypeObject pgf_ExprTypedType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, //(ternaryfunc) Expr_call, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprTyped_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -1009,9 +960,9 @@ PyTypeObject pgf_ExprTypedType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprTyped_members, /*tp_members */ ExprTyped_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -1019,18 +970,11 @@ PyTypeObject pgf_ExprTypedType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprTyped_init, /*tp_init */ (initproc) ExprTyped_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprTyped_new, /*tp_new */ 0, /*tp_new */
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static ExprImplArgObject *
ExprImplArg_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
ExprImplArgObject* self = (ExprImplArgObject *)subtype->tp_alloc(subtype, 0);
return self;
}
static int static int
ExprImplArg_init(ExprImplArgObject *self, PyObject *args, PyObject *kwds) ExprImplArg_init(ExprImplArgObject *self, PyObject *args, PyObject *kwds)
{ {
@@ -1091,10 +1035,10 @@ PyTypeObject pgf_ExprImplArgType = {
0, /*tp_as_number*/ 0, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ 0, /*tp_as_mapping*/
0, //(hashfunc) Expr_hash, /*tp_hash */ 0, /*tp_hash */
0, //(ternaryfunc) Expr_call, /*tp_call*/ 0, /*tp_call*/
0, //(reprfunc) Expr_str, /*tp_str*/ 0, /*tp_str*/
0, //(getattrofunc) ExprImplArg_getattro, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
@@ -1105,9 +1049,9 @@ PyTypeObject pgf_ExprImplArgType = {
0, /*tp_weaklistoffset */ 0, /*tp_weaklistoffset */
0, /*tp_iter */ 0, /*tp_iter */
0, /*tp_iternext */ 0, /*tp_iternext */
0, //Expr_methods, /*tp_methods */ 0, /*tp_methods */
ExprImplArg_members, /*tp_members */ ExprImplArg_members, /*tp_members */
0, //Expr_getseters, /*tp_getset */ 0, /*tp_getset */
&pgf_ExprType, /*tp_base */ &pgf_ExprType, /*tp_base */
0, /*tp_dict */ 0, /*tp_dict */
0, /*tp_descr_get */ 0, /*tp_descr_get */
@@ -1115,5 +1059,5 @@ PyTypeObject pgf_ExprImplArgType = {
0, /*tp_dictoffset */ 0, /*tp_dictoffset */
(initproc) ExprImplArg_init, /*tp_init */ (initproc) ExprImplArg_init, /*tp_init */
0, /*tp_alloc */ 0, /*tp_alloc */
(newfunc) ExprImplArg_new, /*tp_new */ 0, /*tp_new */
}; };