const static -> static const (thanks gubatron). helps swigs parser

This commit is contained in:
Arvid Norberg 2015-03-14 00:42:27 +00:00
parent 65a9d76938
commit 37225b71ae
20 changed files with 115 additions and 115 deletions

View File

@ -443,7 +443,7 @@ namespace aux {
boost::uint32_t filter; boost::uint32_t filter;
}; };
const static class_mapping v4_classes[] = static const class_mapping v4_classes[] =
{ {
// everything // everything
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(8)">../src/session_impl.cpp:1813</a></td><td>the udp socket(s) should be using the same generic mechanism and not be restricted to a single one we should open a one listen socket for each entry in the listen_interfaces list</td></tr><tr id="8" style="display: none;" colspan="3"><td colspan="3"><h2>the udp socket(s) should be using the same generic </pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(8)">../src/session_impl.cpp:1813</a></td><td>the udp socket(s) should be using the same generic mechanism and not be restricted to a single one we should open a one listen socket for each entry in the listen_interfaces list</td></tr><tr id="8" style="display: none;" colspan="3"><td colspan="3"><h2>the udp socket(s) should be using the same generic
@ -1319,7 +1319,7 @@ void node_impl::lookup_peers(sha1_hash const&amp; info_hash, entry&amp; reply
if (port &lt; 0 || port &gt;= 65536) if (port &lt; 0 || port &gt;= 65536)
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(25)">../src/kademlia/routing_table.cpp:110</a></td><td>use the non deprecated function instead of this one</td></tr><tr id="25" style="display: none;" colspan="3"><td colspan="3"><h2>use the non deprecated function instead of this one</h2><h4>../src/kademlia/routing_table.cpp:110</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> </pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(25)">../src/kademlia/routing_table.cpp:110</a></td><td>use the non deprecated function instead of this one</td></tr><tr id="25" style="display: none;" colspan="3"><td colspan="3"><h2>use the non deprecated function instead of this one</h2><h4>../src/kademlia/routing_table.cpp:110</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
const static int size_exceptions[] = {16, 8, 4, 2}; static const int size_exceptions[] = {16, 8, 4, 2};
if (bucket &lt; int(sizeof(size_exceptions)/sizeof(size_exceptions[0]))) if (bucket &lt; int(sizeof(size_exceptions)/sizeof(size_exceptions[0])))
return m_bucket_size * size_exceptions[bucket]; return m_bucket_size * size_exceptions[bucket];
return m_bucket_size; return m_bucket_size;
@ -7683,4 +7683,4 @@ public:
#endif #endif
</pre></td></tr></table></body></html> </pre></td></tr></table></body></html>

View File

@ -203,7 +203,7 @@ void terminal_size(int* terminal_width, int* terminal_height)
#ifdef _WIN32 #ifdef _WIN32
void apply_ansi_code(int* attributes, bool* reverse, int code) void apply_ansi_code(int* attributes, bool* reverse, int code)
{ {
const static int color_table[8] = static const int color_table[8] =
{ {
0, // black 0, // black
FOREGROUND_RED, // red FOREGROUND_RED, // red
@ -221,10 +221,10 @@ void apply_ansi_code(int* attributes, bool* reverse, int code)
background_mask = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE background_mask = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE
}; };
const static int fg_mask[2] = {foreground_mask, background_mask}; static const int fg_mask[2] = {foreground_mask, background_mask};
const static int bg_mask[2] = {background_mask, foreground_mask}; static const int bg_mask[2] = {background_mask, foreground_mask};
const static int fg_shift[2] = { 0, 4}; static const int fg_shift[2] = { 0, 4};
const static int bg_shift[2] = { 4, 0}; static const int bg_shift[2] = { 4, 0};
if (code == 0) if (code == 0)
{ {

View File

@ -53,7 +53,7 @@ namespace libtorrent
TORRENT_EXPORT char const* operation_name(int op); TORRENT_EXPORT char const* operation_name(int op);
// user defined alerts should use IDs greater than this // user defined alerts should use IDs greater than this
const static int user_alert_id = 10000; static const int user_alert_id = 10000;
// This is a base class for alerts that are associated with a // This is a base class for alerts that are associated with a
// specific torrent. It contains a handle to the torrent. // specific torrent. It contains a handle to the torrent.
@ -63,7 +63,7 @@ namespace libtorrent
torrent_alert(torrent_handle const& h); torrent_alert(torrent_handle const& h);
// internal // internal
const static int alert_type = 0; static const int alert_type = 0;
virtual std::string message() const; virtual std::string message() const;
// The torrent_handle pointing to the torrent this // The torrent_handle pointing to the torrent this
@ -84,8 +84,8 @@ namespace libtorrent
, pid(pi) , pid(pi)
{} {}
const static int alert_type = 1; static const int alert_type = 1;
const static int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual int category() const { return static_category; } virtual int category() const { return static_category; }
virtual std::string message() const; virtual std::string message() const;
@ -108,8 +108,8 @@ namespace libtorrent
, url(u) , url(u)
{} {}
const static int alert_type = 2; static const int alert_type = 2;
const static int static_category = alert::tracker_notification; static const int static_category = alert::tracker_notification;
virtual int category() const { return static_category; } virtual int category() const { return static_category; }
virtual std::string message() const; virtual std::string message() const;
@ -118,7 +118,7 @@ namespace libtorrent
}; };
#define TORRENT_DEFINE_ALERT(name, seq) \ #define TORRENT_DEFINE_ALERT(name, seq) \
const static int alert_type = seq; \ static const int alert_type = seq; \
virtual int type() const { return alert_type; } \ virtual int type() const { return alert_type; } \
virtual std::auto_ptr<alert> clone() const \ virtual std::auto_ptr<alert> clone() const \
{ return std::auto_ptr<alert>(new name(*this)); } \ { return std::auto_ptr<alert>(new name(*this)); } \
@ -137,7 +137,7 @@ namespace libtorrent
{} {}
TORRENT_DEFINE_ALERT(torrent_added_alert, 3); TORRENT_DEFINE_ALERT(torrent_added_alert, 3);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
}; };
@ -162,7 +162,7 @@ namespace libtorrent
{} {}
TORRENT_DEFINE_ALERT(torrent_removed_alert, 4); TORRENT_DEFINE_ALERT(torrent_removed_alert, 4);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
sha1_hash info_hash; sha1_hash info_hash;
@ -195,7 +195,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(read_piece_alert, 5); TORRENT_DEFINE_ALERT(read_piece_alert, 5);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -218,7 +218,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(file_completed_alert, 6); TORRENT_DEFINE_ALERT(file_completed_alert, 6);
const static int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
// refers to the index of the file that completed. // refers to the index of the file that completed.
@ -240,7 +240,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(file_renamed_alert, 7); TORRENT_DEFINE_ALERT(file_renamed_alert, 7);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -266,7 +266,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(file_rename_failed_alert, 8); TORRENT_DEFINE_ALERT(file_rename_failed_alert, 8);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -371,7 +371,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(performance_alert, 9); TORRENT_DEFINE_ALERT(performance_alert, 9);
const static int static_category = alert::performance_warning; static const int static_category = alert::performance_warning;
virtual std::string message() const; virtual std::string message() const;
@ -392,7 +392,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(state_changed_alert, 10); TORRENT_DEFINE_ALERT(state_changed_alert, 10);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
@ -431,7 +431,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(tracker_error_alert, 11); TORRENT_DEFINE_ALERT(tracker_error_alert, 11);
const static int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
int times_in_row; int times_in_row;
@ -455,7 +455,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(tracker_warning_alert, 12); TORRENT_DEFINE_ALERT(tracker_warning_alert, 12);
const static int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
// contains the warning message from the tracker. // contains the warning message from the tracker.
@ -507,7 +507,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(scrape_failed_alert, 14); TORRENT_DEFINE_ALERT(scrape_failed_alert, 14);
const static int static_category = alert::tracker_notification | alert::error_notification; static const int static_category = alert::tracker_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
// contains a message describing the error. // contains a message describing the error.
@ -596,7 +596,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(hash_failed_alert, 18); TORRENT_DEFINE_ALERT(hash_failed_alert, 18);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
int piece_index; int piece_index;
@ -665,7 +665,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(peer_error_alert, 22); TORRENT_DEFINE_ALERT(peer_error_alert, 22);
const static int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
// a NULL-terminated string of the low-level operation that failed, or NULL if // a NULL-terminated string of the low-level operation that failed, or NULL if
@ -692,7 +692,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(peer_connect_alert, 23); TORRENT_DEFINE_ALERT(peer_connect_alert, 23);
const static int static_category = alert::debug_notification; static const int static_category = alert::debug_notification;
virtual std::string message() const; virtual std::string message() const;
int socket_type; int socket_type;
@ -719,7 +719,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24); TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24);
const static int static_category = alert::debug_notification; static const int static_category = alert::debug_notification;
virtual std::string message() const; virtual std::string message() const;
// the kind of socket this peer was connected over // the kind of socket this peer was connected over
@ -772,7 +772,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_finished_alert, 26); TORRENT_DEFINE_ALERT(torrent_finished_alert, 26);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " torrent finished downloading"; } { return torrent_alert::message() + " torrent finished downloading"; }
}; };
@ -792,7 +792,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(piece_finished_alert, 27); TORRENT_DEFINE_ALERT(piece_finished_alert, 27);
const static int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
// the index of the piece that finished // the index of the piece that finished
@ -812,7 +812,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(request_dropped_alert, 28); TORRENT_DEFINE_ALERT(request_dropped_alert, 28);
const static int static_category = alert::progress_notification static const int static_category = alert::progress_notification
| alert::peer_notification; | alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
@ -833,7 +833,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(block_timeout_alert, 29); TORRENT_DEFINE_ALERT(block_timeout_alert, 29);
const static int static_category = alert::progress_notification static const int static_category = alert::progress_notification
| alert::peer_notification; | alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
@ -854,7 +854,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(block_finished_alert, 30); TORRENT_DEFINE_ALERT(block_finished_alert, 30);
const static int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
int block_index; int block_index;
@ -877,7 +877,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(block_downloading_alert, 31); TORRENT_DEFINE_ALERT(block_downloading_alert, 31);
const static int static_category = alert::progress_notification; static const int static_category = alert::progress_notification;
virtual std::string message() const; virtual std::string message() const;
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
@ -921,7 +921,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(storage_moved_alert, 33); TORRENT_DEFINE_ALERT(storage_moved_alert, 33);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const virtual std::string message() const
{ {
return torrent_alert::message() + " moved storage to: " return torrent_alert::message() + " moved storage to: "
@ -948,7 +948,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34); TORRENT_DEFINE_ALERT(storage_moved_failed_alert, 34);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const virtual std::string message() const
{ {
return torrent_alert::message() + " storage move failed. " return torrent_alert::message() + " storage move failed. "
@ -985,7 +985,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_deleted_alert, 35); TORRENT_DEFINE_ALERT(torrent_deleted_alert, 35);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " deleted"; } { return torrent_alert::message() + " deleted"; }
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1010,7 +1010,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_delete_failed_alert, 36); TORRENT_DEFINE_ALERT(torrent_delete_failed_alert, 36);
const static int static_category = alert::storage_notification static const int static_category = alert::storage_notification
| alert::error_notification; | alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ {
@ -1043,7 +1043,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(save_resume_data_alert, 37); TORRENT_DEFINE_ALERT(save_resume_data_alert, 37);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " resume data generated"; } { return torrent_alert::message() + " resume data generated"; }
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1069,7 +1069,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(save_resume_data_failed_alert, 38); TORRENT_DEFINE_ALERT(save_resume_data_failed_alert, 38);
const static int static_category = alert::storage_notification static const int static_category = alert::storage_notification
| alert::error_notification; | alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ {
@ -1097,7 +1097,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_paused_alert, 39); TORRENT_DEFINE_ALERT(torrent_paused_alert, 39);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " paused"; } { return torrent_alert::message() + " paused"; }
}; };
@ -1112,7 +1112,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40); TORRENT_DEFINE_ALERT(torrent_resumed_alert, 40);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " resumed"; } { return torrent_alert::message() + " resumed"; }
}; };
@ -1128,7 +1128,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_checked_alert, 41); TORRENT_DEFINE_ALERT(torrent_checked_alert, 41);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " checked"; } { return torrent_alert::message() + " checked"; }
}; };
@ -1156,7 +1156,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(url_seed_alert, 42); TORRENT_DEFINE_ALERT(url_seed_alert, 42);
const static int static_category = alert::peer_notification | alert::error_notification; static const int static_category = alert::peer_notification | alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ {
return torrent_alert::message() + " url seed (" return torrent_alert::message() + " url seed ("
@ -1192,7 +1192,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(file_error_alert, 43); TORRENT_DEFINE_ALERT(file_error_alert, 43);
const static int static_category = alert::status_notification static const int static_category = alert::status_notification
| alert::error_notification | alert::error_notification
| alert::storage_notification; | alert::storage_notification;
virtual std::string message() const virtual std::string message() const
@ -1228,7 +1228,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(metadata_failed_alert, 44); TORRENT_DEFINE_ALERT(metadata_failed_alert, 44);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " invalid metadata received: " + error.message(); } { return torrent_alert::message() + " invalid metadata received: " + error.message(); }
@ -1271,7 +1271,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(metadata_received_alert, 45); TORRENT_DEFINE_ALERT(metadata_received_alert, 45);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ return torrent_alert::message() + " metadata successfully received"; } { return torrent_alert::message() + " metadata successfully received"; }
}; };
@ -1291,7 +1291,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(udp_error_alert, 46); TORRENT_DEFINE_ALERT(udp_error_alert, 46);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ {
error_code ec; error_code ec;
@ -1318,7 +1318,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(external_ip_alert, 47); TORRENT_DEFINE_ALERT(external_ip_alert, 47);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const virtual std::string message() const
{ {
error_code ec; error_code ec;
@ -1356,7 +1356,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(listen_failed_alert, 48); TORRENT_DEFINE_ALERT(listen_failed_alert, 48);
const static int static_category = alert::status_notification | alert::error_notification; static const int static_category = alert::status_notification | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1393,7 +1393,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(listen_succeeded_alert, 49); TORRENT_DEFINE_ALERT(listen_succeeded_alert, 49);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1424,7 +1424,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(portmap_error_alert, 50); TORRENT_DEFINE_ALERT(portmap_error_alert, 50);
const static int static_category = alert::port_mapping_notification static const int static_category = alert::port_mapping_notification
| alert::error_notification; | alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
@ -1455,7 +1455,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(portmap_alert, 51); TORRENT_DEFINE_ALERT(portmap_alert, 51);
const static int static_category = alert::port_mapping_notification; static const int static_category = alert::port_mapping_notification;
virtual std::string message() const; virtual std::string message() const;
// refers to the mapping index of the port map that failed, i.e. // refers to the mapping index of the port map that failed, i.e.
@ -1482,7 +1482,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(portmap_log_alert, 52); TORRENT_DEFINE_ALERT(portmap_log_alert, 52);
const static int static_category = alert::port_mapping_notification; static const int static_category = alert::port_mapping_notification;
virtual std::string message() const; virtual std::string message() const;
int map_type; int map_type;
@ -1511,7 +1511,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53); TORRENT_DEFINE_ALERT(fastresume_rejected_alert, 53);
const static int static_category = alert::status_notification static const int static_category = alert::status_notification
| alert::error_notification; | alert::error_notification;
virtual std::string message() const virtual std::string message() const
{ {
@ -1554,7 +1554,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(peer_blocked_alert, 54); TORRENT_DEFINE_ALERT(peer_blocked_alert, 54);
const static int static_category = alert::ip_block_notification; static const int static_category = alert::ip_block_notification;
virtual std::string message() const; virtual std::string message() const;
// the address that was blocked. // the address that was blocked.
@ -1588,7 +1588,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_announce_alert, 55); TORRENT_DEFINE_ALERT(dht_announce_alert, 55);
const static int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
address ip; address ip;
@ -1607,7 +1607,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56); TORRENT_DEFINE_ALERT(dht_get_peers_alert, 56);
const static int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
sha1_hash info_hash; sha1_hash info_hash;
@ -1624,7 +1624,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(stats_alert, 57); TORRENT_DEFINE_ALERT(stats_alert, 57);
const static int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;
enum stats_channel enum stats_channel
@ -1675,7 +1675,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(cache_flushed_alert, 58); TORRENT_DEFINE_ALERT(cache_flushed_alert, 58);
const static int static_category = alert::storage_notification; static const int static_category = alert::storage_notification;
}; };
// This alert is posted when a bittorrent feature is blocked because of the // This alert is posted when a bittorrent feature is blocked because of the
@ -1694,7 +1694,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59); TORRENT_DEFINE_ALERT(anonymous_mode_alert, 59);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
enum kind_t enum kind_t
@ -1722,7 +1722,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(lsd_peer_alert, 60); TORRENT_DEFINE_ALERT(lsd_peer_alert, 60);
const static int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
}; };
@ -1741,7 +1741,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(trackerid_alert, 61); TORRENT_DEFINE_ALERT(trackerid_alert, 61);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
// The tracker ID returned by the tracker // The tracker ID returned by the tracker
@ -1756,7 +1756,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62); TORRENT_DEFINE_ALERT(dht_bootstrap_alert, 62);
const static int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
}; };
@ -1774,7 +1774,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(rss_alert, 63); TORRENT_DEFINE_ALERT(rss_alert, 63);
const static int static_category = alert::rss_notification; static const int static_category = alert::rss_notification;
virtual std::string message() const; virtual std::string message() const;
enum state_t enum state_t
@ -1820,7 +1820,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_error_alert, 64); TORRENT_DEFINE_ALERT(torrent_error_alert, 64);
const static int static_category = alert::error_notification | alert::status_notification; static const int static_category = alert::error_notification | alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
// specifies which error the torrent encountered. // specifies which error the torrent encountered.
@ -1843,7 +1843,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_need_cert_alert, 65); TORRENT_DEFINE_ALERT(torrent_need_cert_alert, 65);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1866,7 +1866,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(incoming_connection_alert, 66); TORRENT_DEFINE_ALERT(incoming_connection_alert, 66);
const static int static_category = alert::peer_notification; static const int static_category = alert::peer_notification;
virtual std::string message() const; virtual std::string message() const;
// tells you what kind of socket the connection was accepted // tells you what kind of socket the connection was accepted
@ -1904,7 +1904,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(add_torrent_alert, 67); TORRENT_DEFINE_ALERT(add_torrent_alert, 67);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1924,7 +1924,7 @@ namespace libtorrent
{ {
TORRENT_DEFINE_ALERT(state_update_alert, 68); TORRENT_DEFINE_ALERT(state_update_alert, 68);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1940,7 +1940,7 @@ namespace libtorrent
mmap_cache_alert(error_code const& ec): error(ec) {} mmap_cache_alert(error_code const& ec): error(ec) {}
TORRENT_DEFINE_ALERT(mmap_cache_alert, 69); TORRENT_DEFINE_ALERT(mmap_cache_alert, 69);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
error_code error; error_code error;
@ -1955,7 +1955,7 @@ namespace libtorrent
session_stats_alert() {} session_stats_alert() {}
TORRENT_DEFINE_ALERT(session_stats_alert, 70); TORRENT_DEFINE_ALERT(session_stats_alert, 70);
const static int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -1995,7 +1995,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_update_alert, 71); TORRENT_DEFINE_ALERT(torrent_update_alert, 71);
const static int static_category = alert::status_notification; static const int static_category = alert::status_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -2019,7 +2019,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(rss_item_alert, 72); TORRENT_DEFINE_ALERT(rss_item_alert, 72);
const static int static_category = alert::rss_notification; static const int static_category = alert::rss_notification;
virtual std::string message() const; virtual std::string message() const;
feed_handle handle; feed_handle handle;
@ -2036,7 +2036,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_error_alert, 73); TORRENT_DEFINE_ALERT(dht_error_alert, 73);
const static int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
@ -2062,7 +2062,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_immutable_item_alert, 74); TORRENT_DEFINE_ALERT(dht_immutable_item_alert, 74);
const static int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -2088,7 +2088,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_mutable_item_alert, 75); TORRENT_DEFINE_ALERT(dht_mutable_item_alert, 75);
const static int static_category = alert::error_notification static const int static_category = alert::error_notification
| alert::dht_notification; | alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
virtual bool discardable() const { return false; } virtual bool discardable() const { return false; }
@ -2136,7 +2136,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_put_alert, 76); TORRENT_DEFINE_ALERT(dht_put_alert, 76);
const static int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
// the target hash the item was stored under if this was an *immutable* // the target hash the item was stored under if this was an *immutable*
@ -2158,7 +2158,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(i2p_alert, 77); TORRENT_DEFINE_ALERT(i2p_alert, 77);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
// the error that occurred in the i2p SAM connection // the error that occurred in the i2p SAM connection
@ -2179,7 +2179,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78); TORRENT_DEFINE_ALERT(dht_outgoing_get_peers_alert, 78);
const static int static_category = alert::dht_notification; static const int static_category = alert::dht_notification;
virtual std::string message() const; virtual std::string message() const;
// the info_hash of the torrent we're looking for peers for. // the info_hash of the torrent we're looking for peers for.
@ -2208,7 +2208,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(log_alert, 79); TORRENT_DEFINE_ALERT(log_alert, 79);
const static int static_category = alert::session_log_notification; static const int static_category = alert::session_log_notification;
virtual std::string message() const; virtual std::string message() const;
// the log message // the log message
@ -2231,7 +2231,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(torrent_log_alert, 80); TORRENT_DEFINE_ALERT(torrent_log_alert, 80);
const static int static_category = alert::torrent_log_notification; static const int static_category = alert::torrent_log_notification;
virtual std::string message() const; virtual std::string message() const;
// the log message // the log message
@ -2255,7 +2255,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(peer_log_alert, 81); TORRENT_DEFINE_ALERT(peer_log_alert, 81);
const static int static_category = alert::peer_log_notification; static const int static_category = alert::peer_log_notification;
virtual std::string message() const; virtual std::string message() const;
// the log message // the log message
@ -2274,7 +2274,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(lsd_error_alert, 82); TORRENT_DEFINE_ALERT(lsd_error_alert, 82);
const static int static_category = alert::error_notification; static const int static_category = alert::error_notification;
virtual std::string message() const; virtual std::string message() const;
// The error code // The error code
@ -2348,7 +2348,7 @@ namespace libtorrent
TORRENT_DEFINE_ALERT(dht_stats_alert, 83); TORRENT_DEFINE_ALERT(dht_stats_alert, 83);
const static int static_category = alert::stats_notification; static const int static_category = alert::stats_notification;
virtual std::string message() const; virtual std::string message() const;
// a vector of the currently running DHT lookups. // a vector of the currently running DHT lookups.

