Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions urlparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void urlparse_url_set_field_data(urlparse_url *dest, int field,
dest->field_data[field].len = (uint16_t)(end - start);
}

static uint8_t scheme_chars[256] = {
static const uint8_t scheme_chars[256] = {
ALPHAS,
[':'] = 2,
['/'] = 3,
Expand Down Expand Up @@ -110,7 +110,7 @@ static int parse_scheme(urlparse_parser *up, urlparse_url *dest) {
return 0;
}

static uint8_t path_chars[256] = {
static const uint8_t path_chars[256] = {
/* unreserved */
DIGITS,
ALPHAS,
Expand Down Expand Up @@ -195,7 +195,7 @@ static int parse_path_abempty(urlparse_parser *up, urlparse_url *dest) {
return 0;
}

static uint8_t userinfo_chars[256] = {
static const uint8_t userinfo_chars[256] = {
/* unreserved */
DIGITS,
ALPHAS,
Expand Down Expand Up @@ -252,7 +252,7 @@ static int parse_userinfo(urlparse_parser *up, urlparse_url *dest) {
return 0;
}

static uint8_t host_chars[256] = {
static const uint8_t host_chars[256] = {
DIGITS, ALPHAS, ['.'] = 1, ['-'] = 1, [':'] = 2, ['/'] = 2, ['?'] = 2,
};

Expand Down Expand Up @@ -285,11 +285,11 @@ static int parse_host(urlparse_parser *up, urlparse_url *dest) {
return 0;
}

static uint8_t ipv6_host_chars[256] = {
static const uint8_t ipv6_host_chars[256] = {
HEXDIGITS, [':'] = 1, ['.'] = 1, ['%'] = 2, [']'] = 3,
};

static uint8_t ipv6_zone_chars[256] = {
static const uint8_t ipv6_zone_chars[256] = {
DIGITS, ALPHAS, ['%'] = 1, ['.'] = 1,
['-'] = 1, ['_'] = 1, ['~'] = 1, [']'] = 2,
};
Expand Down Expand Up @@ -356,7 +356,7 @@ static int parse_ipv6_host(urlparse_parser *up, urlparse_url *dest) {
return 0;
}

static uint8_t port_chars[256] = {
static const uint8_t port_chars[256] = {
DIGITS,
['/'] = 2,
['?'] = 2,
Expand Down Expand Up @@ -478,7 +478,7 @@ static int parse_authority(urlparse_parser *up, urlparse_url *dest) {
return parse_port(up, dest);
}

static uint8_t extra_chars[256] = {
static const uint8_t extra_chars[256] = {
/* unreserved */
DIGITS,
ALPHAS,
Expand Down
Loading