Commit 764b0f4b authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Fix warning about value outside enum range

parent 6437cab7
...@@ -630,7 +630,8 @@ static void del_dict_contents(struct t_dictionary * d) { ...@@ -630,7 +630,8 @@ static void del_dict_contents(struct t_dictionary * d) {
/* The states for the SAX parser, corresponding roughly to the expected structure of the XML file. /* The states for the SAX parser, corresponding roughly to the expected structure of the XML file.
We use the states mostly to validate the XML file. */ We use the states mostly to validate the XML file. */
enum state { enum state {
START = 1, /* In "dictionary" */ INIT = 0,
START, /* In "dictionary" */
IN_VENDOR, IN_VENDOR,
IN_APPLICATION, /* note that "base" is equivalent to "application" for our state machine */ IN_APPLICATION, /* note that "base" is equivalent to "application" for our state machine */
IN_COMMAND, IN_COMMAND,
...@@ -714,7 +715,7 @@ static void SAXstartelem (void * ctx, const xmlChar * name, const xmlChar ** att ...@@ -714,7 +715,7 @@ static void SAXstartelem (void * ctx, const xmlChar * name, const xmlChar ** att
goto xml_tree_error; goto xml_tree_error;
switch (data->state) { switch (data->state) {
case 0: /* we are just starting. We only expect a <dictionary> tag, reject anything else. */ case INIT: /* we are just starting. We only expect a <dictionary> tag, reject anything else. */
if (strcasecmp((char *)name, "dictionary")) if (strcasecmp((char *)name, "dictionary"))
goto xml_tree_error; goto xml_tree_error;
...@@ -1028,7 +1029,7 @@ static void SAXendelem (void * ctx, const xmlChar * name) ...@@ -1028,7 +1029,7 @@ static void SAXendelem (void * ctx, const xmlChar * name)
} }
switch (data->state) { switch (data->state) {
case 0: case INIT:
goto state_machine_error; goto state_machine_error;
case START: case START:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment