From b521994a08e6a61a617b54241c0f089687bcde97 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 26 Aug 2023 14:28:35 +0200 Subject: [PATCH] prefix ERC infowindow messages with Error: or Warning: or Info: --- src/netlist.c | 19 ++++++++++--------- src/node_hash.c | 10 +++++----- src/select.c | 14 +++++++------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/netlist.c b/src/netlist.c index ffcfa32c..35ccfcdb 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -275,7 +275,7 @@ static int hash_inst_pin(int what, int i, int j) if(for_netlist && jinst[i].name, j, prop_ptr); statusmsg(str,2); err |= 1; @@ -652,7 +652,7 @@ static int signal_short( const char *tag, const char *n1, const char *n2) if( n1 && n2 && strcmp( n1, n2) ) { err |= 1; - my_snprintf(str, S(str), "%s shorted: %s - %s", tag, n1, n2); + my_snprintf(str, S(str), "Error: %s shorted: %s - %s", tag, n1, n2); dbg(1, "signal_short(): signal_short: shorted: %s - %s", n1, n2); statusmsg(str,2); tcleval("show_infotext"); /* critical error: force ERC window showing */ @@ -1073,7 +1073,7 @@ static int name_nodes_of_pins_labels_and_propagate() strcmp(type, "attributes") && strcmp(type, "netlist_options") && strcmp(type, "use")) { - my_snprintf(str, S(str), "instance: %d (%s): no name attribute set", i, inst[i].name); + my_snprintf(str, S(str), "Warning: instance: %d (%s): no name attribute set", i, inst[i].name); statusmsg(str,2); inst[i].color = -PINLAYER; xctx->hilight_nets=1; @@ -1081,7 +1081,7 @@ static int name_nodes_of_pins_labels_and_propagate() } if(print_erc && (!type || !type[0]) ) { char str[2048]; - my_snprintf(str, S(str), "Symbol: %s: no type attribute set", inst[i].name); + my_snprintf(str, S(str), "Warning: Symbol: %s: no type attribute set", inst[i].name); statusmsg(str,2); inst[i].color = -PINLAYER; xctx->hilight_nets=1; @@ -1355,7 +1355,7 @@ int warning_overlapped_symbols(int sel) xctx->inst[i].sel = SELECTED; xctx->need_reb_sel_arr = 1; } - my_snprintf(str, S(str), "Warning: overlapped instance found: %s(%s) -> %s\n", + my_snprintf(str, S(str), "Error: overlapped instance found: %s(%s) -> %s\n", xctx->inst[i].instname, xctx->inst[i].name, xctx->inst[found->value].instname); statusmsg(str,2); err |= 1; @@ -1522,7 +1522,7 @@ int sym_vs_sch_pins() ) ) { char str[2048]; - my_snprintf(str, S(str), "Symbol %s: Unmatched subcircuit schematic pin direction: %s", + my_snprintf(str, S(str), "Error: Symbol %s: Unmatched subcircuit schematic pin direction: %s", xctx->sym[i].name, lab); statusmsg(str,2); my_snprintf(str, S(str), " %s <--> %s", type, pin_dir); @@ -1543,7 +1543,8 @@ int sym_vs_sch_pins() if(!pin_match) { char str[2048]; /* fprintf(errfp, " unmatched sch / sym pin: %s\n", lab); */ - my_snprintf(str, S(str), "Symbol %s: schematic pin: %s not in symbol", xctx->sym[i].name, lab); + my_snprintf(str, S(str), "Error: Symbol %s: schematic pin: %s not in symbol", + xctx->sym[i].name, lab); statusmsg(str,2); err |= 1; tcleval("show_infotext"); /* critical error: force ERC window showing */ @@ -1578,7 +1579,7 @@ int sym_vs_sch_pins() fclose(fd); if(pin_cnt != rects) { char str[2048]; - my_snprintf(str, S(str), "Symbol %s has %d pins, its schematic has %d pins", + my_snprintf(str, S(str), "Error: Symbol %s has %d pins, its schematic has %d pins", xctx->sym[i].name, rects, pin_cnt); statusmsg(str,2); err |= 1; @@ -1603,7 +1604,7 @@ int sym_vs_sch_pins() if(!pin_match) { char str[2048]; /* fprintf(errfp, " unmatched sch / sym pin: %s\n", lab); */ - my_snprintf(str, S(str), "Symbol %s: symbol pin: %s not in schematic", + my_snprintf(str, S(str), "Error: Symbol %s: symbol pin: %s not in schematic", xctx->sym[i].name, pin_name ? pin_name : ""); statusmsg(str,2); err |= 1; diff --git a/src/node_hash.c b/src/node_hash.c index 2291875b..70ad7a7c 100644 --- a/src/node_hash.c +++ b/src/node_hash.c @@ -209,7 +209,7 @@ int traverse_node_hash() if( !record_global_node(3, NULL, entry->token)) { if(entry->d.out ==0 && entry->d.inout == 0) { - my_snprintf(str, S(str), "undriven node: %s", entry->token); + my_snprintf(str, S(str), "Error: undriven node: %s", entry->token); if(!xctx->netlist_count) bus_hilight_hash_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE); if(incr_hi) incr_hilight_color(); statusmsg(str, 2); @@ -218,28 +218,28 @@ int traverse_node_hash() } else if(entry->d.out + entry->d.inout + entry->d.in == 1) { - my_snprintf(str, S(str), "open net: %s", entry->token); + my_snprintf(str, S(str), "Warning: open net: %s", entry->token); if(!xctx->netlist_count) bus_hilight_hash_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE); if(incr_hi) incr_hilight_color(); statusmsg(str,2); } else if(entry->d.out >=2 && entry->d.port>=0) /* era d.port>=2 03102001 */ { - my_snprintf(str, S(str), "shorted output node: %s", entry->token); + my_snprintf(str, S(str), "Warning: shorted output node: %s", entry->token); if(!xctx->netlist_count) bus_hilight_hash_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE); if(incr_hi) incr_hilight_color(); statusmsg(str,2); } else if(entry->d.in ==0 && entry->d.inout == 0) { - my_snprintf(str, S(str), "node: %s goes nowhere", entry->token); + my_snprintf(str, S(str), "Warning: node: %s goes nowhere", entry->token); if(!xctx->netlist_count) bus_hilight_hash_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE); if(incr_hi) incr_hilight_color(); statusmsg(str,2); } else if(entry->d.out >=2 && entry->d.inout == 0 && entry->d.port>=0) /* era d.port>=2 03102001 */ { - my_snprintf(str, S(str), "shorted output node: %s", entry->token); + my_snprintf(str, S(str), "Warning: shorted output node: %s", entry->token); if(!xctx->netlist_count) bus_hilight_hash_lookup(entry->token, xctx->hilight_color, XINSERT_NOREPLACE); if(incr_hi) incr_hilight_color(); statusmsg(str,2); diff --git a/src/select.c b/src/select.c index 63f6e4ab..91765b1c 100644 --- a/src/select.c +++ b/src/select.c @@ -746,7 +746,7 @@ void select_wire(int i,unsigned short select_mode, int fast) /*my_strncpy(s,xctx->wire[i].prop_ptr!=NULL?xctx->wire[i].prop_ptr:"",256); */ if( !fast ) { - my_snprintf(str, S(str), "selected wire: n=%d end1=%d end2=%d\nnode=%s",i, + my_snprintf(str, S(str), "Info: selected wire: n=%d end1=%d end2=%d\nnode=%s",i, xctx->wire[i].end1, xctx->wire[i].end2, xctx->wire[i].prop_ptr? xctx->wire[i].prop_ptr: "(null)"); statusmsg(str,2); @@ -789,7 +789,7 @@ void select_element(int i,unsigned short select_mode, int fast, int override_loc my_strncpy(s,xctx->inst[i].prop_ptr!=NULL?xctx->inst[i].prop_ptr:"",S(s)); if( !fast ) { - my_snprintf(str, S(str), "selected element %d: %s properties: %s", i, xctx->inst[i].name,s); + my_snprintf(str, S(str), "Info: selected element %d: %s properties: %s", i, xctx->inst[i].name,s); statusmsg(str,2); my_snprintf(str, S(str), "symbol name=%s", xctx->inst[i].name==NULL?"(null)":xctx->inst[i].name); statusmsg(str,2); @@ -836,7 +836,7 @@ void select_text(int i,unsigned short select_mode, int fast) #endif if(!fast) { my_strncpy(s,xctx->text[i].prop_ptr!=NULL?xctx->text[i].prop_ptr:"",S(s)); - my_snprintf(str, S(str), "selected text %d: properties: %s", i,s); + my_snprintf(str, S(str), "Info: selected text %d: properties: %s", i,s); statusmsg(str,2); my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g", i, xctx->text[i].x0, xctx->text[i].y0); statusmsg(str,1); @@ -874,7 +874,7 @@ void select_box(int c, int i, unsigned short select_mode, int fast, int override if(!fast) { my_strncpy(s,xctx->rect[c][i].prop_ptr!=NULL?xctx->rect[c][i].prop_ptr:"",S(s)); - my_snprintf(str, S(str), "selected box : layer=%d, n=%d properties: %s",c-4,i,s); + my_snprintf(str, S(str), "Info: selected box : layer=%d, n=%d properties: %s",c-4,i,s); statusmsg(str,2); my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g w = %.16g h = %.16g", @@ -913,7 +913,7 @@ void select_arc(int c, int i, unsigned short select_mode, int fast) if(!fast) { my_strncpy(s,xctx->rect[c][i].prop_ptr!=NULL?xctx->rect[c][i].prop_ptr:"",S(s)); - my_snprintf(str, S(str), "selected arc : layer=%d, n=%d properties: %s",c-4,i,s); + my_snprintf(str, S(str), "Info: selected arc : layer=%d, n=%d properties: %s",c-4,i,s); statusmsg(str,2); my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g r = %.16g a = %.16g b = %.16g", @@ -942,7 +942,7 @@ void select_polygon(int c, int i, unsigned short select_mode, int fast ) if(!fast) { my_strncpy(s,xctx->poly[c][i].prop_ptr!=NULL?xctx->poly[c][i].prop_ptr:"",S(s)); - my_snprintf(str, S(str), "selected polygon: layer=%d, n=%d properties: %s",c-4,i,s); + my_snprintf(str, S(str), "Info: selected polygon: layer=%d, n=%d properties: %s",c-4,i,s); statusmsg(str,2); my_snprintf(str, S(str), "n=%4d x0 = %.16g y0 = %.16g ...", i, xctx->poly[c][i].x[0], xctx->poly[c][i].y[0]); @@ -964,7 +964,7 @@ void select_line(int c, int i, unsigned short select_mode, int fast ) if(!fast) { my_strncpy(s,xctx->line[c][i].prop_ptr!=NULL?xctx->line[c][i].prop_ptr:"",S(s)); - my_snprintf(str, S(str), "selected line: layer=%d, n=%d properties: %s",c-4,i,s); + my_snprintf(str, S(str), "Info: selected line: layer=%d, n=%d properties: %s",c-4,i,s); statusmsg(str,2); my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g w = %.16g h = %.16g",