diff options
| author | jordi.saludes <jordi.saludes@upc.edu> | 2010-07-22 15:03:49 +0000 |
|---|---|---|
| committer | jordi.saludes <jordi.saludes@upc.edu> | 2010-07-22 15:03:49 +0000 |
| commit | 75322d590497acb0af015c07b24a72f9769542e6 (patch) | |
| tree | 2ba53c27d76205b6c977329aa26c6f6818843410 /contrib/py-bindings/gfmodule.c | |
| parent | 0a053b3ddca839bf1095b77b98f35a6b2c5461f0 (diff) | |
Refactoring py object constructors.
Diffstat (limited to 'contrib/py-bindings/gfmodule.c')
| -rw-r--r-- | contrib/py-bindings/gfmodule.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/contrib/py-bindings/gfmodule.c b/contrib/py-bindings/gfmodule.c index 768fb5037..7da294560 100644 --- a/contrib/py-bindings/gfmodule.c +++ b/contrib/py-bindings/gfmodule.c @@ -97,8 +97,7 @@ languageCode(PGF *self, PyObject *args) Lang *lang; if (!PyArg_ParseTuple(args, "O", &lang)) return NULL; - if (!checkType(lang, &LangType)) - return NULL; + if (!checkType(lang, &LangType)) return NULL; char* scode = gf_languageCode(self, lang); if (scode) { PyObject* result = PyString_FromString(scode); @@ -296,9 +295,9 @@ PyModule_AddObject(m, "gf", (PyObject *)&t); } -inline Lang* newLang() { +/* inline Lang* newLang() { return (Lang*)LangType.tp_new(&LangType,NULL,NULL); -} + } inline Tree* newTree() { return (Tree*)TreeType.tp_new(&TreeType,NULL,NULL); @@ -307,9 +306,7 @@ inline Tree* newTree() { inline CId* newCId() { return (CId*)CIdType.tp_new(&CIdType,NULL,NULL); } +*/ inline PyObject* newList() { return PyList_New(0); } - -void append(PyObject* l, PyObject* ob) { - PyList_Append(l, ob); -} +inline void append(PyObject* l, PyObject* ob) { PyList_Append(l, ob); } |
