Commits

Hirokazu Yamamoto  committed ad6490a

Merged revisions 86281,86285 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r86281 | hirokazu.yamamoto | 2010-11-07 11:45:19 +0900 | 1 line

Formatted code. (Tabify, etc)
........
r86285 | hirokazu.yamamoto | 2010-11-07 20:07:44 +0900 | 1 line

Reformatted code a bit.
........

  • Participants
  • Parent commits 328992b
  • Branches 3.1

Comments (0)

Files changed (1)

File PC/winsound.c

     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);
 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);