Skip to content

Commit 347107b

Browse files
committed
refactor: replace boost::ignore_unused with attribute
1 parent def8940 commit 347107b

5 files changed

Lines changed: 12 additions & 17 deletions

File tree

include/telnetpp/options/mccp/codec.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#include "telnetpp/core.hpp"
44

5-
#include <boost/exception/all.hpp>
5+
#include <boost/exception/exception.hpp>
66

7+
#include <functional>
78
#include <stdexcept>
89

910
namespace telnetpp::options::mccp {
@@ -49,12 +50,12 @@ class TELNETPP_EXPORT codec
4950
//* =====================================================================
5051
/// \brief A hook for when the transformation stream starts.
5152
//* =====================================================================
52-
virtual void do_start(){};
53+
virtual void do_start() {};
5354

5455
//* =====================================================================
5556
/// \brief A hook for when transformation stream ends.
5657
//* =====================================================================
57-
virtual void do_finish(continuation const & /*cont*/){};
58+
virtual void do_finish(continuation const & /*cont*/) {};
5859

5960
//* =====================================================================
6061
/// \brief Transform the given bytes, sending the transformed data

include/telnetpp/options/naws/client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TELNETPP_EXPORT client : public telnetpp::client_option
2020
explicit client(telnetpp::session &sess) noexcept;
2121

2222
boost::signals2::signal<void(window_dimension, window_dimension)>
23-
on_window_size_changed;
23+
on_window_size_changed; // NOLINT
2424

2525
private:
2626
//* =====================================================================

include/telnetpp/options/terminal_type/client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TELNETPP_EXPORT client : public telnetpp::client_option
2323
//* =====================================================================
2424
void request_terminal_type();
2525

26-
boost::signals2::signal<void(telnetpp::bytes)> on_terminal_type;
26+
boost::signals2::signal<void(telnetpp::bytes)> on_terminal_type; // NOLINT
2727

2828
private:
2929
//* =====================================================================

src/options/mccp/zlib/compressor.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "telnetpp/options/mccp/zlib/compressor.hpp"
22

3-
#include <boost/core/ignore_unused.hpp>
43
#include <zlib.h>
54

65
#include <optional>
@@ -36,8 +35,8 @@ struct compressor::impl
3635

3736
stream_ = z_stream{};
3837

39-
auto result = deflateInit(&*stream_, Z_DEFAULT_COMPRESSION);
40-
boost::ignore_unused(result);
38+
[[maybe_unused]] auto result =
39+
deflateInit(&*stream_, Z_DEFAULT_COMPRESSION);
4140
assert(result == Z_OK);
4241
}
4342

@@ -48,8 +47,7 @@ struct compressor::impl
4847
{
4948
assert(stream_ != std::nullopt);
5049

51-
auto result = deflateEnd(&*stream_);
52-
boost::ignore_unused(result);
50+
[[maybe_unused]] auto result = deflateEnd(&*stream_);
5351
assert(result == Z_OK || result == Z_STREAM_ERROR || Z_DATA_ERROR);
5452

5553
stream_ = std::nullopt;
@@ -134,8 +132,7 @@ telnetpp::bytes compressor::transform_chunk(
134132
pimpl_->stream_->avail_out = output_buffer_size;
135133
pimpl_->stream_->next_out = output_buffer;
136134

137-
auto response = deflate(&*pimpl_->stream_, Z_SYNC_FLUSH);
138-
boost::ignore_unused(response);
135+
[[maybe_unused]] auto response = deflate(&*pimpl_->stream_, Z_SYNC_FLUSH);
139136
assert(response == Z_OK);
140137

141138
auto const output_data =

src/options/mccp/zlib/decompressor.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "telnetpp/options/mccp/zlib/decompressor.hpp"
22

3-
#include <boost/core/ignore_unused.hpp>
43
#include <zlib.h>
54

65
#include <optional>
@@ -36,8 +35,7 @@ struct decompressor::impl
3635

3736
stream_ = z_stream{};
3837

39-
auto result = inflateInit(&*stream_);
40-
boost::ignore_unused(result);
38+
[[maybe_unused]] auto result = inflateInit(&*stream_);
4139
assert(result == Z_OK);
4240
}
4341

@@ -48,8 +46,7 @@ struct decompressor::impl
4846
{
4947
assert(stream_ != std::nullopt);
5048

51-
auto result = inflateEnd(&*stream_);
52-
boost::ignore_unused(result);
49+
[[maybe_unused]] auto result = inflateEnd(&*stream_);
5350
assert(result == Z_OK || result == Z_STREAM_ERROR);
5451

5552
stream_ = std::nullopt;

0 commit comments

Comments
 (0)