Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Apr 2, 2017
1 parent 39d4574 commit c153719
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions include/simulator/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ All rights reserved.
#define LIBSIMULATOR_USE_MOVE 0
#endif

#if defined __clang__ || defined __GNUC__
#define LIBSIMULATOR_NO_RETURN __attribute((noreturn))
#elif _MSC_VER
#define LIBSIMULATOR_NO_RETURN __declspec(noreturn)
#else
#define LIBSIMULATOR_NO_RETURN
#endif

#ifdef _MSC_VER
#pragma warning(push)
// warning C4251: X: class Y needs to have dll-interface to be used by clients of struct
Expand Down
8 changes: 4 additions & 4 deletions include/simulator/simulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ namespace sim
return lhs_end == rhs_end;
}

value_type operator*() const { return m_results[m_idx]; }
value_type const* operator->() const { return &m_results[m_idx]; }
value_type operator*() const { assert(m_idx >= 0); return m_results[static_cast<std::size_t>(m_idx)]; }
value_type const* operator->() const { assert(m_idx >= 0); return &m_results[static_cast<std::size_t>(m_idx)]; }

basic_resolver_iterator& operator++() { ++m_idx; return *this; }
basic_resolver_iterator operator++(int)
Expand Down Expand Up @@ -731,9 +731,9 @@ namespace sim
async_write_some_impl(b, handler);
}

void async_write_some(null_buffers const&
void LIBSIMULATOR_NO_RETURN async_write_some(null_buffers const&
, std::function<void(boost::system::error_code const&
, std::size_t)> const& /* handler */)
, std::size_t)> const& /* handler */)
{
if (m_send_handler) abort_send_handler();
assert(false && "not supported yet");
Expand Down
4 changes: 3 additions & 1 deletion src/socks_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ namespace sim
}

std::printf("socks_connection: received %s request address type: %d\n"
, command == 1 ? "CONNECT" : "BIND", atyp);
, command == 1 ? "CONNECT"
: command == 2 ? "BIND"
: "UDP_ASSOCIATE", atyp);

switch (atyp)
{
Expand Down

0 comments on commit c153719

Please sign in to comment.