summaryrefslogtreecommitdiff
path: root/Modules/md5module.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-09 15:52:27 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-09 15:52:27 +0000
commit567b94adaaceb622c33f9be1998735dfb95f1707 (patch)
tree435e6e81b103b098c38ca2d5cfc20c27d4e17b54 /Modules/md5module.c
parent043c1cd9525013647c193ccf8686635f09eb4cbf (diff)
downloadcpython-567b94adaaceb622c33f9be1998735dfb95f1707.tar.gz
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r--Modules/md5module.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c
index 6476bb7356..d217dc85fd 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -23,8 +23,8 @@
/* Some useful types */
#if SIZEOF_INT == 4
-typedef unsigned int MD5_INT32; /* 32-bit integer */
-typedef PY_LONG_LONG MD5_INT64; /* 64-bit integer */
+typedef unsigned int MD5_INT32; /* 32-bit integer */
+typedef PY_LONG_LONG MD5_INT64; /* 64-bit integer */
#else
/* not defined. compilation will die. */
#endif
@@ -127,7 +127,7 @@ static void md5_compress(struct md5_state *md5, unsigned char *buf)
for (i = 0; i < 16; i++) {
LOAD32L(W[i], buf + (4*i));
}
-
+
/* copy state */
a = md5->state[0];
b = md5->state[1];
@@ -386,21 +386,21 @@ MD5_hexdigest(MD5object *self, PyObject *unused)
/* Create a new string */
retval = PyUnicode_FromStringAndSize(NULL, MD5_DIGESTSIZE * 2);
if (!retval)
- return NULL;
+ return NULL;
hex_digest = PyUnicode_AS_UNICODE(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<MD5_DIGESTSIZE; 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;
@@ -414,7 +414,7 @@ MD5_update(MD5object *self, PyObject *args)
{
PyObject *obj;
Py_buffer buf;
-
+
if (!PyArg_ParseTuple(args, "O:update", &obj))
return NULL;
@@ -428,11 +428,11 @@ MD5_update(MD5object *self, PyObject *args)
}
static PyMethodDef MD5_methods[] = {
- {"copy", (PyCFunction)MD5_copy, METH_NOARGS, MD5_copy__doc__},
- {"digest", (PyCFunction)MD5_digest, METH_NOARGS, MD5_digest__doc__},
+ {"copy", (PyCFunction)MD5_copy, METH_NOARGS, MD5_copy__doc__},
+ {"digest", (PyCFunction)MD5_digest, METH_NOARGS, MD5_digest__doc__},
{"hexdigest", (PyCFunction)MD5_hexdigest, METH_NOARGS, MD5_hexdigest__doc__},
- {"update", (PyCFunction)MD5_update, METH_VARARGS, MD5_update__doc__},
- {NULL, NULL} /* sentinel */
+ {"update", (PyCFunction)MD5_update, METH_VARARGS, MD5_update__doc__},
+ {NULL, NULL} /* sentinel */
};
static PyObject *
@@ -472,13 +472,13 @@ static PyGetSetDef MD5_getseters[] = {
static PyTypeObject MD5type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "_md5.md5", /*tp_name*/
- sizeof(MD5object), /*tp_size*/
- 0, /*tp_itemsize*/
+ "_md5.md5", /*tp_name*/
+ sizeof(MD5object), /*tp_size*/
+ 0, /*tp_itemsize*/
/* methods */
- MD5_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
+ MD5_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_reserved*/
0, /*tp_repr*/
@@ -494,13 +494,13 @@ static PyTypeObject MD5type = {
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*/
- MD5_methods, /* tp_methods */
- NULL, /* tp_members */
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ MD5_methods, /* tp_methods */
+ NULL, /* tp_members */
MD5_getseters, /* tp_getset */
};
@@ -553,7 +553,7 @@ MD5_new(PyObject *self, PyObject *args, PyObject *kwdict)
static struct PyMethodDef MD5_functions[] = {
{"md5", (PyCFunction)MD5_new, METH_VARARGS|METH_KEYWORDS, MD5_new__doc__},
- {NULL, NULL} /* Sentinel */
+ {NULL, NULL} /* Sentinel */
};
@@ -563,15 +563,15 @@ static struct PyMethodDef MD5_functions[] = {
static struct PyModuleDef _md5module = {
- PyModuleDef_HEAD_INIT,
- "_md5",
- NULL,
- -1,
- MD5_functions,
- NULL,
- NULL,
- NULL,
- NULL
+ PyModuleDef_HEAD_INIT,
+ "_md5",
+ NULL,
+ -1,
+ MD5_functions,
+ NULL,
+ NULL,
+ NULL,
+ NULL
};
PyMODINIT_FUNC