diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-07 07:34:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-07 07:34:27 +0300 |
commit | 46f90690e029af46f8a321f1217e3e669d5bd5a0 (patch) | |
tree | c7ca797572e2213d4f81f50b446174ccc7a1a8a8 /intern/audaspace/Python | |
parent | 231cceaa46d71f949d80bc2136487f75eda727d7 (diff) |
patch [#24576] aud.Handle.status return bool
from Dan Eicher (dna), no functional changes, just return bool rather then int types.
Diffstat (limited to 'intern/audaspace/Python')
-rw-r--r-- | intern/audaspace/Python/AUD_PyAPI.cpp | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/intern/audaspace/Python/AUD_PyAPI.cpp b/intern/audaspace/Python/AUD_PyAPI.cpp index b0c55d5856e..d3f42419494 100644 --- a/intern/audaspace/Python/AUD_PyAPI.cpp +++ b/intern/audaspace/Python/AUD_PyAPI.cpp @@ -1044,18 +1044,13 @@ Handle_pause(Handle *self) 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 @@ Handle_resume(Handle *self) 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 @@ Handle_stop(Handle *self) 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 @@ Handle_get_keep(Handle *self, void* nothing) 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 @@ Handle_get_status(Handle *self, void* nothing) 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 @@ Handle_get_relative(Handle *self, void* nothing) 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 { |