Add more const
This commit is contained in:
parent
da87115761
commit
2aa3509845
3 changed files with 8 additions and 6 deletions
|
@ -28,6 +28,7 @@ static int strndiff(char * d1, char * d2, unsigned int n) {
|
|||
return d1 - o;
|
||||
}
|
||||
|
||||
/*
|
||||
static int strdiff(char * d1, char * d2) {
|
||||
char * o = d1;
|
||||
while( *d1 == *d2 ) {
|
||||
|
@ -36,6 +37,7 @@ static int strdiff(char * d1, char * d2) {
|
|||
}
|
||||
return d1 - o;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
|
@ -530,7 +532,7 @@ edge * r3_node_find_common_prefix(node *n, const char *path, int path_len, int *
|
|||
} else if ( p < slug->begin ) {
|
||||
break;
|
||||
} else if ( p >= slug->end && p < (path + path_len) ) {
|
||||
offset = slug->end + 1;
|
||||
offset = (char*) slug->end + 1;
|
||||
prefix = p - path;
|
||||
continue;
|
||||
} else {
|
||||
|
|
|
@ -91,7 +91,7 @@ int r3_slug_parse(r3_slug_t *s, const char *needle, int needle_len, char *offset
|
|||
|
||||
int cnt = 0;
|
||||
int state = 0;
|
||||
char * p = offset;
|
||||
const char * p = offset;
|
||||
|
||||
while( (p-needle) < needle_len) {
|
||||
// escape one character
|
||||
|
|
|
@ -11,19 +11,19 @@ typedef struct {
|
|||
/**
|
||||
* source path
|
||||
*/
|
||||
char * path;
|
||||
const char * path;
|
||||
|
||||
int path_len;
|
||||
|
||||
/**
|
||||
* slug start pointer
|
||||
*/
|
||||
char * begin;
|
||||
const char * begin;
|
||||
|
||||
/**
|
||||
* slug end pointer
|
||||
*/
|
||||
char * end;
|
||||
const char * end;
|
||||
|
||||
/**
|
||||
* slug length
|
||||
|
@ -31,7 +31,7 @@ typedef struct {
|
|||
int len;
|
||||
|
||||
// slug pattern pointer if we have one
|
||||
char * pattern;
|
||||
const char * pattern;
|
||||
|
||||
// the length of custom pattern, if the pattern is found.
|
||||
int pattern_len;
|
||||
|
|
Loading…
Reference in a new issue