From 46f90690e029af46f8a321f1217e3e669d5bd5a0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 7 Nov 2010 04:34:27 +0000 Subject: patch [#24576] aud.Handle.status return bool from Dan Eicher (dna), no functional changes, just return bool rather then int types. --- intern/audaspace/Python/AUD_PyAPI.cpp | 41 +++++------------------------------ 1 file changed, 6 insertions(+), 35 deletions(-) (limited to 'intern/audaspace') 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(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 { -- cgit v1.2.3