for (i=0; i < MAX_WSABUFS && chain; ++i, chain=chain->next) {
WSABUF *b = &buf_o->buffers[i];
- b->buf = chain->buffer + chain->misalign;
+ b->buf = (char*)( chain->buffer + chain->misalign );
_evbuffer_chain_pin(chain, EVBUFFER_MEM_PINNED_W);
if ((size_t)at_most > chain->off) {
ASSERT_LOCKED(ns->base);
for (;;) {
- const int r = recvfrom(ns->socket, packet, sizeof(packet), 0,
+ const int r = recvfrom(ns->socket, (void*)packet,
+ sizeof(packet), 0,
(struct sockaddr*)&ss, &addrlen);
if (r < 0) {
int err = evutil_socket_geterror(ns->socket);
for (;;) {
addrlen = sizeof(struct sockaddr_storage);
- r = recvfrom(s->socket, packet, sizeof(packet), 0,
+ r = recvfrom(s->socket, (void*)packet, sizeof(packet), 0,
(struct sockaddr*) &addr, &addrlen);
if (r < 0) {
int err = evutil_socket_geterror(s->socket);
int r;
ASSERT_LOCKED(req->base);
ASSERT_VALID_REQUEST(req);
- r = sendto(server->socket, req->request, req->request_len, 0,
+ r = sendto(server->socket, (void*)req->request, req->request_len, 0,
(struct sockaddr *)&server->address, server->addrlen);
if (r < 0) {
int err = evutil_socket_geterror(server->socket);
int err;
while (1) {
struct sockaddr_storage ss;
+#ifdef WIN32
+ int socklen = sizeof(ss);
+#else
socklen_t socklen = sizeof(ss);
-
+#endif
evutil_socket_t new_fd = accept(fd, (struct sockaddr*)&ss, &socklen);
if (new_fd < 0)
break;
/* Wake up our notification mechanism */
msg = sig;
- send(evsig_base_fd, &msg, 1, 0);
+ send(evsig_base_fd, (char*)&msg, 1, 0);
errno = save_errno;
#ifdef WIN32
EVUTIL_SET_SOCKET_ERROR(socket_errno);
long idx = (long) arg, widx = idx + 1;
u_char ch;
- count += recv(fd, &ch, sizeof(ch), 0);
+ count += recv(fd, (char*)&ch, sizeof(ch), 0);
if (writes) {
if (widx >= num_pipes)
widx -= num_pipes;
throughput = total_n_handled /
(total.tv_sec+ ((double)total.tv_usec)/1000000.0);
+#ifdef WIN32
+#define I64_FMT "%I64d"
+#define I64_TYP __int64
+#else
+#define I64_FMT "%lld"
+#define I64_TYP long long int
+#endif
+
printf("\n%d requests in %d.%06d sec. (%.2f throughput)\n"
"Each took about %.02f msec latency\n"
- "%lld bytes read. %d errors.\n",
+ I64_FMT "bytes read. %d errors.\n",
total_n_handled,
(int)total.tv_sec, (int)total.tv_usec,
throughput,
(double)(usec/1000) / total_n_handled,
- (long long)total_n_bytes, n_errors);
+ (I64_TYP)total_n_bytes, n_errors);
return 0;
}
}
if (EVBUFFER_LENGTH(req->input_buffer) != strlen(what)) {
- fprintf(stderr, "FAILED (length %zu vs %zu)\n",
- EVBUFFER_LENGTH(req->input_buffer), strlen(what));
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)EVBUFFER_LENGTH(req->input_buffer), (unsigned long)strlen(what));
exit(1);
}
}
if (EVBUFFER_LENGTH(req->input_buffer) != strlen(POST_DATA)) {
- fprintf(stdout, "FAILED (length: %zu vs %zu)\n",
- EVBUFFER_LENGTH(req->input_buffer), strlen(POST_DATA));
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long) EVBUFFER_LENGTH(req->input_buffer), (unsigned long) strlen(POST_DATA));
exit(1);
}
}
if (EVBUFFER_LENGTH(req->input_buffer) != strlen(what)) {
- fprintf(stderr, "FAILED (length %zu vs %zu)\n",
- EVBUFFER_LENGTH(req->input_buffer), strlen(what));
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)EVBUFFER_LENGTH(req->input_buffer), (unsigned long)strlen(what));
exit(1);
}
}
if (EVBUFFER_LENGTH(req->input_buffer) != strlen(PUT_DATA)) {
- fprintf(stdout, "FAILED (length: %zu vs %zu)\n",
- EVBUFFER_LENGTH(req->input_buffer), strlen(PUT_DATA));
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long)EVBUFFER_LENGTH(req->input_buffer), (unsigned long)strlen(PUT_DATA));
exit(1);
}
}
if (EVBUFFER_LENGTH(req->input_buffer) != strlen(what)) {
- fprintf(stderr, "FAILED (length %zu vs %zu)\n",
- EVBUFFER_LENGTH(req->input_buffer), strlen(what));
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)EVBUFFER_LENGTH(req->input_buffer), (unsigned long)strlen(what));
exit(1);
}
event_dispatch();
if (evbuffer_get_length(reply) != expected_len) {
- TT_DIE(("reply length %zu; expected %zu; FAILED (%s)\n",
- EVBUFFER_LENGTH(reply), expected_len,
- evbuffer_pullup(reply, -1)));
+ TT_DIE(("reply length %lu; expected %lu; FAILED (%s)\n",
+ (unsigned long)EVBUFFER_LENGTH(reply),
+ (unsigned long)expected_len,
+ (char*)evbuffer_pullup(reply, -1)));
}
if (memcmp(evbuffer_pullup(reply, -1), expected, expected_len) != 0) {