Improve GDS parser

This commit is contained in:
Mario Hüttel 2019-03-06 20:04:49 +01:00
parent 59835018af
commit 43fdab4533

View File

@ -662,7 +662,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
break; break;
case SREF: case SREF:
if (current_cell == NULL) { if (current_cell == NULL) {
GDS_ERROR("Path outside of cell"); GDS_ERROR("Cell Reference outside of cell");
run = -3; run = -3;
break; break;
} }
@ -810,7 +810,11 @@ int parse_gds_from_file(const char *filename, GList **library_list)
break; break;
case SNAME: case SNAME:
name_cell_ref(current_s_reference, read, workbuff); if (current_s_reference) {
name_cell_ref(current_s_reference, (unsigned int)read, workbuff);
} else {
GDS_ERROR("reference name set outside of cell reference.\n");
}
break; break;
case WIDTH: case WIDTH:
if (!current_graphics) { if (!current_graphics) {
@ -863,7 +867,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
break; break;
} }
if (current_graphics->gfx_type == GRAPHIC_PATH) { if (current_graphics->gfx_type == GRAPHIC_PATH) {
current_graphics->path_render_type = (int)gds_convert_signed_int16(workbuff); current_graphics->path_render_type = (enum path_type)gds_convert_signed_int16(workbuff);
GDS_INF("\t\tPathtype: %d\n", current_graphics->path_render_type); GDS_INF("\t\tPathtype: %d\n", current_graphics->path_render_type);
} else { } else {
GDS_WARN("Path type defined inside non-path graphics object. Ignoring"); GDS_WARN("Path type defined inside non-path graphics object. Ignoring");