diff options
author | lloyd <[email protected]> | 2007-10-19 18:11:06 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-10-19 18:11:06 +0000 |
commit | 807b84081f91f1f0cd5255198ce31745d410c28c (patch) | |
tree | 20574311297aee66974abce1fa138b0116aff5fc /modules | |
parent | 11d6a889becbb8fe6c2d78dd60b9673b791c17b9 (diff) |
Remove several uses of old style C casts in favor of C++98's static_cast and
reinterpret_cast
Diffstat (limited to 'modules')
-rw-r--r-- | modules/es_egd/es_egd.cpp | 2 | ||||
-rw-r--r-- | modules/tm_hard/tm_hard.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/es_egd/es_egd.cpp b/modules/es_egd/es_egd.cpp index 0ff19a90b..2c377b387 100644 --- a/modules/es_egd/es_egd.cpp +++ b/modules/es_egd/es_egd.cpp @@ -56,7 +56,7 @@ u32bit EGD_EntropySource::do_poll(byte output[], u32bit length, if(fd == -1) return 0; int len = sizeof(addr.sun_family) + std::strlen(addr.sun_path) + 1; - if(connect(fd, (struct sockaddr*)&addr, len)) + if(connect(fd, reinterpret_cast<struct sockaddr*>(&addr), len)) { close(fd); return 0; } byte buffer[2]; diff --git a/modules/tm_hard/tm_hard.cpp b/modules/tm_hard/tm_hard.cpp index da9aa3fd2..251fc9cfd 100644 --- a/modules/tm_hard/tm_hard.cpp +++ b/modules/tm_hard/tm_hard.cpp @@ -18,11 +18,11 @@ u64bit Hardware_Timer::clock() const #if defined(BOTAN_TARGET_ARCH_IS_IA32) || defined(BOTAN_TARGET_ARCH_IS_AMD64) u32bit rtc_low = 0, rtc_high = 0; asm volatile("rdtsc" : "=d" (rtc_high), "=a" (rtc_low)); - rtc = ((u64bit)rtc_high << 32) | rtc_low; + rtc = (static_cast<u64bit>(rtc_high) << 32) | rtc_low; #elif defined(BOTAN_TARGET_ARCH_IS_PPC) || defined(BOTAN_TARGET_ARCH_IS_PPC64) u32bit rtc_low = 0, rtc_high = 0; asm volatile("mftbu %0; mftb %1" : "=r" (rtc_high), "=r" (rtc_low)); - rtc = ((u64bit)rtc_high << 32) | rtc_low; + rtc = (static_cast<u64bit>(rtc_high) << 32) | rtc_low; #elif defined(BOTAN_TARGET_ARCH_IS_ALPHA) asm volatile("rpcc %0" : "=r" (rtc)); #elif defined(BOTAN_TARGET_ARCH_IS_SPARC64) |