From d400789d96765ac912c0b7d618b70b9b12612998 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 28 May 2014 21:09:37 +0800 Subject: [PATCH] more const pointers --- include/r3.h | 4 ++-- src/node.c | 2 +- src/str.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/r3.h b/include/r3.h index f3f689b..75c769a 100644 --- a/include/r3.h +++ b/include/r3.h @@ -148,7 +148,7 @@ route * r3_route_create(const char * path); route * r3_route_createl(const char * path, int path_len); -int r3_route_cmp(route *r1, const match_entry *r2); +int r3_route_cmp(const route *r1, const match_entry *r2); void r3_node_append_route(node * n, route * route); @@ -166,7 +166,7 @@ route * r3_tree_match_route(const node *n, const match_entry * entry); -int r3_pattern_to_opcode(char * pattern, int pattern_len); +int r3_pattern_to_opcode(const char * pattern, int pattern_len); enum { NODE_COMPARE_STR, NODE_COMPARE_PCRE, NODE_COMPARE_OPCODE }; diff --git a/src/node.c b/src/node.c index e6e48ec..b20b43a 100644 --- a/src/node.c +++ b/src/node.c @@ -640,7 +640,7 @@ void r3_tree_dump(const node * n, int level) { * * -1 == different route */ -int r3_route_cmp(route *r1, const match_entry *r2) { +int r3_route_cmp(const route *r1, const match_entry *r2) { if (r1->request_method != 0) { if (0 == (r1->request_method & r2->request_method) ) { return -1; diff --git a/src/str.c b/src/str.c index 680a4f4..ffc3fe7 100644 --- a/src/str.c +++ b/src/str.c @@ -12,7 +12,7 @@ #include "r3_str.h" #include "zmalloc.h" -int r3_pattern_to_opcode(char * pattern, int len) { +int r3_pattern_to_opcode(const char * pattern, int len) { if ( strncmp(pattern, "\\w+",len) == 0 ) { return OP_EXPECT_MORE_WORDS; }