[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Remove trailing space throughout.



Update of /home/minion/cvsroot/src/minion/src
In directory moria.mit.edu:/tmp/cvs-serv28551/src

Modified Files:
	crypt.c fec.c tls.c 
Log Message:
Remove trailing space throughout.

Index: crypt.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/crypt.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- crypt.c	24 Nov 2003 19:59:05 -0000	1.34
+++ crypt.c	28 Nov 2003 04:14:05 -0000	1.35
@@ -228,7 +228,7 @@
         return output;
 }
 
-const char mm_aes128_block_crypt__doc__[] = 
+const char mm_aes128_block_crypt__doc__[] =
 "aes128_block_crypt(key, block, encrypt=0) -> result\n\n"
 "For testing only.  Encrypt or decrypt a single RSA block.\n";
 
@@ -240,15 +240,15 @@
         long inputlen;
         int encrypt=0;
         PyObject *result;
-        AES_KEY *aes_key = NULL;        
+        AES_KEY *aes_key = NULL;
 
         if (!PyArg_ParseTupleAndKeywords(args, kwdict,
-                                         "O&s#|i:aes128_block_crypt", kwlist, 
+                                         "O&s#|i:aes128_block_crypt", kwlist,
                                          aes_arg_convert, &aes_key,
                                          &input, &inputlen,
                                          &encrypt))
                 return NULL;
-        
+
         if (inputlen != 16) {
                 TYPE_ERR("aes128_block_crypt expected a single block.");
                 return NULL;
@@ -402,7 +402,7 @@
         int n,r;
         HCRYPTPROV p;
 
-        if (!PyArg_ParseTupleAndKeywords(args, kwdict, 
+        if (!PyArg_ParseTupleAndKeywords(args, kwdict,
                                          "i:win32_get_random_bytes",
                                          kwlist, &n))
                 return NULL;
@@ -426,7 +426,7 @@
         Py_BEGIN_ALLOW_THREADS
         r = CryptGenRandom(getProvider(), n, PyString_AS_STRING(result));
         Py_END_ALLOW_THREADS
-        
+
         if (!r) {
                 Py_DECREF(result);
                 WIN_ERR("Error generating random bytes");
@@ -464,11 +464,11 @@
         Py_BEGIN_ALLOW_THREADS
         r = RAND_bytes(PyString_AsString(result), bytes);
         Py_END_ALLOW_THREADS
-        
+
         if (!r) {
                 Py_DECREF(result);
                 mm_SSL_ERR(1);
-                return NULL;  
+                return NULL;
         }
 
         return result;

Index: fec.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/fec.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fec.c	25 Aug 2003 21:05:35 -0000	1.10
+++ fec.c	28 Nov 2003 04:14:05 -0000	1.11
@@ -1,6 +1,6 @@
 /* Portions Copyright (c) 2003 Nick Mathewson.  See LICENCE for licensing
  * information. */
-/* $Id$ */ 
+/* $Id$ */
 
 #include <Python.h>
 #include "_minionlib.h"
@@ -167,7 +167,7 @@
 gf_mul(x,y)
 {
     if ( (x) == 0 || (y)==0 ) return 0;
-     
+
     return gf_exp[gf_log[x] + gf_log[y] ] ;
 }
 #define init_mul_table()
@@ -285,7 +285,7 @@
  * unrolled 16 times, a good value for 486 and pentium-class machines.
  * The case c=0 is also optimized, whereas c=1 is not. These
  * calls are unfrequent in my typical apps so I did not bother.
- * 
+ *
  * Note that gcc on
  */
 #define addmul(dst, src, c, sz) \
@@ -399,7 +399,7 @@
 			}
 		    } else if (ipiv[ix] > 1) {
 			fprintf(stderr, "singular matrix\n");
-			goto fail ; 
+			goto fail ;
 		    }
 		}
 	    }
@@ -507,7 +507,7 @@
     b = NEW_GF_MATRIX(1, k);
 
     p = NEW_GF_MATRIX(1, k);
-   
+
     for ( j=1, i = 0 ; i < k ; i++, j+=k ) {
 	c[i] = 0 ;
 	p[i] = src[j] ;    /* p[i] */
@@ -708,7 +708,7 @@
 	} else
 #endif
 	if (index[i] < code->n )
