summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-18 12:51:25 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-10-19 16:40:25 +0200
commit056228aae33642013053288a932a65c93271b0be (patch)
treee78bd75206796e0ecf129d50ef100161d8f20be1
parent29e1d4322dcef1c7f45d97ffbe3d9887e41eb453 (diff)
downloadlibnitrokey-056228aae33642013053288a932a65c93271b0be.tar.gz
libnitrokey-056228aae33642013053288a932a65c93271b0be.tar.bz2
Code refactoring: c++ casts
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--include/device_proto.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/device_proto.h b/include/device_proto.h
index 15e3636..81cf93e 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -214,7 +214,7 @@ namespace nitrokey {
outp.update_CRC();
Log::instance()("Outgoing HID packet:", Loglevel::DEBUG);
- Log::instance()((std::string) (outp), Loglevel::DEBUG);
+ Log::instance()(static_cast<std::string>(outp), Loglevel::DEBUG);
if (!outp.isValid()) throw std::runtime_error("Invalid outgoing packet");
@@ -225,7 +225,7 @@ namespace nitrokey {
if (status <= 0)
throw std::runtime_error(
std::string("Device error while sending command ") +
- std::to_string((int) (status)));
+ std::to_string(status));
std::this_thread::sleep_for(dev.get_send_receive_delay());
@@ -277,7 +277,7 @@ namespace nitrokey {
"Device is not ready or received packet's last CRC is not equal to sent CRC packet, retrying...",
Loglevel::DEBUG);
Log::instance()("Invalid incoming HID packet:", Loglevel::DEBUG_L2);
- Log::instance()((std::string) (resp), Loglevel::DEBUG_L2);
+ Log::instance()(static_cast<std::string>(resp), Loglevel::DEBUG_L2);
std::this_thread::sleep_for(dev.get_retry_timeout());
continue;
}
@@ -297,7 +297,7 @@ namespace nitrokey {
std::to_string(status));
Log::instance()("Incoming HID packet:", Loglevel::DEBUG);
- Log::instance()((std::string) (resp), Loglevel::DEBUG);
+ Log::instance()(static_cast<std::string>(resp), Loglevel::DEBUG);
Log::instance()(std::string("receiving_retry_counter count: ") + std::to_string(receiving_retry_counter),
Loglevel::DEBUG);