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; }