Browse Source

[parsers] fix unused variable warnings

Change-Id: Ifc0210235ada102e2dbcba23e1179e87b973510f
master
Stefan Bühler 4 years ago
parent
commit
6a0e57ec8f
7 changed files with 16 additions and 8 deletions
  1. +2
    -1
      src/angel/angel_config_parser.rl
  2. +4
    -2
      src/common/ip_parsers.rl
  3. +2
    -1
      src/main/config_parser.rl
  4. +2
    -1
      src/main/http_range_parser.rl
  5. +1
    -1
      src/main/http_request_parser.rl
  6. +1
    -1
      src/main/http_response_parser.rl
  7. +4
    -1
      src/main/url_parser.rl

+ 2
- 1
src/angel/angel_config_parser.rl View File

@@ -328,7 +328,7 @@ GQuark li_angel_config_parser_error_quark(void) {
( endoffile | keyword | name | cast | single_operator | operator | integer | string );
}%%

%% write data;
%% write data noerror nofinal;

static void set_config_error(liConfigTokenizerContext *ctx, GError **error, const char *fmt, va_list ap) {
GString *msg = g_string_sized_new(127);
@@ -399,6 +399,7 @@ static liConfigToken tokenizer_next(liConfigTokenizerContext *ctx, GError **erro
ctx->token_line = ctx->line;
ctx->token_line_start = ctx->line_start;

(void) config_tokenizer_en_token;
%% write init;

%% write exec;


+ 4
- 2
src/common/ip_parsers.rl View File

@@ -29,7 +29,7 @@
ipv4_socket := ipv4_data port? end;
ipv4_socket_cidr := ipv4_data netmask? port? end;

write data;
write data noerror;
}%%

gboolean li_parse_ipv4(const char *str, guint32 *ip, guint32 *netmask, guint16 *port) {
@@ -41,6 +41,7 @@ gboolean li_parse_ipv4(const char *str, guint32 *ip, guint32 *netmask, guint16 *
if (netmask) *netmask = 0xffffffffu;
if (port) *port = 0;

(void) ipv4_parser_start;
%% write init nocs;

cs = netmask
@@ -110,7 +111,7 @@ gboolean li_parse_ipv4(const char *str, guint32 *ip, guint32 *netmask, guint16 *
ipv6_socket := ( ( ipv6_data ) | ( "[" ipv6_data "]" port? ) ) end;
ipv6_socket_cidr := ( ( ipv6_data network? ) | ( ipv6_bracket_cidr port?) ) end;

write data;
write data noerror;
}%%

gboolean li_parse_ipv6(const char *str, guint8 *ip, guint *network, guint16 *port) {
@@ -124,6 +125,7 @@ gboolean li_parse_ipv6(const char *str, guint8 *ip, guint *network, guint16 *por
if (network) *network = 128;
if (port) *port = 0;

(void) ipv6_parser_start;
%% write init nocs;

cs = network


+ 2
- 1
src/main/config_parser.rl View File

@@ -400,7 +400,7 @@ GQuark li_config_error_quark(void) {
( endoffile | keyword | name | cast | single_operator | operator | integer | string );
}%%

%% write data;
%% write data noerror nofinal;

static void set_config_error(liConfigTokenizerContext *ctx, GError **error, const char *fmt, va_list ap) {
GString *msg = g_string_sized_new(127);
@@ -481,6 +481,7 @@ static liConfigToken tokenizer_next(liConfigTokenizerContext *ctx, GError **erro
ctx->token_line = ctx->line;
ctx->token_line_start = ctx->line_start;

(void) config_tokenizer_en_token;
%% write init;

%% write exec;


+ 2
- 1
src/main/http_range_parser.rl View File

@@ -52,7 +52,7 @@

main := ws* "bytes" ws* "=" (ws | ",")* range ( ws* "," >range_complete (ws | ",")* range)** (ws | ",")*;

write data;
write data nofinal;
}%%

liParseHttpRangeResult li_parse_http_range_next(liParseHttpRangeState* s) {
@@ -108,6 +108,7 @@ void li_parse_http_range_init(liParseHttpRangeState* s, const GString *range_str
s->last_range = FALSE;
s->found_valid_range = FALSE;

(void) http_range_parser_en_main;
%% write init;
}



+ 1
- 1
src/main/http_request_parser.rl View File

@@ -13,7 +13,6 @@


%%{

machine li_http_request_parser;
variable cs ctx->chunk_ctx.cs;

@@ -128,6 +127,7 @@ void li_http_request_parser_init(liHttpRequestCtx* ctx, liRequest *req, liChunkQ
ctx->h_key = g_string_sized_new(0);
ctx->h_value = g_string_sized_new(0);

(void) li_http_request_parser_en_main;
%% write init;
}



+ 1
- 1
src/main/http_response_parser.rl View File

@@ -14,7 +14,6 @@


%%{

machine li_http_response_parser;
variable cs ctx->chunk_ctx.cs;

@@ -131,6 +130,7 @@ void li_http_response_parser_init(liHttpResponseCtx* ctx, liResponse *req, liChu
ctx->h_key = g_string_sized_new(0);
ctx->h_value = g_string_sized_new(0);

(void) li_http_response_parser_en_main;
%% write init;
}



+ 4
- 1
src/main/url_parser.rl View File

@@ -80,7 +80,7 @@
parse_URI_path := URI_path;
parse_Hostname := (host >mark_host %save_host) ( ":" port )?;

write data;
write data noerror;
}%%

gboolean li_parse_raw_url(liRequestUri *uri) {
@@ -91,6 +91,7 @@ gboolean li_parse_raw_url(liRequestUri *uri) {
p = uri->raw->str;
eof = pe = uri->raw->str + uri->raw->len;

(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_URI;

@@ -111,6 +112,7 @@ gboolean li_parse_raw_path(liRequestUri *uri, GString *input) {
g_string_truncate(uri->raw_path, 0);
g_string_truncate(uri->query, 0);

(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_URI_path;

@@ -133,6 +135,7 @@ gboolean li_parse_hostname(liRequestUri *uri) {
p = uri->authority->str;
eof = pe = uri->authority->str + uri->authority->len;

(void) url_parser_start;
%% write init nocs;
cs = url_parser_en_parse_Hostname;



Loading…
Cancel
Save