From adde7bc361573cacaafae3a9ecf5c4800a74aa2e Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 1 Jun 2014 14:35:29 +0800 Subject: [PATCH] remove unused variables --- include/r3.h | 4 ++-- src/node.c | 4 ++-- tests/bench.c | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/r3.h b/include/r3.h index fbf4a04..4dc6e02 100644 --- a/include/r3.h +++ b/include/r3.h @@ -99,9 +99,9 @@ edge * r3_node_find_edge(const node * n, const char * pat); void r3_node_append_edge(node *n, edge *child); -node * r3_tree_insert_pathl(node *tree, char *path, int path_len, void * data); +node * r3_tree_insert_pathl(node *tree, const char *path, int path_len, void * data); -route * r3_tree_insert_routel(node *tree, int method, char *path, int path_len, void *data); +route * r3_tree_insert_routel(node *tree, int method, const char *path, int path_len, void *data); #define r3_tree_insert_path(n,p,d) r3_tree_insert_pathl_(n,p,strlen(p), NULL, d) diff --git a/src/node.c b/src/node.c index eae7c56..ac9cc85 100644 --- a/src/node.c +++ b/src/node.c @@ -452,7 +452,7 @@ route * r3_route_createl(const char * path, int path_len) { } -route * r3_tree_insert_routel(node *tree, int method, char *path, int path_len, void *data) { +route * r3_tree_insert_routel(node *tree, int method, const char *path, int path_len, void *data) { route *r = r3_route_createl(path, path_len); if(!r) return NULL; @@ -463,7 +463,7 @@ route * r3_tree_insert_routel(node *tree, int method, char *path, int path_len, -node * r3_tree_insert_pathl(node *tree, char *path, int path_len, void * data) +node * r3_tree_insert_pathl(node *tree, const char *path, int path_len, void * data) { return r3_tree_insert_pathl_(tree, path, path_len, NULL , data); } diff --git a/tests/bench.c b/tests/bench.c index b682ff8..f73127c 100644 --- a/tests/bench.c +++ b/tests/bench.c @@ -20,7 +20,6 @@ unsigned long unixtime() { struct timeval tp; - long sec = 0L; if (gettimeofday((struct timeval *) &tp, (NUL)) == 0) { return tp.tv_sec; } @@ -31,8 +30,6 @@ double microtime() { struct timeval tp; long sec = 0L; double msec = 0.0; - char ret[100]; - if (gettimeofday((struct timeval *) &tp, (NUL)) == 0) { msec = (double) (tp.tv_usec / MICRO_IN_SEC); sec = tp.tv_sec;