diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-02-24 03:46:21 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-03-04 22:45:16 +0100 |
commit | 30027481f7f9e9191f7c8deea51850b7a76b1b1f (patch) | |
tree | 815af293c2f6e38994e6096a4499be0dc9a476f9 /libqpdf/rijndael.cc | |
parent | babb47948a408ebad12c452ba3fdd78782360167 (diff) | |
download | qpdf-30027481f7f9e9191f7c8deea51850b7a76b1b1f.tar.zst |
Remove all old-style casts from C++ code
Diffstat (limited to 'libqpdf/rijndael.cc')
-rw-r--r-- | libqpdf/rijndael.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libqpdf/rijndael.cc b/libqpdf/rijndael.cc index 64748d82..7f711df7 100644 --- a/libqpdf/rijndael.cc +++ b/libqpdf/rijndael.cc @@ -693,15 +693,17 @@ static const u32 rcon[] = /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; -#define GETU32(plaintext) (((u32)(plaintext)[0] << 24) ^ \ - ((u32)(plaintext)[1] << 16) ^ \ - ((u32)(plaintext)[2] << 8) ^ \ - ((u32)(plaintext)[3])) +#define GETU32(plaintext) \ + ((static_cast<u32>((plaintext)[0]) << 24) ^ \ + (static_cast<u32>((plaintext)[1]) << 16) ^ \ + (static_cast<u32>((plaintext)[2]) << 8) ^ \ + (static_cast<u32>((plaintext)[3]))) -#define PUTU32(ciphertext, st) { (ciphertext)[0] = (u8)((st) >> 24); \ - (ciphertext)[1] = (u8)((st) >> 16); \ - (ciphertext)[2] = (u8)((st) >> 8); \ - (ciphertext)[3] = (u8)(st); } +#define PUTU32(ciphertext, st) { \ + (ciphertext)[0] = static_cast<u8>((st) >> 24); \ + (ciphertext)[1] = static_cast<u8>((st) >> 16); \ + (ciphertext)[2] = static_cast<u8>((st) >> 8); \ + (ciphertext)[3] = static_cast<u8>(st); } /** * Expand the cipher key into the encryption key schedule. |