Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: Modules/md5module.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Modules/_io/textio.c ('k') | Modules/mmapmodule.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* MD5 module */ 1 /* MD5 module */
2 2
3 /* This module provides an interface to the MD5 algorithm */ 3 /* This module provides an interface to the MD5 algorithm */
4 4
5 /* See below for information about the original code this module was 5 /* See below for information about the original code this module was
6 based upon. Additional work performed by: 6 based upon. Additional work performed by:
7 7
8 Andrew Kuchling (amk@amk.ca) 8 Andrew Kuchling (amk@amk.ca)
9 Greg Stein (gstein@lyra.org) 9 Greg Stein (gstein@lyra.org)
10 Trevor Perrin (trevp@trevp.net) 10 Trevor Perrin (trevp@trevp.net)
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 assert(in != NULL); 236 assert(in != NULL);
237 assert(md5->curlen <= sizeof(md5->buf)); 237 assert(md5->curlen <= sizeof(md5->buf));
238 238
239 while (inlen > 0) { 239 while (inlen > 0) {
240 if (md5->curlen == 0 && inlen >= MD5_BLOCKSIZE) { 240 if (md5->curlen == 0 && inlen >= MD5_BLOCKSIZE) {
241 md5_compress(md5, (unsigned char *)in); 241 md5_compress(md5, (unsigned char *)in);
242 md5->length += MD5_BLOCKSIZE * 8; 242 md5->length += MD5_BLOCKSIZE * 8;
243 in += MD5_BLOCKSIZE; 243 in += MD5_BLOCKSIZE;
244 inlen -= MD5_BLOCKSIZE; 244 inlen -= MD5_BLOCKSIZE;
245 } else { 245 } else {
246 n = MIN(inlen, (Py_ssize_t)(MD5_BLOCKSIZE - md5->curlen)); 246 n = MIN(inlen, (MD5_BLOCKSIZE - md5->curlen));
247 memcpy(md5->buf + md5->curlen, in, (size_t)n); 247 memcpy(md5->buf + md5->curlen, in, (size_t)n);
248 md5->curlen += n; 248 md5->curlen += n;
249 in += n; 249 in += n;
250 inlen -= n; 250 inlen -= n;
251 if (md5->curlen == MD5_BLOCKSIZE) { 251 if (md5->curlen == MD5_BLOCKSIZE) {
252 md5_compress(md5, md5->buf); 252 md5_compress(md5, md5->buf);
253 md5->length += 8*MD5_BLOCKSIZE; 253 md5->length += 8*MD5_BLOCKSIZE;
254 md5->curlen = 0; 254 md5->curlen = 0;
255 } 255 }
256 } 256 }
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 }; 575 };
576 576
577 PyMODINIT_FUNC 577 PyMODINIT_FUNC
578 PyInit__md5(void) 578 PyInit__md5(void)
579 { 579 {
580 Py_TYPE(&MD5type) = &PyType_Type; 580 Py_TYPE(&MD5type) = &PyType_Type;
581 if (PyType_Ready(&MD5type) < 0) 581 if (PyType_Ready(&MD5type) < 0)
582 return NULL; 582 return NULL;
583 return PyModule_Create(&_md5module); 583 return PyModule_Create(&_md5module);
584 } 584 }
OLDNEW
« no previous file with comments | « Modules/_io/textio.c ('k') | Modules/mmapmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+