Link Here
|
1 |
--- src/data/memory_chunk.cc |
|
|
2 |
+++ src/data/memory_chunk.cc |
3 |
@@ -54,6 +54,22 @@ |
4 |
|
5 |
namespace torrent { |
6 |
|
7 |
+const int MemoryChunk::prot_exec; |
8 |
+const int MemoryChunk::prot_read; |
9 |
+const int MemoryChunk::prot_write; |
10 |
+const int MemoryChunk::prot_none; |
11 |
+const int MemoryChunk::map_shared; |
12 |
+ |
13 |
+const int MemoryChunk::advice_normal; |
14 |
+const int MemoryChunk::advice_random; |
15 |
+const int MemoryChunk::advice_sequential; |
16 |
+const int MemoryChunk::advice_willneed; |
17 |
+const int MemoryChunk::advice_dontneed; |
18 |
+ |
19 |
+const int MemoryChunk::sync_sync; |
20 |
+const int MemoryChunk::sync_async; |
21 |
+const int MemoryChunk::sync_invalidate; |
22 |
+ |
23 |
uint32_t MemoryChunk::m_pagesize = getpagesize(); |
24 |
|
25 |
inline void |
26 |
--- src/protocol/request_list.cc |
27 |
+++ src/protocol/request_list.cc |
28 |
@@ -52,6 +52,8 @@ |
29 |
|
30 |
namespace torrent { |
31 |
|
32 |
+const int request_list_constants::bucket_count; |
33 |
+ |
34 |
const instrumentation_enum request_list_constants::instrumentation_added[bucket_count] = { |
35 |
INSTRUMENTATION_TRANSFER_REQUESTS_QUEUED_ADDED, |
36 |
INSTRUMENTATION_TRANSFER_REQUESTS_UNORDERED_ADDED, |
37 |
--- src/torrent/data/file.cc |
38 |
+++ src/torrent/data/file.cc |
39 |
@@ -50,6 +50,15 @@ |
40 |
|
41 |
namespace torrent { |
42 |
|
43 |
+const int File::flag_active; |
44 |
+const int File::flag_create_queued; |
45 |
+const int File::flag_resize_queued; |
46 |
+const int File::flag_fallocate; |
47 |
+const int File::flag_previously_created; |
48 |
+ |
49 |
+const int File::flag_prioritize_first; |
50 |
+const int File::flag_prioritize_last; |
51 |
+ |
52 |
File::File() : |
53 |
m_fd(-1), |
54 |
m_protection(0), |
55 |
--- src/torrent/download.cc |
56 |
+++ src/torrent/download.cc |
57 |
@@ -72,6 +72,20 @@ |
58 |
|
59 |
namespace torrent { |
60 |
|
61 |
+const int DownloadInfo::flag_open; |
62 |
+const int DownloadInfo::flag_active; |
63 |
+const int DownloadInfo::flag_compact; |
64 |
+const int DownloadInfo::flag_accepting_new_peers; |
65 |
+const int DownloadInfo::flag_accepting_seeders; |
66 |
+const int DownloadInfo::flag_private; |
67 |
+const int DownloadInfo::flag_meta_download; |
68 |
+const int DownloadInfo::flag_pex_enabled; |
69 |
+const int DownloadInfo::flag_pex_active; |
70 |
+ |
71 |
+const int DownloadInfo::public_flags; |
72 |
+ |
73 |
+const uint32_t DownloadInfo::unlimited; |
74 |
+ |
75 |
const DownloadInfo* Download::info() const { return m_ptr->info(); } |
76 |
const download_data* Download::data() const { return m_ptr->data(); } |
77 |
|
78 |
--- src/torrent/peer/connection_list.cc |
79 |
+++ src/torrent/peer/connection_list.cc |
80 |
@@ -60,6 +60,11 @@ |
81 |
|
82 |
namespace torrent { |
83 |
|
84 |
+const int ConnectionList::disconnect_available; |
85 |
+const int ConnectionList::disconnect_quick; |
86 |
+const int ConnectionList::disconnect_unwanted; |
87 |
+const int ConnectionList::disconnect_delayed; |
88 |
+ |
89 |
ConnectionList::ConnectionList(DownloadMain* download) : |
90 |
m_download(download), m_minSize(50), m_maxSize(100) { |
91 |
} |
92 |
--- src/torrent/utils/log.cc |
93 |
+++ src/torrent/utils/log.cc |
94 |
@@ -189,7 +189,7 @@ |
95 |
pthread_mutex_lock(&log_mutex); |
96 |
std::for_each(m_first, m_last, std::tr1::bind(&log_slot::operator(), |
97 |
std::tr1::placeholders::_1, |
98 |
- buffer, |
99 |
+ (const char*)buffer, |
100 |
std::distance(buffer, first), |
101 |
std::distance(log_groups.begin(), this))); |
102 |
if (dump_data != NULL) |
103 |
--- src/utils/instrumentation.h |
104 |
+++ src/utils/instrumentation.h |
105 |
@@ -39,6 +39,8 @@ |
106 |
|
107 |
#include <tr1/array> |
108 |
|
109 |
+#include <algorithm> |
110 |
+ |
111 |
#include "torrent/common.h" |
112 |
#include "torrent/utils/log.h" |
113 |
|
114 |
@@ -118,7 +120,7 @@ |
115 |
|
116 |
inline void |
117 |
instrumentation_initialize() { |
118 |
- instrumentation_values.assign(int64_t()); |
119 |
+ std::fill(instrumentation_values.begin(), instrumentation_values.end(), int64_t()); |
120 |
} |
121 |
|
122 |
inline void |
123 |
--- src/utils/queue_buckets.h |
124 |
+++ src/utils/queue_buckets.h |
125 |
@@ -251,7 +251,7 @@ |
126 |
instrumentation_update(constants::instrumentation_total[idx], -difference); |
127 |
|
128 |
// Consider moving these to a temporary dequeue before releasing: |
129 |
- std::for_each(begin, end, std::tr1::function<void (value_type)>(&constants::template destroy<value_type>)); |
130 |
+ std::for_each(begin, end, std::tr1::function<void (value_type&)>(&constants::template destroy<value_type>)); |
131 |
queue_at(idx).erase(begin, end); |
132 |
} |
133 |
|
134 |
--- src/torrent/download_info.h |
135 |
+++ src/torrent/download_info.h |
136 |
@@ -52,7 +52,7 @@ |
137 |
|
138 |
// This will become a Download 'handle' of kinds. |
139 |
|
140 |
-class DownloadInfo { |
141 |
+class LIBTORRENT_EXPORT DownloadInfo { |
142 |
public: |
143 |
typedef std::tr1::function<uint64_t ()> slot_stat_type; |
144 |
|