]> git.pld-linux.org Git - packages/cDonkey.git/blame - cDonkey-types.patch
- tabs in preamble
[packages/cDonkey.git] / cDonkey-types.patch
CommitLineData
65dce532
JB
1--- cDonkey-0.9.0/misc.h.orig 2003-05-03 19:48:49.000000000 +0000
2+++ cDonkey-0.9.0/misc.h 2003-11-18 14:58:29.000000000 +0000
3@@ -160,7 +160,7 @@
4 unsigned cntFiles (void);
5 unsigned cntSource (void);
6 unsigned cntServer (void);
7-bool encode64(const char *_in, unsigned inlen, char *_out, size_t outmax, size_t *outlen);
8+bool encode64(const char *_in, size_t inlen, char *_out, size_t outmax, size_t *outlen);
9 bool decode64(const char * in, unsigned inlen, char * out, size_t *outlen);
10
11
12--- cDonkey-0.9.0/sCommand.cpp.orig 2003-03-31 23:01:10.000000000 +0000
13+++ cDonkey-0.9.0/sCommand.cpp 2003-11-18 14:42:51.000000000 +0000
14@@ -142,12 +142,12 @@
15 if (0 == strncasecmp ("mcon " , text, strlen ("mcon " ))) {{{
16 TCP_CLIENT_COUNT = atoi (text + strlen("mcon "));
17 TCP_SERVER_COUNT = atoi (text + strlen("mcon "));
18- len = snprintf(out, 128, "max connection = %i\n", TCP_CLIENT_COUNT);
19+ len = snprintf(out, 128, "max connection = %zi\n", TCP_CLIENT_COUNT);
20 goto done;
21 }}}
22 if (0 == strncasecmp ("TCP_CLIENT_COUNT ", text, strlen ("TCP_CLIENT_COUNT "))) {{{
23 TCP_CLIENT_COUNT = atoi (text + strlen("TCP_CLIENT_COUNT "));
24- len = snprintf(out, 128, "TCP client count = %i\n", TCP_CLIENT_COUNT);
25+ len = snprintf(out, 128, "TCP client count = %zi\n", TCP_CLIENT_COUNT);
26 goto done;
27 }}}
28 if (0 == strncasecmp ("TCP_SERVER_COUNT ", text, strlen ("TCP_SERVER_COUNT "))) {{{
29@@ -200,7 +200,7 @@
30 goto done;
31 }}}
32 if (0 == strncasecmp ("vc " , text, strlen ("vc" ))) {{{
33- len = snprintf(out, 128, "%u contacts", overnet.getNumContacts());
34+ len = snprintf(out, 128, "%zu contacts", overnet.getNumContacts());
35 goto done;
36 }}}
37 if (0 == strncasecmp ("s " , text, strlen ("s" ))) {{{
38--- cDonkey-0.9.0/kademlia.cpp.orig 2003-05-07 18:21:34.000000000 +0000
39+++ cDonkey-0.9.0/kademlia.cpp 2003-11-18 14:53:10.000000000 +0000
40@@ -87,7 +87,7 @@
41 if (boot_done) return;
42 size_t cnt = overnet.getNumContacts();
43 if (cnt > 0) {
44- printf("Read %u from contact.dat\n", cnt);
45+ printf("Read %zu from contact.dat\n", cnt);
46 boot_done = true;
47 return;
48 }
49@@ -137,7 +137,7 @@
50 logSend('>', OVERNET_CONNECT, 24 );
51 unsigned char BUF[24];
52 unsigned char *buf = BUF;
53- unsigned int len = 24;
54+ size_t len = 24;
55 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
56 ADD_U1 (&buf, &len, OVERNET_CONNECT);
57 ADD_HASH(&buf, &len, seek_hash);
58@@ -191,7 +191,7 @@
59 logSend('>', OVERNET_HELLO_ACK, 2 );
60 unsigned char BUF[2];
61 unsigned char *buf = BUF;
62- unsigned len = 2;
63+ size_t len = 2;
64 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
65 ADD_U1 (&buf, &len, OVERNET_HELLO_ACK);
66 Write (BUF, 2);
67@@ -201,7 +201,7 @@
68 logSend('>', OVERNET_REQUEST, 19 );
69 unsigned char BUF[19];
70 unsigned char *buf = BUF;
71- unsigned int len, LEN = len = 19;
72+ size_t len, LEN = len = 19;
73 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
74 ADD_U1 (&buf, &len, OVERNET_REQUEST);
75 ADD_U1 (&buf, &len, for_type);
76@@ -293,7 +293,7 @@
77 logSend('>', OVERNET_SEARCH_END, 22);
78 unsigned char BUF[22];
79 unsigned char *buf = BUF;
80- unsigned len = 22;
81+ size_t len = 22;
82 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
83 ADD_U1 (&buf, &len, OVERNET_SEARCH_END);
84 ADD_HASH (&buf, &len, p_hash);
85@@ -305,7 +305,7 @@
86 bool cKademlia::send_Publish (const uint8_t *key, size_t size, const char* name) {{{ // (0x13) Publish an meta description
87 ASSERT(name != NULL);
88 ASSERT(key != NULL);
89- unsigned len, LEN = len = 52+strlen(name);
90+ size_t len, LEN = len = 52+strlen(name);
91 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
92 logSend('>', OVERNET_PUBLISH_REQ, len);
93 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
94@@ -320,7 +320,7 @@
95 return true;
96 }}}
97 bool cKademlia::send_Publish_ack (const uint8_t * p_hash ) {{{ // (0x14) acknowlegde the send_Publish
98- unsigned len, LEN = len = 18;
99+ size_t len, LEN = len = 18;
100 unsigned char BUF[18], *buf = BUF;
101 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
102 ADD_U1 (&buf, &len, OVERNET_PUBLISH_ACK);
103@@ -332,7 +332,7 @@
104 }}}
105 bool cKademlia::send_Identify_reply (void) {{{ // (0x15)
106 logSend('>', OVERNET_IDENTIFY_RES, 25);
107- unsigned int len = 25;
108+ size_t len = 25;
109 unsigned char BUF[25];
110 unsigned char *buf = BUF;
111 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
112@@ -345,7 +345,7 @@
113 }}}
114 bool cKademlia::send_Identify_ack (void) {{{ // (0x16)
115 logSend('>',OVERNET_IDENTIFY_ACK, 4);
116- unsigned int len = 4;
117+ size_t len = 4;
118 unsigned char BUF[4];
119 unsigned char *buf = BUF;
120 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
121@@ -369,7 +369,7 @@
122 bool cKademlia::send_IP_query (void) {{{ // (0x1B) Ask after BOOT what the other see as my ip
123 unsigned char BUF[4];
124 unsigned char *buf = BUF;
125- unsigned len, LEN = len = 4;
126+ size_t len, LEN = len = 4;
127 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
128 ADD_U1 (&buf, &len, OVERNET_IP_REQ);
129 ADD_U2 (&buf, &len, pref.ports.client);
130@@ -380,7 +380,7 @@
131 bool cKademlia::send_IP_answer (void) {{{ // (0x1C) Answer for send_IP_query
132 unsigned char BUF[6];
133 unsigned char *buf = BUF;
134- unsigned len, LEN = len = 6;
135+ size_t len, LEN = len = 6;
136 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
137 ADD_U1 (&buf, &len, OVERNET_IP_RES);
138 ADD_U4 (&buf, &len, peer_ip.s_addr);
139@@ -391,7 +391,7 @@
140 bool cKademlia::send_IP_end (void) {{{ // (0x1D) returned after send_IP_answer
141 unsigned char BUF[2];
142 unsigned char *buf = BUF;
143- unsigned len, LEN = len = 2;
144+ size_t len, LEN = len = 2;
145 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
146 ADD_U1 (&buf, &len, OVERNET_IP_ACK);
147 logSend('>', OVERNET_IP_ACK, LEN);
148@@ -401,7 +401,7 @@
149 bool cKademlia::send_Identify (void) {{{ // (0x1E)
150 unsigned char BUF[2];
151 unsigned char *buf = BUF;
152- unsigned len, LEN = len = 2;
153+ size_t len, LEN = len = 2;
154 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
155 ADD_U1 (&buf, &len, OVERNET_SEARCH_END);
156 // logSend('>', 0x1E, LEN);
157@@ -423,7 +423,7 @@
158 }}}
159 // }}}
160 // recv {{{
161-void cKademlia::parsePeer_lst (unsigned char **buf , unsigned *len, unsigned cnt) {{{
162+void cKademlia::parsePeer_lst (unsigned char **buf , size_t *len, unsigned cnt) {{{
163 for (unsigned i = 0; i < cnt && *len >= 23; i++) {
164 uint8_t p_hash[KAD_HASH_LEN];
165 GET_HASH (buf, len, p_hash);
166@@ -691,7 +691,7 @@
167 case 9 :
168 case 0 : break;
169 }
170- printf("%s %c 0x%04X overnet [%15s](%9u) %-15s [%3u]", currentTime_str, dir, cmd, inet_ntoa(peer_ip), peer_port, op2str(cmd), len);
171+ printf("%s %c 0x%04X overnet [%15s](%9u) %-15s [%3zu]", currentTime_str, dir, cmd, inet_ntoa(peer_ip), peer_port, op2str(cmd), len);
172 if (!extra) printf("\n");
173 return true;
174 }}}
175@@ -731,7 +731,7 @@
176 case 0x21 : break; // TODO WARNING unclear if this opcode is real or an bug
177 default : printf("Protocol %3u (0x%0X) (overnet) (%15s:%5u)\n", proto , proto, inet_ntoa(peer_ip), peer_port);
178 printf("Command %3u (0x%0X) (overnet)\n", cmd, cmd);
179- printf("len: %u\n", LEN);
180+ printf("len: %zu\n", LEN);
181 dump (BUF, LEN);
182 break;
183 }
184--- cDonkey-0.9.0/protocol.cpp.orig 2003-05-03 19:48:50.000000000 +0000
185+++ cDonkey-0.9.0/protocol.cpp 2003-11-18 14:18:18.000000000 +0000
186@@ -13,7 +13,7 @@
187
188 class sTag *parseTag (class sPacket *packet) {{{
189 unsigned char *data = packet->DATA();
190- unsigned len = packet->Unused();
191+ size_t len = packet->Unused();
192 sTag *ret = parse_tag(data, &len);
193 packet->GET_BLIND(len);
194 return ret;
195--- cDonkey-0.9.0/cZone.cpp.orig 2003-05-07 18:21:34.000000000 +0000
196+++ cDonkey-0.9.0/cZone.cpp 2003-11-18 14:53:53.000000000 +0000
197@@ -369,12 +369,12 @@
198 sprintf(ZoneIndex, "%32s", hash_bin2hex(m_zoneIndex));
199 if (prefix == NULL) printf("------------------------------------------------------\n");
200 if (isLeaf()) {
201- printf("Zone level: %i\tZone prefix: %s\tContacts: %i\tZoneIndex: %s\n",
202+ printf("Zone level: %i\tZone prefix: %s\tContacts: %zi\tZoneIndex: %s\n",
203 m_level, (prefix == NULL) ? "ROOT" : prefix, getNumContacts(), ZoneIndex);
204 m_bin->dumpContents();
205 }
206 else {
207- printf("Zone level: %i\tZone prefix: %s\tContacts: %i\tZoneIndex: %s NODE\n",
208+ printf("Zone level: %i\tZone prefix: %s\tContacts: %zi\tZoneIndex: %s NODE\n",
209 m_level, (prefix == NULL) ? "ROOT" : prefix, getNumContacts(), ZoneIndex);
210 char msg[512];
211 sprintf(msg, "%s0", (prefix == NULL) ? "" : prefix);
212--- cDonkey-0.9.0/sTag.cpp.orig 2003-04-05 18:06:46.000000000 +0000
213+++ cDonkey-0.9.0/sTag.cpp 2003-11-18 14:43:57.000000000 +0000
214@@ -65,7 +65,7 @@
215 *dst = *src;
216 *src = NULL;
217 }}}
218-sTag *parse_tag (unsigned char *data, unsigned *len) {{{
219+sTag *parse_tag (unsigned char *data, size_t *len) {{{
220 ASSERT (NULL != data);
221 ASSERT (NULL != len );
222 if (data == NULL) {{{
223--- cDonkey-0.9.0/donkey.cpp.orig 2003-05-07 18:26:57.000000000 +0000
224+++ cDonkey-0.9.0/donkey.cpp 2003-11-18 14:13:22.000000000 +0000
225@@ -336,7 +336,7 @@
226 printf("sSource::count => %i\n", sSource::count);
227 printf("sSource::count0=> %i\n", sSource::count0);
228 printf("sSource::count1=> %i\n", sSource::count1);
229- printf("cSocket::count => %i\n", cSocket::count);
230+ printf("cSocket::count => %zi\n", cSocket::count);
231 printf("sTag ::count => %i\n", sTag::count);
232 }}}
233
234--- cDonkey-0.9.0/sPacket.cpp.orig 2003-04-29 15:33:39.000000000 +0000
235+++ cDonkey-0.9.0/sPacket.cpp 2003-11-18 14:17:44.000000000 +0000
236@@ -164,8 +164,8 @@
237 }}}
238 void sPacket::Dump (void) const {{{
239 printf("\r\nprotokol:%02x\r\n", proto);
240- printf("length : %u\r\n" , pay_len);
241- printf("position : %#08X\r\n", pos);
242+ printf("length : %zu\r\n" , pay_len);
243+ printf("position : %#08zX\r\n", pos);
244 unsigned tmp = opcode;
245 printf("command : 0x%02hx\r\n", tmp);
246 for (uint32_t i=0; i < pay_len - 1; i++) {
247--- cDonkey-0.9.0/sGui.cpp.orig 2003-05-07 18:21:34.000000000 +0000
248+++ cDonkey-0.9.0/sGui.cpp 2003-11-18 14:15:47.000000000 +0000
249@@ -122,7 +122,7 @@
250 unsigned limit = max_cnt * (78 + sizeof(s->name) + sizeof(s->desc));
251 unsigned char *buffer, *BUFFER = buffer = reinterpret_cast<unsigned char*>(alloca (limit));
252 s = nextServers (true);
253- unsigned unused = limit;
254+ size_t unused = limit;
255 unsigned cnt = 0 ;
256 while (s != NULL) { // we have reserved the maximum possible size
257 cnt++;
258@@ -156,7 +156,7 @@
259 if (!auth) return 0;
260 unsigned limit = 3000; // hardcoded ! BAD
261 unsigned char *buffer, *BUFFER = buffer = reinterpret_cast<unsigned char*>(alloca (limit));
262- unsigned unused = limit;
263+ size_t unused = limit;
264 unsigned cnt = 0 ;
265 FILE_LIST {{{
266 if ( ! akt->get_Completed() ) continue;
267@@ -488,7 +488,7 @@
268 ADD_U4 (&buf, &len, TCP_CLIENT_COUNT); // max connections
269 ADD_U4 (&buf, &len, 0x020c0800); // core build date
270 ADD_F4 (&buf, &len, (dlSecond + ulSecond) / 1024.0); // line download speed
271- if (len != 0) printf("len = %i\n", len);
272+ if (len != 0) printf("len = %zi\n", len);
273 ASSERT (len == 0);
274 Write (BUF, LEN);
275 Code(0x01);
276--- cDonkey-0.9.0/kademlia.h.orig 2003-04-27 21:04:24.000000000 +0000
277+++ cDonkey-0.9.0/kademlia.h 2003-11-18 14:52:23.000000000 +0000
278@@ -45,7 +45,7 @@
279
280 private:
281 bool logSend (char dir, unsigned cmd, size_t len, bool extra = false);
282- void parsePeer_lst (unsigned char **buf , unsigned *len, unsigned cnt);
283+ void parsePeer_lst (unsigned char **buf , size_t *len, unsigned cnt);
284 void Init_Search (void);
285 // send Handling {{{
286 bool send_Connect (void ); // (0x0A) request boot list
287--- cDonkey-0.9.0/sSource.cpp.orig 2003-05-07 18:21:35.000000000 +0000
288+++ cDonkey-0.9.0/sSource.cpp 2003-11-18 14:27:57.000000000 +0000
289@@ -97,13 +97,13 @@
290 return true;
291 }}}
292
293-static int res_sources (sSource *, unsigned char *buf, unsigned len) {{{
294+static int res_sources (sSource *, unsigned char *buf, size_t len) {{{
295 tHash hash;
296 unsigned count;
297 GET_HASH(&buf, &len, hash);
298 count = GET_U2(&buf, &len);
299 if (len != count * 12) {{{
300- printf("%s %i len %i count %i USED %i\n", __FILE__, __LINE__, len, count, count*(4+2+4+2));
301+ printf("%s %i len %zi count %i USED %i\n", __FILE__, __LINE__, len, count, count*(4+2+4+2));
302 return 0;
303 }}}
304 for (unsigned i = 0; i < count; i++) {{{
305@@ -366,7 +366,7 @@
306 ADD_U4 (&tcp.buf, &tcp.len, 0);
307 // ADD_U2 (&tcp.buf, &tcp.len, 0);
308 if(tcp.len != 0) {
309- printf("tcp.len = %u\n", tcp.len);
310+ printf("tcp.len = %zu\n", tcp.len);
311 ASSERT(tcp.len == 0);
312 }
313 Write(tcp.BUF, tcp.LEN);
314@@ -452,7 +452,7 @@
315 return 1;
316 }}}
317 if (logSend ('>', this, 0xC540, true))
318- printf("%32s (0x40) (%9u-%9lu) %3lu\n", hash_bin2hex(file->hash), von, pack_len, (pack_len*100)/cnt);
319+ printf("%32s (0x40) (%9zu-%9lu) %3lu\n", hash_bin2hex(file->hash), von, pack_len, (pack_len*100)/cnt);
320 size_t len_real = 6 + HASH_LEN + 4 + 4 + pack_len;
321 ADD_U1 (&buf1, &len1, OP_EMULEPROT);
322 ADD_U4 (&buf1, &len1, len_real - PACKET_LEN_SUB);
323@@ -467,7 +467,7 @@
324 file->compress_failed ++;
325 }}}
326 // Not Compressed Handling
327- if (logSend ('>', this, OP_SENDINGPART, true)) printf("%32s (%9i-%9i)\n", hash_bin2hex(file->hash), von, bis-von);
328+ if (logSend ('>', this, OP_SENDINGPART, true)) printf("%32s (%9zi-%9zi)\n", hash_bin2hex(file->hash), von, bis-von);
329 file->ulCount (cnt);
330 Write (BUF, LEN);
331 return 1;
332@@ -554,7 +554,7 @@
333 return 0; // if first is always set
334 }
335 if (proto_log)
336- printf("[%9i-%9i][%9i-%9i][%9i-%9i]\n", dl_von[0], dl_bis[0], dl_von[1], dl_bis[1], dl_von[2], dl_bis[2]);
337+ printf("[%9zi-%9zi][%9zi-%9zi][%9zi-%9zi]\n", dl_von[0], dl_bis[0], dl_von[1], dl_bis[1], dl_von[2], dl_bis[2]);
338 size_t len, LEN = len = 46;
339 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
340 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
341@@ -575,7 +575,7 @@
342 }}}
343 int sSource::no_such_file (const tHash &hash ) {{{ // (0x48)
344 logSend ('>', this, OP_FILEREQANSNOFIL, false);
345- unsigned LEN , len = LEN = 22;
346+ size_t LEN , len = LEN = 22;
347 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
348 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
349 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
350@@ -587,7 +587,7 @@
351 }}}
352 int sSource::end_of_download (void ) {{{ // (0x49) o.p.
353 logSend ('>', this, OP_END_OF_DOWNLOAD, false);
354- unsigned LEN , len = LEN = 22;
355+ size_t LEN , len = LEN = 22;
356 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
357 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
358 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
359@@ -671,7 +671,7 @@
360 dlFile(old_dl);
361
362 if (logSend('>', this, OP_SETREQFILEID, true)) printf("%32s\n", hash_bin2hex(hash));
363- unsigned LEN , len = LEN = 22;
364+ size_t LEN , len = LEN = 22;
365 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
366 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
367 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
368@@ -706,7 +706,7 @@
369 }}}
370 int sSource::req_part_hash (const tHash &hash ) {{{ // (0x51) o.p. <HASH>
371 if (logSend('>', this, OP_HASHSETREQUEST, true)) printf("%32s\n", hash_bin2hex(hash));
372- unsigned LEN , len = LEN = 22;
373+ size_t LEN , len = LEN = 22;
374 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
375 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
376 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
377@@ -738,7 +738,7 @@
378 if (next_slot >= currentTime) return 1;
379 next_slot = currentTime + 300;
380 logSend('>', this, OP_STARTUPLOADREQ, false);
381- unsigned LEN, len = LEN = 22;
382+ size_t LEN, len = LEN = 22;
383 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
384 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
385 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
386@@ -750,7 +750,7 @@
387 }}}
388 int sSource::CMD_slot_available (void ) {{{ // (0x55) o.p. (null)
389 logSend('>', this, OP_ACCEPTUPLOADREQ, false);
390- unsigned LEN, len = LEN = 6;
391+ size_t LEN, len = LEN = 6;
392 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
393 ADD_U1(&buf, &len, OP_EDONKEYHEADER);
394 ADD_U4(&buf, &len, LEN - PACKET_LEN_SUB);
395@@ -760,7 +760,7 @@
396 }}}
397 int sSource::res_slot_close (void ) {{{ // (0x57) o.p. (null)
398 logSend('>', this, OP_OUTOFPARTREQS, false);
399- unsigned LEN, len = LEN = 6;
400+ size_t LEN, len = LEN = 6;
401 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
402 ADD_U1(&buf, &len, OP_EDONKEYHEADER);
403 ADD_U4(&buf, &len, LEN - PACKET_LEN_SUB);
404@@ -784,7 +784,7 @@
405 }
406 dlFile(old_dl);
407 if (logSend('>', this, OP_FILEREQUEST, true)) printf("%32s\n", hash_bin2hex(hash));
408- unsigned LEN , len = LEN = 22;
409+ size_t LEN , len = LEN = 22;
410 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
411 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
412 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
413@@ -812,7 +812,7 @@
414 }}}
415 int sSource::C5_res_rang (uint8_t rang ) {{{ // (0x60) o.p. <RANG(2)><padding(10)>
416 if (logSend ('>', this,0xC560, true)) printf("%hi\n", rang);
417- unsigned LEN , len = LEN = 18;
418+ size_t LEN , len = LEN = 18;
419 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
420 ADD_U1 (&buf, &len, OP_EMULEPROT);
421 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
422@@ -831,7 +831,7 @@
423 nextFile (hash, true); // <- set cursor_count
424 if (cursor_count > 512) return 1;
425 if(logSend ('>', this , 0xC581, true)) printf("%32s\n", hash_bin2hex(hash));
426- unsigned LEN , len = LEN = 22;
427+ size_t LEN , len = LEN = 22;
428 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
429 ADD_U1 (&buf, &len, OP_EMULEPROT);
430 ADD_U4 (&buf, &len, LEN - PACKET_LEN_SUB);
431@@ -875,7 +875,7 @@
432
433 if (name == NULL) Name ("(null)");
434 if (log) printf("v.%4u NAME: %s e:%i", version, name, eMule);
435- if (log) printf(" LEN: %i\n", packet->Unused());
436+ if (log) printf(" LEN: %zi\n", packet->Unused());
437
438 if (status == WAIT_HELLO) {
439 client_info(0x4C);
440@@ -1002,7 +1002,7 @@
441 if (tag->version == 43) overnet = true;
442 if (tag->version == 1044) overnet = true;
443 if (tag->name != NULL) Name (tag->name);
444- if (log) printf("v.%4u NAME %s LEN: %i\n", tag->version, tag->name, packet->Unused());
445+ if (log) printf("v.%4u NAME %s LEN: %zi\n", tag->version, tag->name, packet->Unused());
446 delete tag;
447 }
448 else printf("(noTag)\n");
449@@ -1044,7 +1044,7 @@
450 no_such_file (hash);
451 return 1;
452 }
453- if(logSend ('<', this, OP_SETREQFILEID, true)) printf("%32s OK len:%i\n", hash_bin2hex(hash),packet->Unused());
454+ if(logSend ('<', this, OP_SETREQFILEID, true)) printf("%32s OK len:%zi\n", hash_bin2hex(hash),packet->Unused());
455 res_part_status (hash);
456 return 1;
457 }}}
458@@ -1052,12 +1052,12 @@
459 int sSource::RES_status (sPacket *packet) {{{ // (0x50) Return file Status
460 if (ftp_aktive) return 1;
461 if (packet->Unused() <= 18) {{{
462- printf("MALFORMED PACKET 0x50 from %s LEN %u\n", inet_ntoa(peer_ip), packet->Unused());
463+ printf("MALFORMED PACKET 0x50 from %s LEN %zu\n", inet_ntoa(peer_ip), packet->Unused());
464 return 0;
465 }}}
466 tHash hash;
467 if (packet->Unused() < 18) {{{
468- printf("MALFORMED PACKET 0x50 from %15s LEN %5u VERSION %4u NAME %s\n", inet_ntoa(peer_ip), packet->Unused(), version, name);
469+ printf("MALFORMED PACKET 0x50 from %15s LEN %5zu VERSION %4u NAME %s\n", inet_ntoa(peer_ip), packet->Unused(), version, name);
470 IP_block (peer_ip);
471 Close();
472 return 0;
473@@ -1165,7 +1165,7 @@
474 return 1;
475 }}}
476 int sSource::REQ_slot (sPacket *packet) {{{ // (0x54)
477- if (logSend('<', this, OP_STARTUPLOADREQ, true)) printf("len %i\n", packet->Unused());
478+ if (logSend('<', this, OP_STARTUPLOADREQ, true)) printf("len %zi\n", packet->Unused());
479 extraSend (OP_ACCEPTUPLOADREQ);
480 return 1;
481 }}}
482--- cDonkey-0.9.0/sServer.cpp.orig 2003-05-07 18:21:34.000000000 +0000
483+++ cDonkey-0.9.0/sServer.cpp 2003-11-18 14:34:14.000000000 +0000
484@@ -458,7 +458,7 @@
485 // Name speicher
486 delete tag;
487 unsigned char *ende = packet->DATA();
488- printf("Got file info_lei = %i\n", ende - start);
489+ printf("Got file info_lei = %ti\n", (ptrdiff_t)(ende - start));
490 insertFiles (hash, peer_ip, ende - start, start);
491 }
492 return 1;
493@@ -523,7 +523,7 @@
494 // printf ("ed2k://|file|%s|%u|%s|\n", tag->name, tag->size, hash_bin2hex (hash));
495 delete tag;
496 unsigned char *ende = packet->DATA();
497- printf("Got file info_len = %i\n", ende - start);
498+ printf("Got file info_len = %ti\n", (ptrdiff_t)(ende - start));
499 insertFiles (hash, peer_ip, ende - start, start);
500 }}}
501 return 1;
502@@ -661,7 +661,7 @@
503 char *key;
504 cTreeSearch(void);
505 ~cTreeSearch(void);
506- bool Parse (unsigned char *data, unsigned len);
507+ bool Parse (unsigned char *data, size_t len);
508 bool Match (void) { return false; }
509 };
510 cTreeSearch:: cTreeSearch(void) {{{
511@@ -678,7 +678,7 @@
512 if (val_str != NULL) Free2 (val_str);
513 if (key != NULL) Free2 (key );
514 }}}
515-bool cTreeSearch::Parse (unsigned char *data, unsigned len) {{{
516+bool cTreeSearch::Parse (unsigned char *data, size_t len) {{{
517 while (len>0) {
518 unsigned new_op = GET_U1 (&data, &len);
519 switch (new_op) {
520@@ -723,7 +723,7 @@
521 if (NULL != strstr(tag->name, search->val_str)) {
522 tHash hash;
523 memcpy (hash, f->hash, 16);
524- printf("MATCH (%3i) for Search %32s - %9u - %s\n", f->info_len, hash_bin2hex(hash), tag->size, tag->name);
525+ printf("MATCH (%3zi) for Search %32s - %9u - %s\n", f->info_len, hash_bin2hex(hash), tag->size, tag->name);
526
527 ADD_HASH(&buffer, &size, hash);
528 ADD_U4 (&buffer, &size, 0);
529--- cDonkey-0.9.0/sFile.cpp.orig 2003-05-07 18:21:34.000000000 +0000
530+++ cDonkey-0.9.0/sFile.cpp 2003-11-18 14:40:16.000000000 +0000
531@@ -360,7 +360,7 @@
532 if (part_count == 0) part_count = (size + PARTSIZE - 1) / PARTSIZE;
533 ASSERT (version == 0xE0);
534 if (part_count != (size + PARTSIZE - 1) / PARTSIZE) {
535- printf("%u != %u\n", part_count, (size + PARTSIZE - 1) / PARTSIZE);
536+ printf("%zu != %u\n", part_count, (size + PARTSIZE - 1) / PARTSIZE);
537 printf("Size %9u\n", size);
538 printf("Hash %s\n", hash_bin2hex(hash));
539 }
540@@ -519,9 +519,9 @@
541 for (it = tree->begin(); it != tree->end(); it++) {{{
542 if (it->second->stat == BLOCK_RECIVE || it->second->stat == BLOCK_VERIFY) continue;
543 char tag[20];
544- snprintf(tag, 20, "%c%u", 9, gap_idx);
545+ snprintf(tag, 20, "%c%zu", 9, gap_idx);
546 add_intTag(&buf, &len, tag, it->second->von);
547- snprintf(tag, 20, "%c%u", 10, gap_idx);
548+ snprintf(tag, 20, "%c%zu", 10, gap_idx);
549 add_intTag(&buf, &len, tag, it->second->bis+1);
550 gap_idx++;
551 tagCount += 2;
552@@ -629,7 +629,7 @@
553 }}}
554 bool sFile::partStatus (uint32_t idx) const {{{
555 if (idx >= part_count) {
556- printf("sFile::partStatus(%u) => part_count=%u\n", idx, part_count);
557+ printf("sFile::partStatus(%u) => part_count=%zu\n", idx, part_count);
558 abort();
559 }
560 ASSERT( idx < part_count);
561@@ -642,7 +642,7 @@
562 bool Assert = (ok && (check->stat == BLOCK_VERIFY || check->stat == BLOCK_RECIVE)) || (!ok && check->stat != BLOCK_VERIFY);
563 if (!Assert) {
564 printf("ok %i\n", ok);
565- printf("check->stat %i\n", check->stat);
566+ printf("check->stat %zi\n", check->stat);
567 abort();
568 }
569 return (part_status [pos] & flag) != 0;
570@@ -744,12 +744,12 @@
571 memcpy(&akt, it1->second, sizeof(dtype));
572 if (!running) return;
573 if (akt.bis >= size) {
574- printf("akt.bis %i\n", akt.bis);
575+ printf("akt.bis %zi\n", akt.bis);
576 printf("size %u\n", size);
577 abort();
578 }
579 ASSERT (akt.bis < size);
580- if (akt.von > akt.bis) printf("akt.von , akt.bis = %9u - %9u\n", akt.von , akt.bis);
581+ if (akt.von > akt.bis) printf("akt.von , akt.bis = %9zu - %9zu\n", akt.von , akt.bis);
582 ASSERT (akt.von <= akt.bis); // Check that there is no "defekt" entry
583 if (akt.stat == BLOCK_RECIVE) { // Only care about recived blocks
584 ASSERT(akt.bis >= akt.von);
585--- cDonkey-0.9.0/cServer_udp.cpp.orig 2003-05-07 18:21:33.000000000 +0000
586+++ cDonkey-0.9.0/cServer_udp.cpp 2003-11-18 14:48:47.000000000 +0000
587@@ -15,7 +15,7 @@
588 peer_ip.s_addr = ip.s_addr;
589 peer_port =port;
590 if (logSend('>', this, OP_REASKFILEPING, true)) printf("%32s\n", hash_bin2hex(file_hash));
591- unsigned len, LEN = len = 18;
592+ size_t len, LEN = len = 18;
593 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
594 ADD_U1 (&buf, &len, OP_EMULEPROT);
595 ADD_U1 (&buf, &len, OP_REASKFILEPING);
596@@ -29,7 +29,7 @@
597 if (!nextPing (&peer_ip, &peer_port, &quest)) return false;
598 peer_port += 4;
599 if (logSend('>', this, OP_GLOBSERVSTATREQ, false));
600- unsigned len, LEN = len = 6;
601+ size_t len, LEN = len = 6;
602 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
603 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
604 ADD_U1 (&buf, &len, OP_GLOBSERVSTATREQ);
605@@ -49,7 +49,7 @@
606 printf("Extending search to %s %u\n", inet_ntoa(ip), peer_port);
607 ASSERT (gui!=NULL);
608 if (logSend('>', this, OP_GLOBSEARCHREQ, false));
609- unsigned len, LEN = len = 2 + gui->searchLen();
610+ size_t len, LEN = len = 2 + gui->searchLen();
611 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
612 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
613 ADD_U1 (&buf, &len, OP_GLOBSEARCHREQ);
614@@ -70,7 +70,7 @@
615 if (!IP_is_OK (ip)) return false;
616 if (logSend('>', this, OP_GLOBGETSOURCES, true)) printf("%32s\n", hash_bin2hex(Hash));
617 actionServer (ip, port);
618- unsigned len, LEN = len = 18;
619+ size_t len, LEN = len = 18;
620 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
621 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
622 ADD_U1 (&buf, &len, OP_GLOBGETSOURCES);
623@@ -81,7 +81,7 @@
624 }}}
625 bool cServer_udp::UDP_req_callback (uint32_t idx) {{{ // (0x9C)
626 if (logSend('>', this, OP_GLOBCALLBACKREQ, true)) printf("%u\n", idx);
627- unsigned len, LEN = len = 12;
628+ size_t len, LEN = len = 12;
629 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
630 ADD_U1 (&buf, &len, OP_EDONKEYHEADER );
631 ADD_U1 (&buf, &len, OP_GLOBCALLBACKREQ );
632@@ -96,7 +96,7 @@
633 peer_ip = ip;
634 peer_port = port + 4;
635 if (logSend('>', this, OP_SERVER_DESC_REQ, false));
636- unsigned len, LEN = len = 2;
637+ size_t len, LEN = len = 2;
638 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
639 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
640 ADD_U1 (&buf, &len, OP_SERVER_DESC_REQ);
641@@ -108,7 +108,7 @@
642 peer_port = port + 4;
643 peer_ip = ip;
644 if (logSend('>', this, OP_SERVER_LIST_REQ, false));
645- unsigned len, LEN = len = 2;
646+ size_t len, LEN = len = 2;
647 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
648 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
649 ADD_U1 (&buf, &len, OP_SERVER_LIST_REQ);
650@@ -250,7 +250,7 @@
651 GET_U2 (&data, &len);
652 class sTag *tag = parse_tag (data, &len);
653 if (tag == NULL) return 0;
654- printf("Found file with %i info len %s\n", len, tag->name);
655+ printf("Found file with %zi info len %s\n", len, tag->name);
656 insertFiles (hash, peer_ip, len, data);
657 LEN -= len;
658 data += len;
659@@ -303,7 +303,7 @@
660 GET_HASH(&data, &in_len, hash);
661 sFile *file = forHash(hash);
662 if (file == NULL) {
663- unsigned len, LEN = len = 2;
664+ size_t len, LEN = len = 2;
665 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
666 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
667 ADD_U1 (&buf, &len, OP_FILENOTFOUND);
668@@ -312,7 +312,7 @@
669 return 1;
670 }
671 else {
672- unsigned len, LEN = len = 4;
673+ size_t len, LEN = len = 4;
674 unsigned char *buf, *BUF = buf = reinterpret_cast<unsigned char*>(alloca(LEN));
675 ADD_U1 (&buf, &len, OP_EDONKEYHEADER);
676 ADD_U1 (&buf, &len, OP_REASKACK);
677--- cDonkey-0.9.0/cSocket.cpp.orig 2003-11-18 14:05:47.000000000 +0000
678+++ cDonkey-0.9.0/cSocket.cpp 2003-11-18 14:47:05.000000000 +0000
679@@ -624,7 +624,7 @@
680 srv_addr.sin_port = htons(0);
681 if (0 != bind(fd, reinterpret_cast<struct sockaddr*>(&srv_addr), sizeof(srv_addr))) {{{
682 int err = GetErrno();
683- printf("bind(%i, %15s:%5u <%u>, %u) => %s\n", fd, inet_ntoa(srv_addr.sin_addr), htons(srv_addr.sin_port), type,
684+ printf("bind(%i, %15s:%5u <%u>, %zu) => %s\n", fd, inet_ntoa(srv_addr.sin_addr), htons(srv_addr.sin_port), type,
685 sizeof(srv_addr),cSocket::Strerror(err));
686 addEvent(16);
687 assert(0);
688@@ -693,7 +693,7 @@
689 #endif
690 if (0 != bind(fd, reinterpret_cast<struct sockaddr*>(&client_addr), sizeof(client_addr))) {
691 int err = GetErrno();
692- printf("bind(%i, %15s:%5u <%u>, %u) => %s\n", fd, inet_ntoa(client_addr.sin_addr), htons(client_addr.sin_port), type,
693+ printf("bind(%i, %15s:%5u <%u>, %zu) => %s\n", fd, inet_ntoa(client_addr.sin_addr), htons(client_addr.sin_port), type,
694 sizeof(client_addr),cSocket::Strerror(err));
695 addEvent(16);
696 return;
697@@ -727,7 +727,7 @@
698 shutdown (fd, 2);
699 if (fd != INVALID_SOCKET) g_SocketMap.erase(fd);
700 if (g_SocketMap.size() != count)
701- printf("WARNING: SocketMap: %d count: %d\n", g_SocketMap.size(),count);
702+ printf("WARNING: SocketMap: %zd count: %zd\n", g_SocketMap.size(),count);
703 ASSERT (fd != -1);
704 printf("(destr.)closing fd: %u this: %p:\n", fd, this);
705 closesocket(fd);
706@@ -981,7 +981,7 @@
707 return false;
708 }
709 printf("IP 13 %s\n", inet_ntoa(addr.sin_addr));
710- printf("LEN %i\n", len);
711+ printf("LEN %zi\n", len);
712 if (err == 13) printf("IP 13 %s\n", inet_ntoa(addr.sin_addr));
713 printf("fd: %u this %p:\n", fd, this);
714 printError(err);
715--- cDonkey-0.9.0/cHTTP.cpp.orig 2003-05-03 19:48:49.000000000 +0000
716+++ cDonkey-0.9.0/cHTTP.cpp 2003-11-18 14:56:49.000000000 +0000
717@@ -213,7 +213,7 @@
718 "<td class=hash >%s</td>"
719 "<td class=name >%s</td>"
720 "<td class=size >%u</td>"
721- "<td class=transfered >%u</td>"
722+ "<td class=transfered >%zu</td>"
723 "</div>", cnt, hash_bin2hex(akt->hash),akt->Name(), akt->size, akt->transfered
724 ));
725 }
726--- cDonkey-0.9.0/misc.cpp.orig 2003-05-07 18:21:34.000000000 +0000
727+++ cDonkey-0.9.0/misc.cpp 2003-11-18 14:34:46.000000000 +0000
728@@ -688,7 +688,7 @@
729 ADD_U4 (&cnt_idx, &cnt_len, tag_count);
730 }
731 DB_c_close(c);
732- if (count != 0) printf("Wrong count %u\n", count);
733+ if (count != 0) printf("Wrong count %zu\n", count);
734 int fd = FD_create ("server.met.new", O_WRONLY|O_BINARY|O_TRUNC|O_CREAT,0600);
735 if (fd == -1) {{{
736 printf ("server.met.new not open\n");
737--- cDonkey-0.9.0/donkey.h.orig 2003-05-01 15:21:23.000000000 +0000
738+++ cDonkey-0.9.0/donkey.h 2003-11-18 15:04:45.000000000 +0000
739@@ -20,7 +20,7 @@
740 #define LOG_ZEILE printf("%s %i\n", __FILE__, __LINE__); fflush(stdout);
741 // #define LOG_ZEILE ;
742
743-extern unsigned int TCP_CLIENT_COUNT;
744+extern size_t TCP_CLIENT_COUNT;
745 extern unsigned int TCP_SERVER_COUNT;
746 extern unsigned int CLIENT_COUNT;
747
This page took 0.157817 seconds and 4 git commands to generate.