patch [#24576] aud.Handle.status return bool

from Dan Eicher (dna), no functional changes, just return bool rather then int types.
This commit is contained in:
Campbell Barton 2010-11-07 04:34:27 +00:00
parent 231cceaa46
commit 46f90690e0

@ -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
{