From b33c39334bccfa5531a637450584a281b6c9a0d7 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 3 Sep 2007 14:05:38 +0000 Subject: [PATCH] please lint. git-svn-id: file:///svn/unbound/trunk@581 be551aaa-1e26-0410-a405-d3ace91eadb9 --- testcode/memstats.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testcode/memstats.c b/testcode/memstats.c index cf00a9a47..8c925433b 100644 --- a/testcode/memstats.c +++ b/testcode/memstats.c @@ -132,7 +132,7 @@ get_codeline(rbtree_t* tree, char* key, char* func) if(!cl->func) return 0; cl->alloc = 0; cl->node.key = cl->codeline; - rbtree_insert(tree, &cl->node); + (void)rbtree_insert(tree, &cl->node); } return cl; } @@ -200,16 +200,16 @@ static void readfile(rbtree_t* tree, const char* fname, struct alloc_misc* misc) { off_t total = get_file_size(fname); - off_t done = 0; + off_t done = (off_t)0; int report = 0; FILE* in = fopen(fname, "r"); char buf[102400]; if(!in) fatal_exit("could not open %s: %s", fname, strerror(errno)); - printf("Reading %s of size %lld\n", fname, (uint64_t)total); + printf("Reading %s of size %lld\n", fname, (long long)total); while(fgets(buf, 102400, in)) { buf[102400-1] = 0; - done += strlen(buf); + done += (off_t)strlen(buf); /* progress count */ if((int)(((double)done / (double)total)*100.) > report) { report = (int)(((double)done / (double)total)*100.); @@ -239,14 +239,16 @@ printstats(rbtree_t* tree, struct alloc_misc* misc) { struct codeline* cl; uint64_t total = 0; - printf("%12lld in region alloc\n", misc->region_alloc); + printf("%12lld in region alloc\n", (long long)misc->region_alloc); total += misc->region_alloc; RBTREE_FOR(cl, struct codeline*, tree) { - printf("%12lld in %s %s\n", cl->alloc, cl->codeline, cl->func); + printf("%12lld in %s %s\n", (long long)cl->alloc, + cl->codeline, cl->func); total += cl->alloc; } printf("------------\n"); - printf("%12lld total in %ld code lines\n", total, (long)tree->count); + printf("%12lld total in %ld code lines\n", (long long)total, + (long)tree->count); printf("\n"); }