From cb769c62e55599e9f980001830bc61d9fcaa64a9 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 8 Feb 2022 09:18:08 -0500 Subject: WHITESPACE ONLY -- expand tabs in source code This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon. --- libqpdf/MD5_native.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'libqpdf/MD5_native.cc') diff --git a/libqpdf/MD5_native.cc b/libqpdf/MD5_native.cc index df5c9674..d609c464 100644 --- a/libqpdf/MD5_native.cc +++ b/libqpdf/MD5_native.cc @@ -117,7 +117,7 @@ void MD5_native::init() // context. void MD5_native::update(unsigned char *input, - size_t inputLen) + size_t inputLen) { unsigned int i, index, partLen; @@ -127,7 +127,7 @@ void MD5_native::update(unsigned char *input, // Update number of bits if ((count[0] += (static_cast(inputLen) << 3)) < (static_cast(inputLen) << 3)) - count[1]++; + count[1]++; count[1] += (static_cast(inputLen) >> 29); partLen = 64 - index; @@ -135,16 +135,16 @@ void MD5_native::update(unsigned char *input, // Transform as many times as possible. if (inputLen >= partLen) { - memcpy(&buffer[index], input, partLen); - transform(state, buffer); + memcpy(&buffer[index], input, partLen); + transform(state, buffer); - for (i = partLen; i + 63 < inputLen; i += 64) - transform(state, &input[i]); + for (i = partLen; i + 63 < inputLen; i += 64) + transform(state, &input[i]); - index = 0; + index = 0; } else - i = 0; + i = 0; // Buffer remaining input memcpy(&buffer[index], &input[i], inputLen-i); @@ -156,7 +156,7 @@ void MD5_native::finalize() { if (finalized) { - return; + return; } unsigned char bits[8]; @@ -286,10 +286,10 @@ void MD5_native::encode(unsigned char *output, uint32_t *input, size_t len) unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = static_cast(input[i] & 0xff); - output[j+1] = static_cast((input[i] >> 8) & 0xff); - output[j+2] = static_cast((input[i] >> 16) & 0xff); - output[j+3] = static_cast((input[i] >> 24) & 0xff); + output[j] = static_cast(input[i] & 0xff); + output[j+1] = static_cast((input[i] >> 8) & 0xff); + output[j+2] = static_cast((input[i] >> 16) & 0xff); + output[j+3] = static_cast((input[i] >> 24) & 0xff); } } @@ -300,9 +300,9 @@ void MD5_native::decode(uint32_t *output, unsigned char *input, size_t len) unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = + output[i] = static_cast(input[j]) | (static_cast(input[j+1]) << 8) | - (static_cast(input[j+2]) << 16) | + (static_cast(input[j+2]) << 16) | (static_cast(input[j+3]) << 24); } -- cgit v1.2.3-54-g00ecf