diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdstream.h | 2 | ||||
-rw-r--r-- | lib/sha1.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/fdstream.h b/lib/fdstream.h index a74a5781..af352c2c 100644 --- a/lib/fdstream.h +++ b/lib/fdstream.h @@ -68,7 +68,7 @@ class fdoutbuf : public std::streambuf { // write one character virtual int_type overflow (int_type c) { if (c != EOF) { - char z = c; + char z = static_cast<char>(c); if (write (fd, &z, 1) != 1) { return EOF; } diff --git a/lib/sha1.cpp b/lib/sha1.cpp index cc2e49de..8689d711 100644 --- a/lib/sha1.cpp +++ b/lib/sha1.cpp @@ -552,14 +552,14 @@ void SHA1::PadMessage() /*
* Store the message length as the last 8 octets
*/
- Message_Block[56] = (Length_High >> 24) & 0xFF;
- Message_Block[57] = (Length_High >> 16) & 0xFF;
- Message_Block[58] = (Length_High >> 8) & 0xFF;
- Message_Block[59] = (Length_High) & 0xFF;
- Message_Block[60] = (Length_Low >> 24) & 0xFF;
- Message_Block[61] = (Length_Low >> 16) & 0xFF;
- Message_Block[62] = (Length_Low >> 8) & 0xFF;
- Message_Block[63] = (Length_Low) & 0xFF;
+ Message_Block[56] = static_cast<char>((Length_High >> 24) & 0xFF);
+ Message_Block[57] = static_cast<char>((Length_High >> 16) & 0xFF);
+ Message_Block[58] = static_cast<char>((Length_High >> 8) & 0xFF);
+ Message_Block[59] = static_cast<char>((Length_High) & 0xFF);
+ Message_Block[60] = static_cast<char>((Length_Low >> 24) & 0xFF);
+ Message_Block[61] = static_cast<char>((Length_Low >> 16) & 0xFF);
+ Message_Block[62] = static_cast<char>((Length_Low >> 8) & 0xFF);
+ Message_Block[63] = static_cast<char>((Length_Low) & 0xFF);
ProcessMessageBlock();
}
|