diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-08 15:18:08 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-08 17:51:15 +0100 |
commit | cb769c62e55599e9f980001830bc61d9fcaa64a9 (patch) | |
tree | 0bf980c385a61cbc8720cf990762ffc1200f9d6a /libqpdf/MD5_native.cc | |
parent | 716381f65a2b2dc72f8da2426ba71aeab02c507f (diff) | |
download | qpdf-cb769c62e55599e9f980001830bc61d9fcaa64a9.tar.zst |
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.
Diffstat (limited to 'libqpdf/MD5_native.cc')
-rw-r--r-- | libqpdf/MD5_native.cc | 30 |
1 files changed, 15 insertions, 15 deletions
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<uint32_t>(inputLen) << 3)) < (static_cast<uint32_t>(inputLen) << 3)) - count[1]++; + count[1]++; count[1] += (static_cast<uint32_t>(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<unsigned char>(input[i] & 0xff); - output[j+1] = static_cast<unsigned char>((input[i] >> 8) & 0xff); - output[j+2] = static_cast<unsigned char>((input[i] >> 16) & 0xff); - output[j+3] = static_cast<unsigned char>((input[i] >> 24) & 0xff); + output[j] = static_cast<unsigned char>(input[i] & 0xff); + output[j+1] = static_cast<unsigned char>((input[i] >> 8) & 0xff); + output[j+2] = static_cast<unsigned char>((input[i] >> 16) & 0xff); + output[j+3] = static_cast<unsigned char>((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<uint32_t>(input[j]) | (static_cast<uint32_t>(input[j+1]) << 8) | - (static_cast<uint32_t>(input[j+2]) << 16) | + (static_cast<uint32_t>(input[j+2]) << 16) | (static_cast<uint32_t>(input[j+3]) << 24); } |