change some errors to fatals

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1624 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 5ef5c39b9a
commit 01838a708a

@ -1,5 +1,9 @@
2009-05-23 Arnim Laeuger <arniml>
* src/bsdl/bsdl_msg.h, src/bsdl/vhdl_flex.l, src/bsdl/vhdl_bison.y,
src/bsdl/bsdl_flex.l, src/bsdl/bsdl_bison.y:
change some errors to fatals
* include/urjtag/error.h, src/global/urjtag.c,
src/apps/bsdl2jtag/bsdl2jtag.c,
src/bsdl/bsdl_msg.h, src/bsdl/bsdl.c, src/bsdl/bsdl_sem.c,

@ -1141,7 +1141,7 @@ urj_bsdl_parser_init (urj_bsdl_jtag_ctrl_t *jtag_ctrl)
if (!(new_priv = malloc (sizeof (urj_bsdl_parser_priv_t))))
{
urj_bsdl_err_set (jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
return NULL;
}
@ -1212,7 +1212,7 @@ add_instruction (urj_bsdl_parser_priv_t *priv, char *instr, char *opcode)
priv->jtag_ctrl->instr_list = new_instr;
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1273,7 +1273,7 @@ ac_add_instruction (urj_bsdl_parser_priv_t *priv, char *instr)
tmp_ai->instr_list = new_instr;
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1309,7 +1309,7 @@ ac_apply_assoc (urj_bsdl_parser_priv_t *priv)
jc->ainfo_list = new_ai;
}
else
urj_bsdl_err_set (jc->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (jc->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
/* clean up obsolete temporary entries */
@ -1348,7 +1348,7 @@ prt_add_name (urj_bsdl_parser_priv_t *priv, char *name)
pd->names_list = new_string;
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1504,7 +1504,7 @@ ci_set_cell_spec (urj_bsdl_parser_priv_t *priv,
}
else
{
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
ci->port_name = NULL;
}
@ -1555,7 +1555,7 @@ ci_append_cell_info (urj_bsdl_parser_priv_t *priv, int bit_num)
tmp_ci->basic_safe_value = NULL;
}
else
urj_bsdl_err_set (jc->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (jc->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}

@ -434,14 +434,14 @@ urj_bsdl_flex_init (int proc_mode)
/* get our scanner structure */
if (yylex_init (&scanner) != 0)
{
urj_bsdl_err_set (proc_mode, URJ_ERROR_BSDL_BSDL,
urj_bsdl_ftl_set (proc_mode, URJ_ERROR_BSDL_BSDL,
"Scanner could not be initialized");
return NULL;
}
if (!(extra = malloc (sizeof (urj_bsdl_scan_extra_t))))
{
urj_bsdl_err_set (proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
yylex_destroy (scanner);
return NULL;
@ -531,7 +531,7 @@ new_string (urj_bsdl_scan_extra_t *extra, const char *str)
n_str[n_str_size - 1] = '\0'; /* set very last element to EOS */
}
else
urj_bsdl_err_set (extra->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (extra->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
return (n_str);

@ -59,4 +59,10 @@
urj_error_set (err, __VA_ARGS__); \
} while (0)
#define urj_bsdl_ftl_set(proc_mode, err, ...) \
do { \
if (proc_mode & URJ_BSDL_MODE_MSG_FATAL) \
urj_error_set (err, __VA_ARGS__); \
} while (0)
#endif /* URJ_BSDL_MSG_H */

@ -848,7 +848,7 @@ urj_vhdl_parser_init (FILE *f, urj_bsdl_jtag_ctrl_t *jtag_ctrl)
if (!(new_priv = malloc (sizeof (urj_vhdl_parser_priv_t))))
{
urj_bsdl_err_set (jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
return NULL;
}
@ -953,7 +953,7 @@ urj_vhdl_port_add_name (urj_vhdl_parser_priv_t *priv, char *name)
pd->names_list = new_string;
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1045,7 +1045,7 @@ urj_vhdl_port_apply_port (urj_vhdl_parser_priv_t *priv)
tmp_pd->next = NULL;
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1080,7 +1080,7 @@ set_attr_bool (urj_vhdl_parser_priv_t *priv, char *name, int value)
add_elem (priv, el);
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
#endif
@ -1101,7 +1101,7 @@ set_attr_decimal (urj_vhdl_parser_priv_t *priv, char *name, int value)
add_elem (priv, el);
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1132,7 +1132,7 @@ set_attr_string (urj_vhdl_parser_priv_t *priv, char *name, char *string)
add_elem (priv, el);
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
@ -1151,7 +1151,7 @@ set_attr_real (urj_vhdl_parser_priv_t *priv, char *name, char *string)
add_elem (priv, el);
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
#endif
@ -1171,7 +1171,7 @@ set_attr_const (urj_vhdl_parser_priv_t *priv, char *name, char *string)
add_elem (priv, el);
}
else
urj_bsdl_err_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (priv->jtag_ctrl->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
}
#endif

@ -365,7 +365,7 @@ urj_vhdl_flex_init (FILE *f, int proc_mode)
/* get our scanner structure */
if (yylex_init (&scanner) != 0)
{
urj_bsdl_err_set (proc_mode, URJ_ERROR_BSDL_VHDL,
urj_bsdl_ftl_set (proc_mode, URJ_ERROR_BSDL_VHDL,
"Scanner could not be initialized");
return NULL;
}
@ -373,7 +373,7 @@ urj_vhdl_flex_init (FILE *f, int proc_mode)
if (!(extra = malloc (sizeof (urj_bsdl_scan_extra_t))))
{
urj_bsdl_err_set (proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
yylex_destroy (scanner);
return NULL;
@ -463,7 +463,7 @@ new_string (urj_bsdl_scan_extra_t *extra, const char *str)
n_str[n_str_size - 1] = '\0'; /* set very last element to EOS */
}
else
urj_bsdl_err_set (extra->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
urj_bsdl_ftl_set (extra->proc_mode, URJ_ERROR_OUT_OF_MEMORY,
"No memory");
return n_str;
@ -521,7 +521,7 @@ urj_vhdl_flex_switch_file (yyscan_t scanner, char *filename)
f = fopen (db_file, "r");
if (!f)
urj_bsdl_err_set (extra->proc_mode, URJ_ERROR_IO,
urj_bsdl_ftl_set (extra->proc_mode, URJ_ERROR_IO,
"Cannot open file %s or %s", filename,
db_file);
free (db_file);

Loading…
Cancel
Save