diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-09 14:41:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-09 14:41:23 +0200 |
commit | ac197363fa8b345e464f4179c2a51fd37e89f1eb (patch) | |
tree | be39bc7a5aacd1e96bc3cf49a7fe732162ce018c | |
parent | 26ebbda9d6440498731ee6980945bfc0a18f6dc1 (diff) | |
download | vmod-tbf-ac197363fa8b345e464f4179c2a51fd37e89f1eb.tar.gz vmod-tbf-ac197363fa8b345e464f4179c2a51fd37e89f1eb.tar.bz2 |
Cleanup
* src/tbf.c: Use %zu to log size_t values; remove unused variables
and functions.
-rw-r--r-- | src/tbf.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -499,2 +499,3 @@ key_to_str(uint8_t key[], char *buf) +#if 0 static void @@ -507,2 +508,3 @@ node_to_keystr(struct node *node, char *buf) } +#endif @@ -561,3 +563,2 @@ tree_dump_unlocked(struct tree *tree, char const *file) struct node *node; - char keybuf[3][2*SHA256_LEN+1]; FILE *fp; @@ -658,3 +659,2 @@ tree_load_nodes(struct tree *tree, struct dump_header *hdr, size_t i; - uint32_t root_idx; uint32_t ord[2]; @@ -765,3 +765,3 @@ tree_load_nodes(struct tree *tree, struct dump_header *hdr, if (incomplete) { - syslog(LOG_DAEMON|LOG_ERR, "tbf.%s: %lu incomplete nodes left", + syslog(LOG_DAEMON|LOG_ERR, "tbf.%s: %zu incomplete nodes left", __FUNCTION__, incomplete); @@ -777,3 +777,3 @@ tree_load(char const *filename) FILE *fp; - struct tree *tree; + struct tree *tree = NULL; int rc; @@ -851,2 +851,3 @@ tbf_init(struct vmod_priv *priv, const struct VCL_conf *vclconf) atexit(tbf_exit); + return 0; } @@ -1009,3 +1010,3 @@ log_node(struct node *node, void *data) #ifdef DEBUG - syslog(tc->prio, "%d: %p(%p,%p): %lu %s: %s", tc->num, node, + syslog(tc->prio, "%d: %p(%p,%p): %zu %s: %s", tc->num, node, node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, @@ -1014,3 +1015,3 @@ log_node(struct node *node, void *data) #else - syslog(tc->prio, "%d: %p(%p,%p): %lu %s", tc->num, node, + syslog(tc->prio, "%d: %p(%p,%p): %zu %s", tc->num, node, node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, @@ -1041,6 +1042,6 @@ vmod_log_stats(MOD_CTX ctx, VCL_INT prio) tbf_release_tree(&tree); - syslog(prio, "Number of nodes: %lu", st.num_nodes); - syslog(prio, "Number of leaves: %lu", st.num_leaves); - syslog(prio, "Shortest path: %lu", st.shortest_path); - syslog(prio, "Longest path: %lu", st.longest_path); + syslog(prio, "Number of nodes: %zu", st.num_nodes); + syslog(prio, "Number of leaves: %zu", st.num_leaves); + syslog(prio, "Shortest path: %zu", st.shortest_path); + syslog(prio, "Longest path: %zu", st.longest_path); syslog(prio, "Avg path: %f", st.avg_path); |