fix missed static array specifier
This commit is contained in:
parent
132be5101f
commit
7c9679bf6a
|
@ -560,7 +560,7 @@ namespace libtorrent
|
|||
// an empty string.
|
||||
char const* operation_str() const
|
||||
{
|
||||
char const* ops[] =
|
||||
static char const* ops[] =
|
||||
{
|
||||
"", "stat", "mkdir", "open", "rename", "remove", "copy"
|
||||
, "read", "write", "fallocate", "allocate cache piece"
|
||||
|
|
|
@ -1110,7 +1110,7 @@ namespace libtorrent {
|
|||
std::string anonymous_mode_alert::message() const
|
||||
{
|
||||
char msg[200];
|
||||
char const* msgs[] = {
|
||||
static char const* msgs[] = {
|
||||
"tracker is not anonymous, set a proxy"
|
||||
};
|
||||
snprintf(msg, sizeof(msg), "%s: %s: %s"
|
||||
|
|
|
@ -201,7 +201,7 @@ namespace libtorrent
|
|||
out_policy = settings_pack::pe_disabled;
|
||||
#endif
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
char const* policy_name[] = {"forced", "enabled", "disabled"};
|
||||
static char const* policy_name[] = {"forced", "enabled", "disabled"};
|
||||
TORRENT_ASSERT(out_policy < sizeof(policy_name)/sizeof(policy_name[0]));
|
||||
peer_log(peer_log_alert::info, "ENCRYPTION"
|
||||
, "outgoing encryption policy: %s", policy_name[out_policy]);
|
||||
|
@ -561,7 +561,7 @@ namespace libtorrent
|
|||
crypto_provide = settings_pack::pe_both;
|
||||
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
char const* level[] = {"plaintext", "rc4", "plaintext rc4"};
|
||||
static char const* level[] = {"plaintext", "rc4", "plaintext rc4"};
|
||||
peer_log(peer_log_alert::info, "ENCRYPTION"
|
||||
, "%s", level[crypto_provide-1]);
|
||||
#endif
|
||||
|
@ -785,7 +785,7 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(t);
|
||||
|
||||
// add handshake to the send buffer
|
||||
const char version_string[] = "BitTorrent protocol";
|
||||
static const char version_string[] = "BitTorrent protocol";
|
||||
const int string_len = sizeof(version_string)-1;
|
||||
|
||||
char handshake[1 + string_len + 8 + 20 + 20];
|
||||
|
@ -1621,7 +1621,7 @@ namespace libtorrent
|
|||
boost::uint32_t error = detail::read_uint32(ptr);
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
error_code ec;
|
||||
char const* err_msg[] = {"no such peer", "not connected", "no support", "no self"};
|
||||
static char const* err_msg[] = {"no such peer", "not connected", "no support", "no self"};
|
||||
peer_log(peer_log_alert::incoming_message, "HOLEPUNCH"
|
||||
, "msg:failed error: %d msg: %s", error
|
||||
, ((error > 0 && error < 5)?err_msg[error-1]:"unknown message id"));
|
||||
|
@ -2833,7 +2833,7 @@ namespace libtorrent
|
|||
rc4_decrypt(wr_recv_buf.begin + 20, 8);
|
||||
wr_recv_buf.begin += 28;
|
||||
|
||||
const char sh_vc[] = {0,0,0,0, 0,0,0,0};
|
||||
static const char sh_vc[] = {0,0,0,0, 0,0,0,0};
|
||||
if (!std::equal(sh_vc, sh_vc+8, recv_buffer.begin + 20))
|
||||
{
|
||||
disconnect(errors::invalid_encryption_constant, op_encryption, 2);
|
||||
|
@ -3167,7 +3167,7 @@ namespace libtorrent
|
|||
recv_buffer = m_recv_buffer.get();
|
||||
|
||||
int packet_size = recv_buffer[0];
|
||||
const char protocol_string[] = "\x13" "BitTorrent protocol";
|
||||
static const char protocol_string[] = "\x13" "BitTorrent protocol";
|
||||
|
||||
if (packet_size != 19 ||
|
||||
memcmp(recv_buffer.begin, protocol_string, 20) != 0)
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace libtorrent
|
|||
|
||||
if (0 == (tracker_req().kind & tracker_request::scrape_request))
|
||||
{
|
||||
const char* event_string[] = {"completed", "started", "stopped", "paused"};
|
||||
static const char* event_string[] = {"completed", "started", "stopped", "paused"};
|
||||
|
||||
char str[1024];
|
||||
const bool stats = tracker_req().send_stats;
|
||||
|
|
|
@ -129,7 +129,7 @@ void upnp::log(char const* msg, mutex::scoped_lock& l)
|
|||
|
||||
void upnp::discover_device_impl(mutex::scoped_lock& l)
|
||||
{
|
||||
const char msearch[] =
|
||||
static const char msearch[] =
|
||||
"M-SEARCH * HTTP/1.1\r\n"
|
||||
"HOST: 239.255.255.250:1900\r\n"
|
||||
"ST:upnp:rootdevice\r\n"
|
||||
|
|
|
@ -268,7 +268,7 @@ namespace libtorrent { namespace
|
|||
TORRENT_ASSERT(!m_pc.associated_torrent().expired());
|
||||
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
char const* names[] = {"request", "data", "dont-have"};
|
||||
static char const* names[] = {"request", "data", "dont-have"};
|
||||
char const* n = "";
|
||||
if (type >= 0 && type < 3) n = names[type];
|
||||
m_pc.peer_log(peer_log_alert::outgoing_message, "UT_METADATA"
|
||||
|
|
|
@ -61,7 +61,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
namespace libtorrent { namespace
|
||||
{
|
||||
const char extension_name[] = "ut_pex";
|
||||
static const char extension_name[] = "ut_pex";
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue