aboutsummaryrefslogtreecommitdiffstats
path: root/src/des.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-07-23 15:44:04 +0000
committerlloyd <[email protected]>2007-07-23 15:44:04 +0000
commite2f1f734277146d817ab284dea21e4013cb5b937 (patch)
tree21ad6ee775e36aa7fb24a504077200c22b1f15b8 /src/des.cpp
parent211c4929ae92106794984d872a0cae1a873baa29 (diff)
Avoid C-style casts (as detected by GCC's -Wold-style-cast) and instead use
static_cast or reinterpret_cast, as needed.
Diffstat (limited to 'src/des.cpp')
-rw-r--r--src/des.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/des.cpp b/src/des.cpp
index e8f173c5c..de95ed5be 100644
--- a/src/des.cpp
+++ b/src/des.cpp
@@ -45,8 +45,8 @@ void DES::IP(u32bit& L, u32bit& R)
(IPTAB1[get_byte(2, L)] << 2) | (IPTAB1[get_byte(3, L)] << 3) |
(IPTAB1[get_byte(0, R)] << 4) | (IPTAB1[get_byte(1, R)] << 5) |
(IPTAB1[get_byte(2, R)] << 6) | (IPTAB2[get_byte(3, R)] );
- L = (u32bit)((T >> 32) & 0xFFFFFFFF);
- R = (u32bit)((T ) & 0xFFFFFFFF);
+ L = static_cast<u32bit>(T >> 32);
+ R = static_cast<u32bit>(T);
}
/*************************************************
@@ -58,8 +58,8 @@ void DES::FP(u32bit& L, u32bit& R)
(FPTAB1[get_byte(2, L)] << 1) | (FPTAB2[get_byte(3, L)] << 1) |
(FPTAB1[get_byte(0, R)] << 4) | (FPTAB1[get_byte(1, R)] << 2) |
(FPTAB1[get_byte(2, R)] ) | (FPTAB2[get_byte(3, R)] );
- L = (u32bit)((T >> 32) & 0xFFFFFFFF);
- R = (u32bit)((T ) & 0xFFFFFFFF);
+ L = static_cast<u32bit>(T >> 32);
+ R = static_cast<u32bit>(T);
}
/*************************************************