Untabify C files. Will watch buildbots.
diff --git a/Modules/shamodule.c b/Modules/shamodule.c
index 6e7b69e..a86e722 100644
--- a/Modules/shamodule.c
+++ b/Modules/shamodule.c
@@ -21,7 +21,7 @@
/* Endianness testing and definitions */
#define TestEndianness(variable) {int i=1; variable=PCT_BIG_ENDIAN;\
- if (*((char*)&i)==1) variable=PCT_LITTLE_ENDIAN;}
+ if (*((char*)&i)==1) variable=PCT_LITTLE_ENDIAN;}
#define PCT_LITTLE_ENDIAN 1
#define PCT_BIG_ENDIAN 0
@@ -31,7 +31,7 @@
typedef unsigned char SHA_BYTE;
#if SIZEOF_INT == 4
-typedef unsigned int SHA_INT32; /* 32-bit integer */
+typedef unsigned int SHA_INT32; /* 32-bit integer */
#else
/* not defined. compilation will die. */
#endif
@@ -45,11 +45,11 @@
typedef struct {
PyObject_HEAD
- SHA_INT32 digest[5]; /* Message digest */
- SHA_INT32 count_lo, count_hi; /* 64-bit bit count */
- SHA_BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */
+ SHA_INT32 digest[5]; /* Message digest */
+ SHA_INT32 count_lo, count_hi; /* 64-bit bit count */
+ SHA_BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */
int Endianness;
- int local; /* unprocessed amount in data */
+ int local; /* unprocessed amount in data */
} SHAobject;
/* When run on a little-endian CPU we need to perform byte reversal on an
@@ -60,7 +60,7 @@
SHA_INT32 value;
if ( Endianness == PCT_BIG_ENDIAN )
- return;
+ return;
byteCount /= sizeof(*buffer);
while (byteCount--) {
@@ -111,48 +111,48 @@
save one boolean operation each - thanks to Rich Schroeppel,
rcs@cs.arizona.edu for discovering this */
-/*#define f1(x,y,z) ((x & y) | (~x & z)) // Rounds 0-19 */
-#define f1(x,y,z) (z ^ (x & (y ^ z))) /* Rounds 0-19 */
-#define f2(x,y,z) (x ^ y ^ z) /* Rounds 20-39 */
-/*#define f3(x,y,z) ((x & y) | (x & z) | (y & z)) // Rounds 40-59 */
-#define f3(x,y,z) ((x & y) | (z & (x | y))) /* Rounds 40-59 */
-#define f4(x,y,z) (x ^ y ^ z) /* Rounds 60-79 */
+/*#define f1(x,y,z) ((x & y) | (~x & z)) // Rounds 0-19 */
+#define f1(x,y,z) (z ^ (x & (y ^ z))) /* Rounds 0-19 */
+#define f2(x,y,z) (x ^ y ^ z) /* Rounds 20-39 */
+/*#define f3(x,y,z) ((x & y) | (x & z) | (y & z)) // Rounds 40-59 */
+#define f3(x,y,z) ((x & y) | (z & (x | y))) /* Rounds 40-59 */
+#define f4(x,y,z) (x ^ y ^ z) /* Rounds 60-79 */
/* SHA constants */
-#define CONST1 0x5a827999L /* Rounds 0-19 */
-#define CONST2 0x6ed9eba1L /* Rounds 20-39 */
-#define CONST3 0x8f1bbcdcL /* Rounds 40-59 */
-#define CONST4 0xca62c1d6L /* Rounds 60-79 */
+#define CONST1 0x5a827999L /* Rounds 0-19 */
+#define CONST2 0x6ed9eba1L /* Rounds 20-39 */
+#define CONST3 0x8f1bbcdcL /* Rounds 40-59 */
+#define CONST4 0xca62c1d6L /* Rounds 60-79 */
/* 32-bit rotate */
-#define R32(x,n) ((x << n) | (x >> (32 - n)))
+#define R32(x,n) ((x << n) | (x >> (32 - n)))
/* the generic case, for when the overall rotation is not unraveled */
-#define FG(n) \
- T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; \
+#define FG(n) \
+ T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; \
E = D; D = C; C = R32(B,30); B = A; A = T
/* specific cases, for when the overall rotation is unraveled */
-#define FA(n) \
+#define FA(n) \
T = R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n; B = R32(B,30)
-#define FB(n) \
+#define FB(n) \
E = R32(T,5) + f##n(A,B,C) + D + *WP++ + CONST##n; A = R32(A,30)
-#define FC(n) \
+#define FC(n) \
D = R32(E,5) + f##n(T,A,B) + C + *WP++ + CONST##n; T = R32(T,30)
-#define FD(n) \
+#define FD(n) \
C = R32(D,5) + f##n(E,T,A) + B + *WP++ + CONST##n; E = R32(E,30)
-#define FE(n) \
+#define FE(n) \
B = R32(C,5) + f##n(D,E,T) + A + *WP++ + CONST##n; D = R32(D,30)
-#define FT(n) \
+#define FT(n) \
A = R32(B,5) + f##n(C,D,E) + T + *WP++ + CONST##n; C = R32(C,30)
/* do SHA transformation */
@@ -167,10 +167,10 @@
longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness);
for (i = 16; i < 80; ++i) {
- W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16];
+ W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16];
- /* extra rotation fix */
- W[i] = R32(W[i], 1);
+ /* extra rotation fix */
+ W[i] = R32(W[i], 1);
}
A = sha_info->digest[0];
B = sha_info->digest[1];
@@ -286,14 +286,14 @@
count = (int) ((lo_bit_count >> 3) & 0x3f);
((SHA_BYTE *) sha_info->data)[count++] = 0x80;
if (count > SHA_BLOCKSIZE - 8) {
- memset(((SHA_BYTE *) sha_info->data) + count, 0,
- SHA_BLOCKSIZE - count);
- sha_transform(sha_info);
- memset((SHA_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
+ memset(((SHA_BYTE *) sha_info->data) + count, 0,
+ SHA_BLOCKSIZE - count);
+ sha_transform(sha_info);
+ memset((SHA_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
}
else {
- memset(((SHA_BYTE *) sha_info->data) + count, 0,
- SHA_BLOCKSIZE - 8 - count);
+ memset(((SHA_BYTE *) sha_info->data) + count, 0,
+ SHA_BLOCKSIZE - 8 - count);
}
/* GJS: note that we add the hi/lo in big-endian. sha_transform will
@@ -402,21 +402,21 @@
/* Create a new string */
retval = PyString_FromStringAndSize(NULL, sizeof(digest) * 2);
if (!retval)
- return NULL;
+ return NULL;
hex_digest = PyString_AsString(retval);
if (!hex_digest) {
- Py_DECREF(retval);
- return NULL;
+ Py_DECREF(retval);
+ return NULL;
}
/* Make hex version of the digest */
for(i=j=0; i<sizeof(digest); i++) {
char c;
c = (digest[i] >> 4) & 0xf;
- c = (c>9) ? c+'a'-10 : c + '0';
+ c = (c>9) ? c+'a'-10 : c + '0';
hex_digest[j++] = c;
c = (digest[i] & 0xf);
- c = (c>9) ? c+'a'-10 : c + '0';
+ c = (c>9) ? c+'a'-10 : c + '0';
hex_digest[j++] = c;
}
return retval;
@@ -441,11 +441,11 @@
}
static PyMethodDef SHA_methods[] = {
- {"copy", (PyCFunction)SHA_copy, METH_NOARGS, SHA_copy__doc__},
- {"digest", (PyCFunction)SHA_digest, METH_NOARGS, SHA_digest__doc__},
+ {"copy", (PyCFunction)SHA_copy, METH_NOARGS, SHA_copy__doc__},
+ {"digest", (PyCFunction)SHA_digest, METH_NOARGS, SHA_digest__doc__},
{"hexdigest", (PyCFunction)SHA_hexdigest, METH_NOARGS, SHA_hexdigest__doc__},
- {"update", (PyCFunction)SHA_update, METH_VARARGS, SHA_update__doc__},
- {NULL, NULL} /* sentinel */
+ {"update", (PyCFunction)SHA_update, METH_VARARGS, SHA_update__doc__},
+ {NULL, NULL} /* sentinel */
};
static PyObject *
@@ -490,12 +490,12 @@
static PyTypeObject SHAtype = {
PyVarObject_HEAD_INIT(NULL, 0)
- "_sha.sha", /*tp_name*/
- sizeof(SHAobject), /*tp_size*/
- 0, /*tp_itemsize*/
+ "_sha.sha", /*tp_name*/
+ sizeof(SHAobject), /*tp_size*/
+ 0, /*tp_itemsize*/
/* methods */
- SHA_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ SHA_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
@@ -512,12 +512,12 @@
Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- SHA_methods, /* tp_methods */
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ SHA_methods, /* tp_methods */
0, /* tp_members */
SHA_getseters, /* tp_getset */
};
@@ -543,7 +543,7 @@
}
if ((new = newSHAobject()) == NULL) {
- PyBuffer_Release(&view);
+ PyBuffer_Release(&view);
return NULL;
}
@@ -551,7 +551,7 @@
if (PyErr_Occurred()) {
Py_DECREF(new);
- PyBuffer_Release(&view);
+ PyBuffer_Release(&view);
return NULL;
}
if (view.len > 0) {
@@ -568,7 +568,7 @@
static struct PyMethodDef SHA_functions[] = {
{"new", (PyCFunction)SHA_new, METH_VARARGS|METH_KEYWORDS, SHA_new__doc__},
- {NULL, NULL} /* Sentinel */
+ {NULL, NULL} /* Sentinel */
};
@@ -586,12 +586,12 @@
return;
m = Py_InitModule("_sha", SHA_functions);
if (m == NULL)
- return;
+ return;
/* Add some symbolic constants to the module */
insint("blocksize", 1); /* For future use, in case some hash
functions require an integral number of
- blocks */
+ blocks */
insint("digestsize", 20);
insint("digest_size", 20);
}