Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-21 15:09:58 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-21 15:09:58 +0300
commitf86309d6728337f3f9452a78f949b3f4fd3d59af (patch)
treef115e311b5ed0374befdd0ea4796c09bd6e45ddd /source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
parentf520fb2426f515b815d0c3de2dbe4de247475574 (diff)
Removed the declaration of an undefined static function, to suppress a compiler warning.
Also made minor changes to make IntegrationType a subclass of the built-in int type.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_IntegrationType.cpp')
-rw-r--r--source/blender/freestyle/intern/python/BPy_IntegrationType.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
index 67c2e53a7cb..d2f16e427a5 100644
--- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
+++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
@@ -8,13 +8,7 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for IntegrationType instance -----------*/
-static int IntegrationType___init__(BPy_IntegrationType *self, PyObject *args, PyObject *kwds);
-
-/*----------------------IntegrationType instance definitions ----------------------------*/
-static PyMethodDef BPy_IntegrationType_methods[] = {
- {NULL, NULL, 0, NULL}
-};
+static PyObject *BPy_IntegrationType_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
/*-----------------------BPy_IntegrationType type definition ------------------------------*/
@@ -74,7 +68,7 @@ PyTypeObject IntegrationType_Type = {
NULL, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/
- BPy_IntegrationType_methods, /* struct PyMethodDef *tp_methods; */
+ NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
&PyInt_Type, /* struct _typeobject *tp_base; */
@@ -84,7 +78,7 @@ PyTypeObject IntegrationType_Type = {
0, /* long tp_dictoffset; */
NULL, /* initproc tp_init; */
NULL, /* allocfunc tp_alloc; */
- PyType_GenericNew, /* newfunc tp_new; */
+ BPy_IntegrationType_new, /* newfunc tp_new; */
/* Low-level free-memory routine */
NULL, /* freefunc tp_free; */
@@ -102,17 +96,28 @@ PyTypeObject IntegrationType_Type = {
};
static PyObject *
-BPy_IntegrationType_FromIntegrationType(IntegrationType t)
+BPy_IntegrationType_FromIntegrationType(int t)
{
BPy_IntegrationType *obj;
obj = PyObject_New(BPy_IntegrationType, &IntegrationType_Type);
if (!obj)
return NULL;
- ((PyIntObject *)obj)->ob_ival = (long)t;
+ ((PyIntObject *)obj)->ob_ival = t;
return (PyObject *)obj;
}
+static PyObject *
+BPy_IntegrationType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ int x = 0;
+ static char *kwlist[] = {"x", 0};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist, &x))
+ return NULL;
+ return BPy_IntegrationType_FromIntegrationType(x);
+}
+
//-------------------MODULE INITIALIZATION--------------------------------
PyMODINIT_FUNC IntegrationType_Init( PyObject *module )
{