Skip to content

Commit 08e83ea

Browse files
authored
Merge pull request #145 from limitedAtonement/master
Remove unused parameters and reorder constructors to get rid of warnings
2 parents d38c233 + aee175e commit 08e83ea

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

src/internal/sio_client_impl.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ namespace sio
2525
{
2626
/*************************public:*************************/
2727
client_impl::client_impl() :
28-
m_con_state(con_closed),
2928
m_ping_interval(0),
3029
m_ping_timeout(0),
3130
m_network_thread(),
32-
m_reconn_attempts(0xFFFFFFFF),
33-
m_reconn_made(0),
31+
m_con_state(con_closed),
3432
m_reconn_delay(5000),
35-
m_reconn_delay_max(25000)
33+
m_reconn_delay_max(25000),
34+
m_reconn_attempts(0xFFFFFFFF),
35+
m_reconn_made(0)
3636
{
3737
using websocketpp::log::alevel;
3838
#ifndef DEBUG
@@ -278,12 +278,11 @@ namespace sio
278278
if(ec || m_con.expired())
279279
{
280280
if (ec != boost::asio::error::operation_aborted)
281-
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
281+
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl){};
282282
return;
283283
}
284284
packet p(packet::frame_ping);
285-
m_packet_mgr.encode(p,
286-
[&](bool isBin,shared_ptr<const string> payload)
285+
m_packet_mgr.encode(p, [&](bool /*isBin*/,shared_ptr<const string> payload)
287286
{
288287
lib::error_code ec;
289288
this->m_client.send(this->m_con, *payload, frame::opcode::text, ec);
@@ -363,7 +362,7 @@ namespace sio
363362
}
364363
}
365364

366-
void client_impl::on_fail(connection_hdl con)
365+
void client_impl::on_fail(connection_hdl)
367366
{
368367
m_con.reset();
369368
m_con_state = con_closed;
@@ -447,7 +446,7 @@ namespace sio
447446
}
448447
}
449448

450-
void client_impl::on_message(connection_hdl con, client_type::message_ptr msg)
449+
void client_impl::on_message(connection_hdl, client_type::message_ptr msg)
451450
{
452451
if (m_ping_timeout_timer) {
453452
boost::system::error_code ec;
@@ -493,7 +492,7 @@ namespace sio
493492
m_ping_timer.reset(new boost::asio::deadline_timer(m_client.get_io_service()));
494493
boost::system::error_code ec;
495494
m_ping_timer->expires_from_now(milliseconds(m_ping_interval), ec);
496-
if(ec)LOG("ec:"<<ec.message()<<endl);
495+
if(ec)LOG("ec:"<<ec.message()<<endl){};
497496
m_ping_timer->async_wait(lib::bind(&client_impl::ping,this,lib::placeholders::_1));
498497
LOG("On handshake,sid:"<<m_sid<<",ping interval:"<<m_ping_interval<<",ping timeout"<<m_ping_timeout<<endl);
499498
return;

src/internal/sio_packet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ namespace sio
198198
_frame(frame_message),
199199
_type((isAck?type_ack : type_event) | type_undetermined),
200200
_nsp(nsp),
201-
_message(msg),
202201
_pack_id(pack_id),
202+
_message(msg),
203203
_pending_buffers(0)
204204
{
205205
assert((!isAck
@@ -210,8 +210,8 @@ namespace sio
210210
_frame(frame_message),
211211
_type(type),
212212
_nsp(nsp),
213-
_message(msg),
214213
_pack_id(-1),
214+
_message(msg),
215215
_pending_buffers(0)
216216
{
217217

src/sio_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ namespace sio
8080

8181
private:
8282
//disable copy constructor and assign operator.
83-
client(client const& cl){}
84-
void operator=(client const& cl){}
83+
client(client const&){}
84+
void operator=(client const&){}
8585

8686
client_impl* m_impl;
8787
};

src/sio_socket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ namespace sio
228228

229229
socket::impl::impl(client_impl *client,std::string const& nsp):
230230
m_client(client),
231-
m_nsp(nsp),
232-
m_connected(false)
231+
m_connected(false),
232+
m_nsp(nsp)
233233
{
234234
NULL_GUARD(client);
235235
if(m_client->opened())
@@ -449,7 +449,7 @@ namespace sio
449449
}
450450
}
451451

452-
void socket::impl::ack(int msgId, const string &name, const message::list &ack_message)
452+
void socket::impl::ack(int msgId, const string &, const message::list &ack_message)
453453
{
454454
packet p(m_nsp, ack_message.to_array_message(),msgId,true);
455455
send_packet(p);

src/sio_socket.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ namespace sio
9191

9292
private:
9393
//disable copy constructor and assign operator.
94-
socket(socket const& sock){}
95-
void operator=(socket const& sock){}
94+
socket(socket const&){}
95+
void operator=(socket const&){}
9696

9797
class impl;
9898
impl *m_impl;

0 commit comments

Comments
 (0)