diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-11-07 02:45:19 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-11-07 02:45:19 (GMT) |
commit | 62fbdd9b7b8eea80842acd63a425242452aa4e61 (patch) | |
tree | fdb8841cb09ce7f387074162a7d29682fd2f5534 /PC/winsound.c | |
parent | 51d2fd983bcc85342b631e27a33e214c691e53be (diff) | |
download | cpython-62fbdd9b7b8eea80842acd63a425242452aa4e61.zip cpython-62fbdd9b7b8eea80842acd63a425242452aa4e61.tar.gz cpython-62fbdd9b7b8eea80842acd63a425242452aa4e61.tar.bz2 |
Formatted code. (Tabify, etc)
Diffstat (limited to 'PC/winsound.c')
-rw-r--r-- | PC/winsound.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/PC/winsound.c b/PC/winsound.c index 4edda3f..d61dde7 100644 --- a/PC/winsound.c +++ b/PC/winsound.c @@ -77,24 +77,23 @@ sound_playsound(PyObject *s, PyObject *args) int length; int ok; - if(!PyArg_ParseTuple(args,"z#i:PlaySound",&sound,&length,&flags)) { - return NULL; + if (!PyArg_ParseTuple(args, "z#i:PlaySound", &sound, &length, &flags)) { + return NULL; } - if(flags&SND_ASYNC && flags &SND_MEMORY) { - /* Sidestep reference counting headache; unfortunately this also - prevent SND_LOOP from memory. */ - PyErr_SetString(PyExc_RuntimeError,"Cannot play asynchronously from memory"); - return NULL; + if (flags & SND_ASYNC && flags & SND_MEMORY) { + /* Sidestep reference counting headache; unfortunately this also + prevent SND_LOOP from memory. */ + PyErr_SetString(PyExc_RuntimeError, "Cannot play asynchronously from memory"); + return NULL; } Py_BEGIN_ALLOW_THREADS - ok = PlaySound(sound,NULL,flags); + ok = PlaySound(sound, NULL, flags); Py_END_ALLOW_THREADS - if(!ok) - { - PyErr_SetString(PyExc_RuntimeError,"Failed to play sound"); - return NULL; + if (!ok) { + PyErr_SetString(PyExc_RuntimeError, "Failed to play sound"); + return NULL; } Py_INCREF(Py_None); @@ -151,11 +150,10 @@ static struct PyMethodDef sound_methods[] = static void add_define(PyObject *dict, const char *key, long value) { - PyObject *k=PyUnicode_FromString(key); - PyObject *v=PyLong_FromLong(value); - if(v&&k) - { - PyDict_SetItem(dict,k,v); + PyObject *k = PyUnicode_FromString(key); + PyObject *v = PyLong_FromLong(value); + if (v && k) { + PyDict_SetItem(dict,k,v); } Py_XDECREF(k); Py_XDECREF(v); |