[Python-checkins] cpython: Strip trailing spaces of _pickle.c

victor.stinner python-checkins at python.org
Thu Sep 29 23:51:17 CEST 2011


http://hg.python.org/cpython/rev/a4a9ba2c31ef
changeset:   72538:a4a9ba2c31ef
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Thu Sep 29 23:40:53 2011 +0200
summary:
  Strip trailing spaces of _pickle.c

files:
  Modules/_pickle.c |  34 +++++++++++++++++-----------------
  1 files changed, 17 insertions(+), 17 deletions(-)


diff --git a/Modules/_pickle.c b/Modules/_pickle.c
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -605,7 +605,7 @@
 /*************************************************************************/
 
 /* Helpers for creating the argument tuple passed to functions. This has the
-   performance advantage of calling PyTuple_New() only once. 
+   performance advantage of calling PyTuple_New() only once.
 
    XXX(avassalotti): Inline directly in _Pickler_FastCall() and
    _Unpickler_FastCall(). */
@@ -813,7 +813,7 @@
     fix_imports = PyObject_IsTrue(fix_imports_obj);
     if (fix_imports == -1)
         return -1;
-    
+
     self->proto = proto;
     self->bin = proto > 0;
     self->fix_imports = fix_imports && proto < 3;
@@ -909,7 +909,7 @@
     Py_ssize_t read_size, prefetched_size = 0;
 
     assert(self->read != NULL);
-    
+
     if (_Unpickler_SkipConsumed(self) < 0)
         return -1;
 
@@ -1037,7 +1037,7 @@
         self->next_read_idx = num_read;
         return _Unpickler_CopyLine(self, self->input_buffer, num_read, result);
     }
- 
+
     /* If we get here, we've run off the end of the input string. Return the
        remaining string and let the caller figure it out. */
     *result = self->input_buffer + self->next_read_idx;
@@ -1601,7 +1601,7 @@
          * bits.
          */
         if (sign < 0 &&
-            nbytes > 1 && 
+            nbytes > 1 &&
             pdata[nbytes - 1] == 0xff &&
             (pdata[nbytes - 2] & 0x80) != 0) {
             nbytes--;
@@ -1667,7 +1667,7 @@
             return -1;
         if (_Pickler_Write(self, pdata, 9) < 0)
             return -1;
-   } 
+   }
     else {
         int result = -1;
         char *buf = NULL;
@@ -1782,10 +1782,10 @@
 #else
     const Py_ssize_t expandsize = 6;
 #endif
-    
+
     if (size > PY_SSIZE_T_MAX / expandsize)
         return PyErr_NoMemory();
-    
+
     repr = PyByteArray_FromStringAndSize(NULL, expandsize * size);
     if (repr == NULL)
         return NULL;
@@ -3055,7 +3055,7 @@
         return -1;
 
     if (state) {
-        if (save(self, state, 0) < 0 || 
+        if (save(self, state, 0) < 0 ||
             _Pickler_Write(self, &build_op, 1) < 0)
             return -1;
     }
@@ -3309,7 +3309,7 @@
        Developers often forget to call __init__() in their subclasses, which
        would trigger a segfault without this check. */
     if (self->write == NULL) {
-        PyErr_Format(PicklingError, 
+        PyErr_Format(PicklingError,
                      "Pickler.__init__() was not called by %s.__init__()",
                      Py_TYPE(self)->tp_name);
         return NULL;
@@ -3789,7 +3789,7 @@
     0,                                  /*tp_is_gc*/
 };
 
-/* Temporary helper for calling self.find_class(). 
+/* Temporary helper for calling self.find_class().
 
    XXX: It would be nice to able to avoid Python function call overhead, by
    using directly the C version of find_class(), when find_class() is not
@@ -3842,7 +3842,7 @@
         return bad_readline();
 
     errno = 0;
-    /* XXX: Should the base argument of strtol() be explicitly set to 10? 
+    /* XXX: Should the base argument of strtol() be explicitly set to 10?
        XXX(avassalotti): Should this uses PyOS_strtol()? */
     x = strtol(s, &endptr, 0);
 
@@ -4207,7 +4207,7 @@
 
     x = calc_binint(s, 4);
     if (x < 0) {
-        PyErr_SetString(UnpicklingError, 
+        PyErr_SetString(UnpicklingError,
                         "BINSTRING pickle has negative byte count");
         return -1;
     }
@@ -5001,7 +5001,7 @@
         return stack_underflow();
     if (len == x)  /* nothing to do */
         return 0;
-    if ((len - x) % 2 != 0) { 
+    if ((len - x) % 2 != 0) {
         /* Currupt or hostile pickle -- we never write one like this. */
         PyErr_SetString(UnpicklingError, "odd number of items for SETITEMS");
         return -1;
@@ -5358,7 +5358,7 @@
        not call Unpickler.__init__(). Here, we simply ensure that self->read
        is not NULL. */
     if (self->read == NULL) {
-        PyErr_Format(UnpicklingError, 
+        PyErr_Format(UnpicklingError,
                      "Unpickler.__init__() was not called by %s.__init__()",
                      Py_TYPE(self)->tp_name);
         return NULL;
@@ -5460,7 +5460,7 @@
         global = PyObject_GetAttr(module, global_name);
         Py_DECREF(module);
     }
-    else { 
+    else {
         global = PyObject_GetAttr(module, global_name);
     }
     return global;
@@ -5637,7 +5637,7 @@
  * intentional, as these should be treated as black-box implementation details.
  *
  * We do, however, have to implement pickling/unpickling support because of
- * real-world code like cvs2svn. 
+ * real-world code like cvs2svn.
  */
 
 typedef struct {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list