Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
test: fix compiler warnings
* remove unused variables and functions
* replace %llu with %zu when printing size_t variables
  • Loading branch information
bnoordhuis committed Mar 16, 2012
1 parent 681aa83 commit 379ca42
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
7 changes: 0 additions & 7 deletions test/dns-server.c
Expand Up @@ -50,14 +50,12 @@ typedef struct {
static uv_loop_t* loop;


static int server_closed;
static uv_tcp_t server;


static void after_write(uv_write_t* req, int status);
static void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf);
static void on_close(uv_handle_t* peer);
static void on_server_close(uv_handle_t* handle);
static void on_connection(uv_stream_t*, int status);

#define WRITE_BUF_LEN (64*1024)
Expand Down Expand Up @@ -283,11 +281,6 @@ static void on_connection(uv_stream_t* server, int status) {
}


static void on_server_close(uv_handle_t* handle) {
ASSERT(handle == (uv_handle_t*)&server);
}


static int dns_start(int port) {
struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", port);
int r;
Expand Down
2 changes: 1 addition & 1 deletion test/test-get-memory.c
Expand Up @@ -26,7 +26,7 @@ TEST_IMPL(get_memory) {
uint64_t free_mem = uv_get_free_memory();
uint64_t total_mem = uv_get_total_memory();

printf("free_mem=%llu, total_mem=%llu\n", free_mem, total_mem);
printf("free_mem=%zu, total_mem=%zu\n", free_mem, total_mem);

ASSERT(free_mem > 0);
ASSERT(total_mem > 0);
Expand Down
12 changes: 6 additions & 6 deletions test/test-platform-output.c
Expand Up @@ -40,7 +40,7 @@ TEST_IMPL(platform_output) {

err = uv_resident_set_memory(&rss);
ASSERT(UV_OK == err.code);
fprintf(stderr, "uv_resident_set_memory: %d\n", rss);
fprintf(stderr, "uv_resident_set_memory: %zu\n", rss);

err = uv_uptime(&uptime);
ASSERT(UV_OK == err.code);
Expand All @@ -53,11 +53,11 @@ TEST_IMPL(platform_output) {
for (i = 0; i < count; i++) {
fprintf(stderr, " model: %s\n", cpus[i].model);
fprintf(stderr, " speed: %d\n", cpus[i].speed);
fprintf(stderr, " times.sys: %llu\n", cpus[i].cpu_times.sys);
fprintf(stderr, " times.user: %llu\n", cpus[i].cpu_times.user);
fprintf(stderr, " times.idle: %llu\n", cpus[i].cpu_times.idle);
fprintf(stderr, " times.irq: %llu\n", cpus[i].cpu_times.irq);
fprintf(stderr, " times.nice: %llu\n", cpus[i].cpu_times.nice);
fprintf(stderr, " times.sys: %zu\n", cpus[i].cpu_times.sys);
fprintf(stderr, " times.user: %zu\n", cpus[i].cpu_times.user);
fprintf(stderr, " times.idle: %zu\n", cpus[i].cpu_times.idle);
fprintf(stderr, " times.irq: %zu\n", cpus[i].cpu_times.irq);
fprintf(stderr, " times.nice: %zu\n", cpus[i].cpu_times.nice);
}
uv_free_cpu_info(cpus, count);

Expand Down
1 change: 0 additions & 1 deletion test/test-tcp-writealot.c
Expand Up @@ -41,7 +41,6 @@ static int write_cb_called = 0;
static int close_cb_called = 0;
static int bytes_sent = 0;
static int bytes_sent_done = 0;
static int bytes_received = 0;
static int bytes_received_done = 0;


Expand Down
3 changes: 0 additions & 3 deletions test/test-udp-multicast-ttl.c
Expand Up @@ -32,10 +32,7 @@
static uv_udp_t server;
static uv_udp_t client;

static int cl_recv_cb_called;

static int sv_send_cb_called;

static int close_cb_called;


Expand Down

0 comments on commit 379ca42

Please sign in to comment.