ID: | 2608 |
From: | Gabriel Paubert <pa...@iram.es> |
Date: | Thu, 24 Jan 2019 09:18:50 +0100 |
Subject: | Re: [pcb-rnd] Wishlist: trim the shortened connection reports in half |
in-reply-to: | 2585 from ge...@igor2.repo.hu |
replies: | 2609 from ge...@igor2.repo.hu |
On Thu, Jan 17, 2019 at 03:51:57PM +0100, gedau@igor2.repo.hu wrote: > > > On Thu, 17 Jan 2019, Gabriel Paubert wrote: > > > Hello, > > > >when continuing with my current project, I sometimes have real shorts, > >but the message window looks like this: > > > >Warning! Net "GND" is shorted to net "unnamed_net273" > >Warning! Net "unnamed_net273" is shorted to net "GND" > >Warning! Net "unnamed_net279" is shorted to net "unnamed_net287" > >Warning! Net "unnamed_net285" is shorted to net "unnamed_net286" > >Warning! Net "unnamed_net286" is shorted to net "unnamed_net285" > >Warning! Net "unnamed_net287" is shorted to net "unnamed_net279" > >22 rat lines remaining > > > >You'll see that every line is duplicated: > >Net "A" is shorted to net "B" > >Net "B" is shorted to net "A" > > > >Well, one of the properties of the shorts is that they are commutative. > >Why do we need to print the same information twice? > > > >I think that the fix is simple, only print the message when the first > >net name is lexicographically less (or greater, doesn't matter) than > >the second. A simple strcmp(3) should be enough. > > > > Thanks, saving this for the next cycle when I plan to do a full netlist > code rewrite (need to clean that thing up for the new drc). > Actually, the appended one liner works for me. Regards, Gabriel Index: src/rats.c =================================================================== --- src/rats.c (revision 22734) +++ src/rats.c (working copy) @@ -335,7 +335,7 @@ *menu = term->ratconn; if ((m == NULL) || (m->Name == NULL)) pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to an unknown net\n"), &theNet->Name[2]); - else + else if (strcmp(&theNet->Name[2], &(m)->Name[2]) <= 0) pcb_message(PCB_MSG_WARNING, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"), &theNet->Name[2], &(m)->Name[2]); pcb_stub_rat_found_short((pcb_any_obj_t *)term, &theNet->Name[2]); }
Reply subtree:
2608 Re: [pcb-rnd] Wishlist: trim the shortened connection reports in half from Gabriel Paubert <pa...@iram.es>
2609 Re: [pcb-rnd] Wishlist: trim the shortened connection reports in from ge...@igor2.repo.hu