diff --git a/src/protocol/CompressionHandler.h b/src/protocol/CompressionHandler.h index b76d655..6073c89 100644 --- a/src/protocol/CompressionHandler.h +++ b/src/protocol/CompressionHandler.h @@ -10,16 +10,17 @@ namespace ts { size_t qlz_compressed_size(const void* payload, size_t payload_length); bool qlz_compress_payload(const void* payload, size_t payload_length, void* buffer, size_t* buffer_length); } + namespace connection { class CompressionHandler { public: CompressionHandler(); - virtual ~CompressionHandler(); + ~CompressionHandler(); bool progressPacketOut(protocol::BasicPacket*, std::string&); bool progressPacketIn(protocol::BasicPacket*, std::string&); - size_t max_packet_size = 16 * 1024; + size_t max_packet_size{16 * 1024}; private: bool compress(protocol::BasicPacket*, std::string &error); bool decompress(protocol::BasicPacket*, std::string &error); diff --git a/src/protocol/Packet.h b/src/protocol/Packet.h index ce456bf..de454f3 100644 --- a/src/protocol/Packet.h +++ b/src/protocol/Packet.h @@ -86,19 +86,19 @@ namespace ts { public: PacketIdManager() : data(new PacketIdManagerData){} ~PacketIdManager() = default; - PacketIdManager(const PacketIdManager& ref) : data(ref.data) {} - PacketIdManager(PacketIdManager&& ref) : data(std::move(ref.data)) {} + PacketIdManager(const PacketIdManager& ref) = default; + PacketIdManager(PacketIdManager&& ref) = default; uint16_t nextPacketId(const PacketTypeInfo &type){ - return static_cast(data->packetCounter[type.type()]++ & 0xFFFF); + return static_cast(data->packetCounter[type.type()]++ & 0xFFFFU); } uint16_t currentPacketId(const PacketTypeInfo &type){ - return static_cast(data->packetCounter[type.type()] & 0xFFFF); + return static_cast(data->packetCounter[type.type()] & 0xFFFFU); } uint16_t generationId(const PacketTypeInfo &type){ - return static_cast((data->packetCounter[type.type()] >> 16) & 0xFFFF); + return static_cast((data->packetCounter[type.type()] >> 16U) & 0xFFFFU); } void reset() {