diff --git a/src/actions/transformations/remove_whitespace.cc b/src/actions/transformations/remove_whitespace.cc index e69262e5..e0200611 100644 --- a/src/actions/transformations/remove_whitespace.cc +++ b/src/actions/transformations/remove_whitespace.cc @@ -41,7 +41,8 @@ std::string RemoveWhitespace::evaluate(std::string value, * @todo Implement the transformation RemoveWhitespace */ if (assay) { - assay->debug(4, "Transformation RemoveWhitespace is not implemented yet."); + assay->debug(4, "Transformation RemoveWhitespace is " \ + "not implemented yet."); } return value; } diff --git a/src/actions/transformations/replace_comments.cc b/src/actions/transformations/replace_comments.cc index b04cc3b0..8866ea85 100644 --- a/src/actions/transformations/replace_comments.cc +++ b/src/actions/transformations/replace_comments.cc @@ -41,7 +41,8 @@ std::string ReplaceComments::evaluate(std::string value, * @todo Implement the transformation ReplaceComments */ if (assay) { - assay->debug(4, "Transformation ReplaceComments is not implemented yet."); + assay->debug(4, "Transformation ReplaceComments " \ + "is not implemented yet."); } return value; } diff --git a/src/utils/sha1.cc b/src/utils/sha1.cc index cb8f4d70..c029b806 100644 --- a/src/utils/sha1.cc +++ b/src/utils/sha1.cc @@ -57,7 +57,7 @@ void SHA1::update(std::istream *is) { buffer += rest_of_buffer; while (*is) { - uint32 block[BLOCK_INTS]; + uint32_t block[BLOCK_INTS]; buffer_to_block(buffer, block); transform(block); read(is, &buffer, BLOCK_BYTES); @@ -67,7 +67,7 @@ void SHA1::update(std::istream *is) { std::string SHA1::final() { /* Total number of hashed bits */ - uint64 total_bits = (transforms*BLOCK_BYTES + buffer.size()) * 8; + uint64_t total_bits = (transforms*BLOCK_BYTES + buffer.size()) * 8; /* Padding */ buffer += 0x80; @@ -76,7 +76,7 @@ std::string SHA1::final() { buffer += static_cast(0x00); } - uint32 block[BLOCK_INTS]; + uint32_t block[BLOCK_INTS]; buffer_to_block(buffer, block); if (orig_size > BLOCK_BYTES - 8) { @@ -86,7 +86,7 @@ std::string SHA1::final() { } } - /* Append total_bits, split this uint64 into two uint32 */ + /* Append total_bits, split this uint64_t into two uint32_t */ block[BLOCK_INTS - 1] = total_bits; block[BLOCK_INTS - 2] = (total_bits >> 32); transform(block); @@ -119,13 +119,13 @@ void SHA1::reset() { } -void SHA1::transform(uint32 block[BLOCK_BYTES]) { +void SHA1::transform(uint32_t block[BLOCK_BYTES]) { /* Copy digest[] to working vars */ - uint32 a = digest[0]; - uint32 b = digest[1]; - uint32 c = digest[2]; - uint32 d = digest[3]; - uint32 e = digest[4]; + uint32_t a = digest[0]; + uint32_t b = digest[1]; + uint32_t c = digest[2]; + uint32_t d = digest[3]; + uint32_t e = digest[4]; /* Help macros */ #define rol(value, bits) (((value) << (bits)) \ @@ -241,8 +241,8 @@ void SHA1::transform(uint32 block[BLOCK_BYTES]) { void SHA1::buffer_to_block(const std::string &buffer, - uint32 block[BLOCK_BYTES]) { - /* Convert the std::string (byte buffer) to a uint32 array (MSB) */ + uint32_t block[BLOCK_BYTES]) { + /* Convert the std::string (byte buffer) to a uint32_t array (MSB) */ for (unsigned int i = 0; i < BLOCK_INTS; i++) { block[i] = (buffer[4 * i + 3] & 0xff) | (buffer[4 * i + 2] & 0xff) << 8 diff --git a/src/utils/sha1.h b/src/utils/sha1.h index 4a7ef422..e1b42e97 100644 --- a/src/utils/sha1.h +++ b/src/utils/sha1.h @@ -49,26 +49,21 @@ class SHA1 { std::string final(); private: - /* just needs to be at least 32bit */ - typedef unsigned long int uint32; - /* just needs to be at least 64bit */ - typedef unsigned long long uint64; - /* number of 32bit integers per SHA1 digest */ static const unsigned int DIGEST_INTS = 5; /* number of 32bit integers per SHA1 block */ static const unsigned int BLOCK_INTS = 16; static const unsigned int BLOCK_BYTES = BLOCK_INTS * 4; - uint32 digest[DIGEST_INTS]; + uint32_t digest[DIGEST_INTS]; std::string buffer; - uint64 transforms; + uint64_t transforms; void reset(); - void transform(uint32 block[BLOCK_BYTES]); + void transform(uint32_t block[BLOCK_BYTES]); static void buffer_to_block(const std::string &buffer, - uint32 block[BLOCK_BYTES]); + uint32_t block[BLOCK_BYTES]); void read(std::istream *is, std::string *s, int max); };