View File

@ -123,7 +123,7 @@ POSSIBILITY OF SUCH DAMAGE.
// //
// .. parsed-literal:: // .. parsed-literal::
// //
// const static int alert_type = *<unique alert ID>*; // static const int alert_type = *<unique alert ID>*;
// virtual int type() const { return alert_type; } // virtual int type() const { return alert_type; }
// //
// virtual std::string message() const; // virtual std::string message() const;
@ -131,7 +131,7 @@ POSSIBILITY OF SUCH DAMAGE.
// virtual std::auto_ptr<alert> clone() const // virtual std::auto_ptr<alert> clone() const
// { return std::auto_ptr<alert>(new name(\*this)); } // { return std::auto_ptr<alert>(new name(\*this)); }
// //
// const static int static_category = *<bitmask of alert::category_t flags>*; // static const int static_category = *<bitmask of alert::category_t flags>*;
// virtual int category() const { return static_category; } // virtual int category() const { return static_category; }
// //
// virtual char const* what() const { return *<string literal of the name of this alert>*; } // virtual char const* what() const { return *<string literal of the name of this alert>*; }

View File

@ -78,7 +78,7 @@ namespace libtorrent
struct TORRENT_EXTRA_EXPORT piece_block struct TORRENT_EXTRA_EXPORT piece_block
{ {
const static piece_block invalid; static const piece_block invalid;
piece_block() {} piece_block() {}
piece_block(boost::uint32_t p_index, boost::uint16_t b_index) piece_block(boost::uint32_t p_index, boost::uint16_t b_index)

View File

@ -198,7 +198,7 @@ namespace libtorrent {
std::string tracker_announce_alert::message() const std::string tracker_announce_alert::message() const
{ {
const static char* event_str[] = {"none", "completed", "started", "stopped", "paused"}; static const char* event_str[] = {"none", "completed", "started", "stopped", "paused"};
TORRENT_ASSERT_VAL(event < int(sizeof(event_str)/sizeof(event_str[0])), event); TORRENT_ASSERT_VAL(event < int(sizeof(event_str)/sizeof(event_str[0])), event);
return tracker_alert::message() + " sending announce (" + event_str[event] + ")"; return tracker_alert::message() + " sending announce (" + event_str[event] + ")";
} }
@ -644,7 +644,7 @@ namespace libtorrent {
std::string dht_error_alert::message() const std::string dht_error_alert::message() const
{ {
const static char* const operation_names[] = static const char* const operation_names[] =
{ {
"unknown", "unknown",
"hostname lookup" "hostname lookup"

View File

@ -75,7 +75,7 @@ namespace libtorrent
void assert_print_piece(cached_piece_entry const* pe) void assert_print_piece(cached_piece_entry const* pe)
{ {
const static char* const cache_state[] = static const char* const cache_state[] =
{ {
"write", "volatile-read", "read-lru", "read-lru-ghost", "read-lfu", "read-lfu-ghost" "write", "volatile-read", "read-lru", "read-lru-ghost", "read-lfu", "read-lfu-ghost"
}; };

View File

@ -1239,7 +1239,7 @@ namespace libtorrent
DWORD create_mode; DWORD create_mode;
}; };
const static open_mode_t mode_array[] = static const open_mode_t mode_array[] =
{ {
// read_only // read_only
{GENERIC_READ, OPEN_EXISTING}, {GENERIC_READ, OPEN_EXISTING},
@ -1249,7 +1249,7 @@ namespace libtorrent
{GENERIC_WRITE | GENERIC_READ, OPEN_ALWAYS}, {GENERIC_WRITE | GENERIC_READ, OPEN_ALWAYS},
}; };
const static DWORD attrib_array[] = static const DWORD attrib_array[] =
{ {
FILE_ATTRIBUTE_NORMAL, // no attrib FILE_ATTRIBUTE_NORMAL, // no attrib
FILE_ATTRIBUTE_HIDDEN, // hidden FILE_ATTRIBUTE_HIDDEN, // hidden

View File

@ -1026,7 +1026,7 @@ void node_impl::incoming_request(msg const& m, entry& e)
{ {
// the first 2 entries are for both mutable and // the first 2 entries are for both mutable and
// immutable puts // immutable puts
const static key_desc_t msg_desc[] = { static const key_desc_t msg_desc[] = {
{"token", bdecode_node::string_t, 0, 0}, {"token", bdecode_node::string_t, 0, 0},
{"v", bdecode_node::none_t, 0, 0}, {"v", bdecode_node::none_t, 0, 0},
{"seq", bdecode_node::int_t, 0, key_desc_t::optional}, {"seq", bdecode_node::int_t, 0, key_desc_t::optional},

View File

@ -101,9 +101,9 @@ node_id generate_id_impl(address const& ip_, boost::uint32_t r)
{ {
boost::uint8_t* ip = 0; boost::uint8_t* ip = 0;
const static boost::uint8_t v4mask[] = { 0x03, 0x0f, 0x3f, 0xff }; static const boost::uint8_t v4mask[] = { 0x03, 0x0f, 0x3f, 0xff };
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
const static boost::uint8_t v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; static const boost::uint8_t v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
#endif #endif
boost::uint8_t const* mask = 0; boost::uint8_t const* mask = 0;
int num_octets = 0; int num_octets = 0;

View File

@ -88,7 +88,7 @@ int routing_table::bucket_limit(int bucket) const
{ {
if (!m_settings.extended_routing_table) return m_bucket_size; if (!m_settings.extended_routing_table) return m_bucket_size;
const static int size_exceptions[] = {16, 8, 4, 2}; static const int size_exceptions[] = {16, 8, 4, 2};
if (bucket < int(sizeof(size_exceptions)/sizeof(size_exceptions[0]))) if (bucket < int(sizeof(size_exceptions)/sizeof(size_exceptions[0])))
return m_bucket_size * size_exceptions[bucket]; return m_bucket_size * size_exceptions[bucket];
return m_bucket_size; return m_bucket_size;

View File

@ -377,8 +377,8 @@ time_duration rpc_manager::tick()
{ {
INVARIANT_CHECK; INVARIANT_CHECK;
const static int short_timeout = 1; static const int short_timeout = 1;
const static int timeout = 15; static const int timeout = 15;
// look for observers that have timed out // look for observers that have timed out

View File

@ -242,7 +242,7 @@ namespace aux {
boost::uint32_t filter; boost::uint32_t filter;
}; };
const static class_mapping v4_classes[] = static const class_mapping v4_classes[] =
{ {
// everything // everything
{"0.0.0.0", "255.255.255.255", gfilter}, {"0.0.0.0", "255.255.255.255", gfilter},
@ -257,7 +257,7 @@ namespace aux {
}; };
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
const static class_mapping v6_classes[] = static const class_mapping v6_classes[] =
{ {
// everything // everything
{"::0", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", gfilter}, {"::0", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", gfilter},
@ -1250,7 +1250,7 @@ namespace aux {
boost::uint32_t peer_class_mask = m_peer_class_filter.access(a); boost::uint32_t peer_class_mask = m_peer_class_filter.access(a);
// assign peer class based on socket type // assign peer class based on socket type
const static int mapping[] = { 0, 0, 0, 0, 1, 4, 2, 2, 2, 3}; static const int mapping[] = { 0, 0, 0, 0, 1, 4, 2, 2, 2, 3};
int socket_type = mapping[st]; int socket_type = mapping[st];
// filter peer classes based on type // filter peer classes based on type
peer_class_mask = m_peer_class_type_filter.apply(socket_type, peer_class_mask); peer_class_mask = m_peer_class_type_filter.apply(socket_type, peer_class_mask);

View File

@ -45,7 +45,7 @@ namespace libtorrent
}; };
#define METRIC(category, name) { #category "." #name, counters:: name }, #define METRIC(category, name) { #category "." #name, counters:: name },
const static stats_metric_impl metrics[] = static const stats_metric_impl metrics[] =
{ {
// ``error_peers`` is the total number of peer disconnects // ``error_peers`` is the total number of peer disconnects
// caused by an error (not initiated by this client) and // caused by an error (not initiated by this client) and

View File

@ -57,7 +57,7 @@ namespace libtorrent
bool is_space(char c) bool is_space(char c)
{ {
const static char* ws = " \t\n\r\f\v"; static const char* ws = " \t\n\r\f\v";
return strchr(ws, c) != 0; return strchr(ws, c) != 0;
} }

View File

@ -217,7 +217,7 @@ namespace libtorrent
sha1_hash torrent_handle::info_hash() const sha1_hash torrent_handle::info_hash() const
{ {
boost::shared_ptr<torrent> t = m_torrent.lock(); boost::shared_ptr<torrent> t = m_torrent.lock();
const static sha1_hash empty; static const sha1_hash empty;
if (!t) return empty; if (!t) return empty;
return t->info_hash(); return t->info_hash();
} }
@ -602,7 +602,7 @@ namespace libtorrent
std::vector<announce_entry> torrent_handle::trackers() const std::vector<announce_entry> torrent_handle::trackers() const
{ {
const static std::vector<announce_entry> empty; static const std::vector<announce_entry> empty;
TORRENT_SYNC_CALL_RET(std::vector<announce_entry>, empty, trackers); TORRENT_SYNC_CALL_RET(std::vector<announce_entry>, empty, trackers);
return r; return r;
} }
@ -619,7 +619,7 @@ namespace libtorrent
std::set<std::string> torrent_handle::url_seeds() const std::set<std::string> torrent_handle::url_seeds() const
{ {
const static std::set<std::string> empty; static const std::set<std::string> empty;
TORRENT_SYNC_CALL_RET1(std::set<std::string>, empty, web_seeds, web_seed_entry::url_seed); TORRENT_SYNC_CALL_RET1(std::set<std::string>, empty, web_seeds, web_seed_entry::url_seed);
return r; return r;
} }
@ -636,7 +636,7 @@ namespace libtorrent
std::set<std::string> torrent_handle::http_seeds() const std::set<std::string> torrent_handle::http_seeds() const
{ {
const static std::set<std::string> empty; static const std::set<std::string> empty;
TORRENT_SYNC_CALL_RET1(std::set<std::string>, empty, web_seeds, web_seed_entry::http_seed); TORRENT_SYNC_CALL_RET1(std::set<std::string>, empty, web_seeds, web_seed_entry::http_seed);
return r; return r;
} }

View File

@ -195,7 +195,7 @@ namespace libtorrent
#if !TORRENT_USE_UNC_PATHS && defined TORRENT_WINDOWS #if !TORRENT_USE_UNC_PATHS && defined TORRENT_WINDOWS
// if we're not using UNC paths on windows, there // if we're not using UNC paths on windows, there
// are certain filenames we're not allowed to use // are certain filenames we're not allowed to use
const static char const* reserved_names[] = static const char const* reserved_names[] =
{ {
"con", "prn", "aux", "clock$", "nul", "con", "prn", "aux", "clock$", "nul",
"com0", "com1", "com2", "com3", "com4", "com0", "com1", "com2", "com3", "com4",

View File

@ -86,7 +86,7 @@ namespace libtorrent
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
else if (e1.address().is_v6()) else if (e1.address().is_v6())
{ {
const static boost::uint8_t v6mask[][8] = { static const boost::uint8_t v6mask[][8] = {
{ 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55, 0x55 }, { 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55, 0x55 },
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55 }, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55 },
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
@ -107,7 +107,7 @@ namespace libtorrent
#endif #endif
else else
{ {
const static boost::uint8_t v4mask[][4] = { static const boost::uint8_t v4mask[][4] = {
{ 0xff, 0xff, 0x55, 0x55 }, { 0xff, 0xff, 0x55, 0x55 },
{ 0xff, 0xff, 0xff, 0x55 }, { 0xff, 0xff, 0xff, 0x55 },
{ 0xff, 0xff, 0xff, 0xff } { 0xff, 0xff, 0xff, 0xff }

View File

@ -1093,7 +1093,7 @@ int test_main()
} }
// test verify_message // test verify_message
const static key_desc_t msg_desc[] = { static const key_desc_t msg_desc[] = {
{"A", bdecode_node::string_t, 4, 0}, {"A", bdecode_node::string_t, 4, 0},
{"B", bdecode_node::dict_t, 0, key_desc_t::optional | key_desc_t::parse_children}, {"B", bdecode_node::dict_t, 0, key_desc_t::optional | key_desc_t::parse_children},
{"B1", bdecode_node::string_t, 0, 0}, {"B1", bdecode_node::string_t, 0, 0},

View File

@ -98,7 +98,7 @@ boost::shared_ptr<piece_picker> setup_picker(
const int avail = availability[i] - '0'; const int avail = availability[i] - '0';
assert(avail >= 0); assert(avail >= 0);
const static torrent_peer* peers[10] = { &tmp0, &tmp1, &tmp2 static const torrent_peer* peers[10] = { &tmp0, &tmp1, &tmp2
, &tmp3, &tmp4, &tmp5, &tmp6, &tmp7, &tmp8, &tmp9 }; , &tmp3, &tmp4, &tmp5, &tmp6, &tmp7, &tmp8, &tmp9 };
TORRENT_ASSERT(avail < 10); TORRENT_ASSERT(avail < 10);
for (int j = 0; j < avail; ++j) p->inc_refcount(i, peers[j]); for (int j = 0; j < avail; ++j) p->inc_refcount(i, peers[j]);