-	    memcpy(p, &(code->enc_matrix[index[i]*k]), k*sizeof(gf) ); 
+	    memcpy(p, &(code->enc_matrix[index[i]*k]), k*sizeof(gf) );
 	else {
 	    fprintf(stderr, "decode: invalid index %d (max %d)\n",
 		index[i], code->n - 1 );
@@ -737,7 +737,7 @@
 static int
 fec_decode(struct fec_parms *code, gf *pkt[], int index[], int sz)
 {
-    gf *m_dec ; 
+    gf *m_dec ;
     gf **new_pkt ;
     int row, col , k = code->k ;
 
@@ -791,13 +791,13 @@
 typedef struct mm_FEC {
 	PyObject_HEAD
 	struct fec_parms *fec;
-} mm_FEC;	
+} mm_FEC;
 extern PyTypeObject mm_FEC_Type;
 #define mm_FEC_Check(v) ((v)->ob_type == &mm_FEC_Type)
 
 /* **************** */
 
-const char mm_FEC_generate__doc__[] = 
+const char mm_FEC_generate__doc__[] =
  "fec_generate(k,n)\n\n"
  "Return a FEC object to implement k-out-of-n erasure correcting codes, for\n"
  "the provided values of k and n.\n";
@@ -808,17 +808,17 @@
 	static char *kwlist[] = { "k", "n", NULL };
 	int k, n;
 	mm_FEC *output;
-	
+
         if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                                          "ii:FEC_generate", kwlist,
 					 &k, &n))
                 return NULL;
-	
+
 	if (k < 1 || n < 1 || k > 255 || n > 255 || k > n) {
 		PyErr_SetString(mm_FECError, "K or N is out of range");
 		return NULL;
 	}
-	
+
 	if (!(output = PyObject_NEW(mm_FEC, &mm_FEC_Type)))
 		return NULL;
 
@@ -831,7 +831,7 @@
 		PyErr_NoMemory();
 		return NULL;
 	}
-	
+
 	return (PyObject*)output;
 }
 
@@ -843,7 +843,7 @@
         PyObject_DEL(self);
 }
 
-static const char mm_FEC_getParameters__doc__[] = 
+static const char mm_FEC_getParameters__doc__[] =
  "fec.getParameters() -> (k,n)\n\n"
  "Return a 2-tuple of the k and n parameters for this FEC object.\n";
 
@@ -860,7 +860,7 @@
         return Py_BuildValue("ii", fec->k, fec->n);
 }
 
-static const char mm_FEC_encode__doc__[] = 
+static const char mm_FEC_encode__doc__[] =
 "fec.encode(idx,[blocks...])\n\n"
 "Encode a single block of FEC-encoded data.  'idx' is the index of the block\n"
 "to return (0<=idx<N), and 'blocks' is a list of K strings of equal length,\n"
@@ -888,7 +888,7 @@
                 return NULL;
 
         fec = ((mm_FEC*)self)->fec;
-	
+
         /* Check whether the second arg is a sequence of K equally sized
          * strings. */
         if (!PySequence_Check(blocks)) {
@@ -896,7 +896,7 @@
                 return NULL;
         }
         if (PySequence_Size(blocks) != fec->k) {
-                PyErr_SetString(mm_FECError, 
+                PyErr_SetString(mm_FECError,
                                 "encode expects a list of length K");
                 return NULL;
         }
@@ -904,7 +904,7 @@
                 PyErr_SetString(mm_FECError, "idx out of bounds");
                 return NULL;
         }
-                        
+
         /* We hold onto the sequence as a tuple to prevent it changing
          * out from under us, and to temporarily incref all the strings.
          */
