From 2b956e784e740853a19ed8856f296a166a270e62 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 3 Jul 2018 19:37:43 -0400 Subject: ... --- include/salticidae/msg.h | 15 +++++++++++++-- include/salticidae/netaddr.h | 2 +- include/salticidae/util.h | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/salticidae/msg.h b/include/salticidae/msg.h index 62fc33b..594ac07 100644 --- a/include/salticidae/msg.h +++ b/include/salticidae/msg.h @@ -42,8 +42,8 @@ template::header_size = sizeof(MsgBase) - sizeof(MsgBase::payload) - sizeof(MsgBase::no_payload); + +template +const OpcodeType MsgBase::OPCODE_PING = PING; + +template +const OpcodeType MsgBase::OPCODE_PONG = PONG; + } #endif diff --git a/include/salticidae/netaddr.h b/include/salticidae/netaddr.h index b11f9b3..1b53dff 100644 --- a/include/salticidae/netaddr.h +++ b/include/salticidae/netaddr.h @@ -66,7 +66,7 @@ struct NetAddr { long port; try { port = std::stol(port_str.c_str()); - } catch (std::logic_error) { + } catch (std::logic_error &) { throw SalticidaeError("invalid port format"); } if (port < 0) diff --git a/include/salticidae/util.h b/include/salticidae/util.h index b3eb991..19d87cb 100644 --- a/include/salticidae/util.h +++ b/include/salticidae/util.h @@ -161,7 +161,7 @@ class Config { size_t idx; try { val = stoi(strval, &idx); - } catch (std::invalid_argument) { + } catch (std::invalid_argument &) { throw SalticidaeError("invalid integer"); } } @@ -175,7 +175,7 @@ class Config { size_t idx; try { val = stod(strval, &idx); - } catch (std::invalid_argument) { + } catch (std::invalid_argument &) { throw SalticidaeError("invalid double"); } } -- cgit v1.2.3-70-g09d2