osutil: fix up check-code issues
authorMatt Mackall <mpm@selenic.com>
Wed, 23 Mar 2011 09:41:58 -0500
changeset 13736 f3c4421e121c
parent 13735 ce341da8537c
child 13740 dcb51f156fa6
osutil: fix up check-code issues
contrib/check-code.py
mercurial/osutil.c
--- a/contrib/check-code.py	Wed Mar 23 09:34:22 2011 -0500
+++ b/contrib/check-code.py	Wed Mar 23 09:41:58 2011 -0500
@@ -177,7 +177,7 @@
     (r'\([^\)]+\) \w+', "use (int)foo, not (int) foo"),
     (r'\S+ (\+\+|--)', "use foo++, not foo ++"),
     (r'\w,\w', "missing whitespace after ,"),
-    (r'\w[+/*]\w', "missing whitespace in expression"),
+    (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
     (r'^#\s+\w', "use #foo, not # foo"),
     (r'[^\n]\Z', "no trailing newline"),
 ]
--- a/mercurial/osutil.c	Wed Mar 23 09:34:22 2011 -0500
+++ b/mercurial/osutil.c	Wed Mar 23 09:41:58 2011 -0500
@@ -519,14 +519,14 @@
 
 static PyObject *isgui(PyObject *self)
 {
-    CFDictionaryRef dict = CGSessionCopyCurrentDictionary();
+	CFDictionaryRef dict = CGSessionCopyCurrentDictionary();
 
-    if (dict != NULL) {
-        CFRelease(dict);
-        return Py_True;
-    } else {
-        return Py_False;
-    }
+	if (dict != NULL) {
+		CFRelease(dict);
+		return Py_True;
+	} else {
+		return Py_False;
+	}
 }
 #endif
 
@@ -541,10 +541,10 @@
 "On error, this function may raise either a WindowsError or an IOError."},
 #endif
 #ifdef __APPLE__
-    {
-        "isgui", (PyCFunction)isgui, METH_NOARGS,
-        "Is a CoreGraphics session available?"
-    },
+	{
+		"isgui", (PyCFunction)isgui, METH_NOARGS,
+		"Is a CoreGraphics session available?"
+	},
 #endif
 	{NULL, NULL}
 };