aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-09 14:41:23 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-02-09 16:47:19 +0200
commit02cf9eed46759e019b3aca83f691f1ee31be2db5 (patch)
treead8d082c3c4f7ea8c340f594bf220184b73d1a2f
parent777bd9688099daf5af9d0e41f2df668040e072a9 (diff)
downloadvmod-tbf-02cf9eed46759e019b3aca83f691f1ee31be2db5.tar.gz
vmod-tbf-02cf9eed46759e019b3aca83f691f1ee31be2db5.tar.bz2
Cleanup
* src/tbf.c: Use %zu to log size_t values; remove unused variables and functions.
-rw-r--r--src/tbf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tbf.c b/src/tbf.c
index a1b6f9f..1695960 100644
--- a/src/tbf.c
+++ b/src/tbf.c
@@ -499,2 +499,3 @@ key_to_str(uint8_t key[], char *buf)
499 499
500#if 0
500static void 501static void
@@ -507,2 +508,3 @@ node_to_keystr(struct node *node, char *buf)
507} 508}
509#endif
508 510
@@ -561,3 +563,2 @@ tree_dump_unlocked(struct tree *tree, char const *file)
561 struct node *node; 563 struct node *node;
562 char keybuf[3][2*SHA256_LEN+1];
563 FILE *fp; 564 FILE *fp;
@@ -658,3 +659,2 @@ tree_load_nodes(struct tree *tree, struct dump_header *hdr,
658 size_t i; 659 size_t i;
659 uint32_t root_idx;
660 uint32_t ord[2]; 660 uint32_t ord[2];
@@ -765,3 +765,3 @@ tree_load_nodes(struct tree *tree, struct dump_header *hdr,
765 if (incomplete) { 765 if (incomplete) {
766 syslog(LOG_DAEMON|LOG_ERR, "tbf.%s: %lu incomplete nodes left", 766 syslog(LOG_DAEMON|LOG_ERR, "tbf.%s: %zu incomplete nodes left",
767 __FUNCTION__, incomplete); 767 __FUNCTION__, incomplete);
@@ -777,3 +777,3 @@ tree_load(char const *filename)
777 FILE *fp; 777 FILE *fp;
778 struct tree *tree; 778 struct tree *tree = NULL;
779 int rc; 779 int rc;
@@ -1021,3 +1021,3 @@ log_node(struct node *node, void *data)
1021#ifdef DEBUG 1021#ifdef DEBUG
1022 syslog(tc->prio, "%d: %p(%p,%p): %lu %s: %s", tc->num, node, 1022 syslog(tc->prio, "%d: %p(%p,%p): %zu %s: %s", tc->num, node,
1023 node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, 1023 node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord,
@@ -1026,3 +1026,3 @@ log_node(struct node *node, void *data)
1026#else 1026#else
1027 syslog(tc->prio, "%d: %p(%p,%p): %lu %s", tc->num, node, 1027 syslog(tc->prio, "%d: %p(%p,%p): %zu %s", tc->num, node,
1028 node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, 1028 node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord,
@@ -1053,6 +1053,6 @@ vmod_log_stats(VRT_CTX, VCL_INT prio)
1053 tbf_release_tree(&tree); 1053 tbf_release_tree(&tree);
1054 syslog(prio, "Number of nodes: %lu", st.num_nodes); 1054 syslog(prio, "Number of nodes: %zu", st.num_nodes);
1055 syslog(prio, "Number of leaves: %lu", st.num_leaves); 1055 syslog(prio, "Number of leaves: %zu", st.num_leaves);
1056 syslog(prio, "Shortest path: %lu", st.shortest_path); 1056 syslog(prio, "Shortest path: %zu", st.shortest_path);
1057 syslog(prio, "Longest path: %lu", st.longest_path); 1057 syslog(prio, "Longest path: %zu", st.longest_path);
1058 syslog(prio, "Avg path: %f", st.avg_path); 1058 syslog(prio, "Avg path: %f", st.avg_path);

Return to:

Send suggestions and report system problems to the System administrator.