@@ -914,24 +914,24 @@
         if (!(stringPtrs = malloc((sizeof(gf*))*fec->k))) {
                 PyErr_NoMemory();
                 goto err;
-        }        
+        }
         for (i = 0; i < fec->k; ++i) {
                 o = PyTuple_GET_ITEM(tup, i);
                 if (!PyString_Check(o)) {
-                        PyErr_SetString(mm_FECError, 
+                        PyErr_SetString(mm_FECError,
                                         "encode expects a list of strings");
                         goto err;
                 }
                 if (sz<0)
                         sz = PyString_Size(o);
                 else if (sz != PyString_Size(o)) {
-                        PyErr_SetString(mm_FECError, 
+                        PyErr_SetString(mm_FECError,
                               "encode expects a list of equally long strings");
                         goto err;
                 }
                 stringPtrs[i] = PyString_AS_STRING(o);
         }
-	
+
         /* We could pull this up, but it's good to do all the checking. */
         if (idx < fec->k) {
                 result = PyTuple_GET_ITEM(tup, idx);
@@ -944,9 +944,9 @@
         if (!(result = PyString_FromStringAndSize(NULL, sz))) {
                 PyErr_NoMemory(); goto err;
         }
-        
+
         Py_BEGIN_ALLOW_THREADS
-        fec_encode(fec, (gf**)stringPtrs, (gf*)PyString_AsString(result), 
+        fec_encode(fec, (gf**)stringPtrs, (gf*)PyString_AsString(result),
                    idx, sz);
         Py_END_ALLOW_THREADS
 
@@ -961,7 +961,7 @@
 	return NULL;
 }
 
-static const char mm_FEC_decode__doc__[] = 
+static const char mm_FEC_decode__doc__[] =
  "fec.decode([ (idx1,block1), (idx2, block2), ...])\n\n"
  "Recover a FEC-encoded string.  This methods expects as input a list of\n"
  "2-tuples, each containing the index (0<=idx<=N) of an encoded block, and\n"
@@ -987,7 +987,7 @@
         char **stringPtrs = NULL;
         int *indices = NULL;
         PyObject *result = NULL;
-        
+
         if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                                          "O:decode", kwlist,
 					 &blocks))
@@ -1002,11 +1002,11 @@
                 return NULL;
         }
         if (PySequence_Size(blocks) != fec->k) {
-                PyErr_SetString(mm_FECError, 
+                PyErr_SetString(mm_FECError,
                                 "decode expects a sequence of length K");
                 return NULL;
         }
-        
+
         /* We hold onto the sequence as a tuple to prevent it changing
          * out from under us, and to temporarily incref all the strings.
          */
@@ -1028,14 +1028,14 @@
         for (i = 0; i < fec->k; ++i) {
                 o = PyTuple_GET_ITEM(tup, i);
                 if (!PyArg_ParseTuple(o, "is#", &j, &s, &tmp)) {
-                        PyErr_SetString(mm_FECError, 
+                        PyErr_SetString(mm_FECError,
                                "decode expects a list of index-string tuples");
                         goto err;
                 }
                 if (sz<0) {
                         sz = tmp;
                 } else if (sz != tmp) {
-                        PyErr_SetString(mm_FECError, 
+                        PyErr_SetString(mm_FECError,
                               "decode expects equally long strings");
                         goto err;
                 }
@@ -1057,7 +1057,7 @@
          * keep Python strings nice and immutable.
          *
          * This way, we never allocate more memory than we need.
-         * 
+         *
          */
         for (i = 0; i < fec->k; ++i) {
                 o = objPtrs[i];
@@ -1068,16 +1068,16 @@
                         stringPtrs[i] = PyString_AS_STRING(o);
                 } else {
                         o = PyString_FromStringAndSize(NULL, sz);
-                        memcpy(PyString_AS_STRING(o), 
+                        memcpy(PyString_AS_STRING(o),
                                PyString_AS_STRING(objPtrs[i]), sz);
                         PyList_SET_ITEM(result, i, o);
                         stringPtrs[i] = PyString_AS_STRING(o);
-                }                                                    
+                }
         }
         Py_BEGIN_ALLOW_THREADS
         tmp = fec_decode(fec, (gf**) stringPtrs, (int*) indices, sz);
-        Py_END_ALLOW_THREADS 
-              
+        Py_END_ALLOW_THREADS
+
         if (tmp)
                 goto err;
 
@@ -1114,7 +1114,7 @@
         return Py_FindMethod(mm_FEC_methods, self, name);
 }
 
-static const char mm_FEC_Type__doc__[] = 
+static const char mm_FEC_Type__doc__[] =
  "Type to implement forward error correction based on Vandermonde matrices.\n"
  "The algorithm is from Luigi Rizzo; the underlying code is copyright\n"
  "1997-1998 Luigi Rizzo; see fec.c for more information.\n";

Index: tls.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/tls.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- tls.c	19 Oct 2003 05:21:45 -0000	1.30
+++ tls.c	28 Nov 2003 04:14:05 -0000	1.31
@@ -602,9 +602,9 @@
                 MM_TLS_ERR("Certificate has expired");
                 goto error;
         }
-        
+
         X509_free(cert);
-        
+
         Py_INCREF(Py_None);
         return Py_None;
  error: