aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/rijndael.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-02-24 03:46:21 +0100
committerJay Berkenbilt <ejb@ql.org>2013-03-04 22:45:16 +0100
commit30027481f7f9e9191f7c8deea51850b7a76b1b1f (patch)
tree815af293c2f6e38994e6096a4499be0dc9a476f9 /libqpdf/rijndael.cc
parentbabb47948a408ebad12c452ba3fdd78782360167 (diff)
downloadqpdf-30027481f7f9e9191f7c8deea51850b7a76b1b1f.tar.zst
Remove all old-style casts from C++ code
Diffstat (limited to 'libqpdf/rijndael.cc')
-rw-r--r--libqpdf/rijndael.cc18
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.