[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32905] trunk/blender/intern/audaspace/ Python/AUD_PyAPI.cpp: patch [#24576] aud.Handle.status return bool
Campbell Barton
ideasman42 at gmail.com
Sun Nov 7 05:34:28 CET 2010
Revision: 32905
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32905
Author: campbellbarton
Date: 2010-11-07 05:34:27 +0100 (Sun, 07 Nov 2010)
Log Message:
-----------
patch [#24576] aud.Handle.status return bool
from Dan Eicher (dna), no functional changes, just return bool rather then int types.
Modified Paths:
--------------
trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp
Modified: trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp
===================================================================
--- trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp 2010-11-07 03:56:58 UTC (rev 32904)
+++ trunk/blender/intern/audaspace/Python/AUD_PyAPI.cpp 2010-11-07 04:34:27 UTC (rev 32905)
@@ -1044,18 +1044,13 @@
try
{
- if(device->device->pause(self->handle))
- {
- Py_RETURN_TRUE;
- }
+ return PyBool_FromLong((long)device->device->pause(self->handle));
}
catch(AUD_Exception& e)
{
PyErr_SetString(AUDError, e.str);
return NULL;
}
-
- Py_RETURN_FALSE;
}
PyDoc_STRVAR(M_aud_Handle_resume_doc,
@@ -1071,18 +1066,13 @@
try
{
- if(device->device->resume(self->handle))
- {
- Py_RETURN_TRUE;
- }
+ return PyBool_FromLong((long)device->device->resume(self->handle));
}
catch(AUD_Exception& e)
{
PyErr_SetString(AUDError, e.str);
return NULL;
}
-
- Py_RETURN_FALSE;
}
PyDoc_STRVAR(M_aud_Handle_stop_doc,
@@ -1099,18 +1089,13 @@
try
{
- if(device->device->stop(self->handle))
- {
- Py_RETURN_TRUE;
- }
+ return PyBool_FromLong((long)device->device->stop(self->handle));
}
catch(AUD_Exception& e)
{
PyErr_SetString(AUDError, e.str);
return NULL;
}
-
- Py_RETURN_FALSE;
}
static PyMethodDef Handle_methods[] = {
@@ -1185,14 +1170,7 @@
try
{
- if(device->device->getKeep(self->handle))
- {
- Py_RETURN_TRUE;
- }
- else
- {
- Py_RETURN_FALSE;
- }
+ return PyBool_FromLong((long)device->device->getKeep(self->handle));
}
catch(AUD_Exception& e)
{
@@ -1237,7 +1215,7 @@
try
{
- return Py_BuildValue("i", device->device->getStatus(self->handle));
+ return PyBool_FromLong((long)device->device->getStatus(self->handle));
}
catch(AUD_Exception& e)
{
@@ -1568,14 +1546,7 @@
AUD_I3DDevice* device = dynamic_cast<AUD_I3DDevice*>(dev->device);
if(device)
{
- if(device->isRelative(self->handle))
- {
- Py_RETURN_TRUE;
- }
- else
- {
- Py_RETURN_FALSE;
- }
+ return PyBool_FromLong((long)device->isRelative(self->handle));
}
else
{
More information about the Bf-blender-cvs
mailing list