remove unused variable and add const

This commit is contained in:
c9s 2014-06-01 02:58:03 +08:00
parent 40fa19002a
commit 998560634e
3 changed files with 2 additions and 4 deletions

View file

@ -24,7 +24,7 @@ char * inside_slug(const char * needle, int needle_len, char *offset);
char * ltrim_slash(char* str);
void str_repeat(char *s, char *c, int len);
void str_repeat(char *s, const char *c, int len);
void print_indent(int level);

View file

@ -205,7 +205,7 @@ char * ltrim_slash(char* str)
return zstrdup(p);
}
void str_repeat(char *s, char *c, int len) {
void str_repeat(char *s, const char *c, int len) {
while(len--) {
s[len - 1] = *c;
}

View file

@ -74,7 +74,6 @@ END_TEST
START_TEST (test_inside_slug)
{
int slug_len = 0;
char * pattern = "/user/{name:\\s+}/to/{id}";
char * offset = strchr(pattern, '{') + 2;
ck_assert( (int)inside_slug(pattern, strlen(pattern), offset) );
@ -85,7 +84,6 @@ END_TEST
START_TEST (test_slug_count)
{
int slug_len = 0;
char * pattern = "/user/{name:\\s+}/to/{id}";
ck_assert_int_eq( slug_count(pattern, strlen(pattern) ), 2 );