summaryrefslogtreecommitdiff
path: root/upb/json/parser.c
diff options
context:
space:
mode:
authorMartin Maly <mmaly@google.com>2015-05-06 13:18:33 -0700
committerMartin Maly <mmaly@google.com>2015-05-06 16:50:30 -0700
commit508c39ee133d6725a4440ba98a1555e2026975c2 (patch)
treeda5a49a715a9af60fd6630e3462ad0b1bf8781c0 /upb/json/parser.c
parent535bc2fe2f2b467f59347ffc9449e11e47791257 (diff)
Resolve compilation errors if compiled with more stringent semantic checks.
Adding Travis test to build with strict warnings. Fixing a warning in a test which used signed/unsigned integer comparison.
Diffstat (limited to 'upb/json/parser.c')
-rw-r--r--upb/json/parser.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/upb/json/parser.c b/upb/json/parser.c
index a1e83c5..08cd13d 100644
--- a/upb/json/parser.c
+++ b/upb/json/parser.c
@@ -1135,8 +1135,6 @@ static const char _json_trans_actions[] = {
};
static const int json_start = 1;
-static const int json_first_final = 56;
-static const int json_error = 0;
static const int json_en_number_machine = 10;
static const int json_en_string_machine = 19;
@@ -1164,7 +1162,7 @@ size_t parse(void *closure, const void *hd, const char *buf, size_t size,
capture_resume(parser, buf);
-#line 1168 "upb/json/parser.c"
+#line 1166 "upb/json/parser.c"
{
int _klen;
unsigned int _trans;
@@ -1350,7 +1348,7 @@ _match:
#line 1082 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} }
break;
-#line 1354 "upb/json/parser.c"
+#line 1352 "upb/json/parser.c"
}
}
@@ -1382,6 +1380,13 @@ error:
bool end(void *closure, const void *hd) {
UPB_UNUSED(closure);
UPB_UNUSED(hd);
+
+ // Prevent compile warning on unused static constants.
+ UPB_UNUSED(json_start);
+ UPB_UNUSED(json_en_number_machine);
+ UPB_UNUSED(json_en_string_machine);
+ UPB_UNUSED(json_en_value_machine);
+ UPB_UNUSED(json_en_main);
return true;
}
@@ -1414,13 +1419,13 @@ void upb_json_parser_reset(upb_json_parser *p) {
int top;
// Emit Ragel initialization of the parser.
-#line 1418 "upb/json/parser.c"
+#line 1423 "upb/json/parser.c"
{
cs = json_start;
top = 0;
}
-#line 1157 "upb/json/parser.rl"
+#line 1164 "upb/json/parser.rl"
p->current_state = cs;
p->parser_top = top;
accumulate_clear(p);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback