more const pointers

This commit is contained in:
c9s 2014-05-28 21:09:37 +08:00
parent 072c72621c
commit d400789d96
3 changed files with 4 additions and 4 deletions

View file

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

View file

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

View file

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