Add const
This commit is contained in:
parent
10d6a64eac
commit
f596c7392d
2 changed files with 7 additions and 7 deletions
|
@ -157,14 +157,14 @@ int r3_tree_render_file(node * tree, char * format, char * filename);
|
|||
|
||||
int r3_tree_render_dot(node * tree);
|
||||
|
||||
edge * r3_node_find_edge_str(const node * n, char * str, int str_len);
|
||||
edge * r3_node_find_edge_str(const node * n, const char * str, int str_len);
|
||||
|
||||
|
||||
void r3_tree_compile(node *n);
|
||||
|
||||
void r3_tree_compile_patterns(node * n);
|
||||
|
||||
node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * entry);
|
||||
node * r3_tree_matchl(const node * n, const char * path, int path_len, match_entry * entry);
|
||||
|
||||
#define r3_tree_match(n,p,e) r3_tree_matchl(n,p, strlen(p), e)
|
||||
|
||||
|
|
10
src/node.c
10
src/node.c
|
@ -251,7 +251,7 @@ void match_entry_free(match_entry * entry) {
|
|||
* @param int path_len the length of the URL path.
|
||||
* @param match_entry* entry match_entry is used for saving the captured dynamic strings from pcre result.
|
||||
*/
|
||||
node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * entry) {
|
||||
node * r3_tree_matchl(const node * n, const char * path, int path_len, match_entry * entry) {
|
||||
info("try matching: %s\n", path);
|
||||
|
||||
edge *e;
|
||||
|
@ -260,9 +260,9 @@ node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * e
|
|||
|
||||
if (n->compare_type == NODE_COMPARE_OPCODE) {
|
||||
char *pp;
|
||||
char *pp_end = path + path_len;
|
||||
const char *pp_end = path + path_len;
|
||||
for (i = 0; i < n->edge_len ; i++ ) {
|
||||
pp = path;
|
||||
pp = (char*) path;
|
||||
e = n->edges[i];
|
||||
switch(e->opcode) {
|
||||
case OP_EXPECT_NOSLASH:
|
||||
|
@ -337,7 +337,7 @@ node * r3_tree_matchl(const node * n, char * path, int path_len, match_entry * e
|
|||
|
||||
for (i = 1; i < rc; i++)
|
||||
{
|
||||
substring_start = path + ov[2*i];
|
||||
substring_start = ((char*) path) + ov[2*i];
|
||||
substring_length = ov[2*i+1] - ov[2*i];
|
||||
// info("%2d: %.*s\n", i, substring_length, substring_start);
|
||||
|
||||
|
@ -388,7 +388,7 @@ route * r3_tree_match_route(const node *tree, match_entry * entry) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
inline edge * r3_node_find_edge_str(const node * n, char * str, int str_len) {
|
||||
inline edge * r3_node_find_edge_str(const node * n, const char * str, int str_len) {
|
||||
unsigned short i = 0;
|
||||
char firstbyte = *str;
|
||||
for (; i < n->edge_len ; i++ ) {
|
||||
|
|
Loading…
Reference in a new issue