[Python-checkins] r42431 - python/trunk/Modules/mmapmodule.c

tim.peters python-checkins at python.org
Fri Feb 17 00:50:19 CET 2006


Author: tim.peters
Date: Fri Feb 17 00:50:16 2006
New Revision: 42431

Modified:
   python/trunk/Modules/mmapmodule.c
Log:
Removed pointless parens around `return` expressions;
deleted some curlies around one-line blocks.


Modified: python/trunk/Modules/mmapmodule.c
==============================================================================
--- python/trunk/Modules/mmapmodule.c	(original)
+++ python/trunk/Modules/mmapmodule.c	Fri Feb 17 00:50:16 2006
@@ -152,7 +152,7 @@
 #endif
 
 	Py_INCREF (Py_None);
-	return (Py_None);
+	return Py_None;
 }
 
 #ifdef MS_WINDOWS
@@ -213,7 +213,7 @@
 				   newline. */
 	result = PyString_FromStringAndSize(start, (eol - start));
 	self->pos += (eol - start);
-	return (result);
+	return result;
 }
 
 static PyObject *
@@ -233,7 +233,7 @@
 	}
 	result = Py_BuildValue("s#", self->data+self->pos, num_bytes);
 	self->pos += num_bytes;
-	return (result);
+	return result;
 }
 
 static PyObject *
@@ -313,7 +313,7 @@
 	memcpy (self->data+self->pos, data, length);
 	self->pos = self->pos+length;
 	Py_INCREF (Py_None);
-	return (Py_None);
+	return Py_None;
 }
 
 static PyObject *
@@ -331,7 +331,7 @@
 	*(self->data+self->pos) = value;
 	self->pos += 1;
 	Py_INCREF (Py_None);
-	return (Py_None);
+	return Py_None;
 }
 
 static PyObject *
@@ -344,11 +344,11 @@
 
 #ifdef MS_WINDOWS
 	if (self->file_handle != INVALID_HANDLE_VALUE) {
-		return (Py_BuildValue (
-			"l", (long)
-			GetFileSize (self->file_handle, NULL)));
+		return Py_BuildValue (
+		        "l", (long)
+			GetFileSize (self->file_handle, NULL));
 	} else {
-		return (Py_BuildValue ("l", (long) self->size) );
+		return Py_BuildValue ("l", (long) self->size);
 	}
 #endif /* MS_WINDOWS */
 
@@ -359,7 +359,7 @@
 			PyErr_SetFromErrno(mmap_module_error);
 			return NULL;
 		}
-		return (Py_BuildValue ("l", (long) buf.st_size) );
+		return Py_BuildValue ("l", (long) buf.st_size);
 	}
 #endif /* UNIX */
 }
@@ -419,7 +419,7 @@
 			dwErrCode = GetLastError();
 		}
 		PyErr_SetFromWindowsErr(dwErrCode);
-		return (NULL);
+		return NULL;
 #endif /* MS_WINDOWS */
 
 #ifdef UNIX
@@ -462,7 +462,7 @@
 	CHECK_VALID(NULL);
         if (!PyArg_ParseTuple(args, ":tell"))
 		return NULL;
-	return (Py_BuildValue ("l", (long) self->pos) );
+	return Py_BuildValue ("l", (long) self->pos);
 }
 
 static PyObject *
@@ -479,8 +479,8 @@
 		return NULL;
 	} else {
 #ifdef MS_WINDOWS
-		return (Py_BuildValue("l", (long)
-                                      FlushViewOfFile(self->data+offset, size)));
+		return Py_BuildValue("l", (long)
+                                      FlushViewOfFile(self->data+offset, size));
 #endif /* MS_WINDOWS */
 #ifdef UNIX
 		/* XXX semantics of return value? */
@@ -531,7 +531,7 @@
 			goto onoutofrange;
 		self->pos = where;
 		Py_INCREF (Py_None);
-		return (Py_None);
+		return Py_None;
 	}
 
   onoutofrange:
@@ -1115,17 +1115,15 @@
 						      0,
 						      0,
 						      0);
-		if (m_obj->data != NULL) {
-			return ((PyObject *) m_obj);
-		} else {
+		if (m_obj->data != NULL)
+			return (PyObject *)m_obj;
+		else
 			dwErr = GetLastError();
-		}
-	} else {
+	} else
 		dwErr = GetLastError();
-	}
 	Py_DECREF(m_obj);
 	PyErr_SetFromWindowsErr(dwErr);
-	return (NULL);
+	return NULL;
 }
 #endif /* MS_WINDOWS */
 


More information about the Python-checkins mailing list