[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (598af81e6d4fec765b6bd3038828776b2f9e401e)



The branch, master has been updated
       via  598af81e6d4fec765b6bd3038828776b2f9e401e (commit)
      from  28615144fe07bb028a36427ad434f5c2bf9a9ece (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/djopt.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)


=================
 Commit Messages
=================

commit 598af81e6d4fec765b6bd3038828776b2f9e401e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    djopt.c: Tidy up element_name_for() by using loop macros

:100644 100644 09abdc5... b5f44b4... M	src/djopt.c

=========
 Changes
=========

commit 598af81e6d4fec765b6bd3038828776b2f9e401e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    djopt.c: Tidy up element_name_for() by using loop macros

diff --git a/src/djopt.c b/src/djopt.c
index 09abdc5..b5f44b4 100644
--- a/src/djopt.c
+++ b/src/djopt.c
@@ -160,19 +160,22 @@ REGISTER_FLAGS (djopt_flag_list)
 static char *
 element_name_for (corner_s * c)
 {
-  int i, p;
-  ElementType *e;
-
-  for (i = 0; i < PCB->Data->ElementN; i++)
+  ELEMENT_LOOP (PCB->Data);
+  {
+    PIN_LOOP (element);
     {
-      e = PCB->Data->Element + i;
-      for (p = 0; p < e->PinN; p++)
-	if (e->Pin + p == c->pin)
-	  return e->Name[1].TextString;
-      for (p = 0; p < e->PadN; p++)
-	if (e->Pad + p == c->pad)
-	  return e->Name[1].TextString;
+      if (pin == c->pin)
+        return element->Name[1].TextString;
     }
+    END_LOOP;
+    PAD_LOOP (element);
+    {
+      if (pad == c->pad)
+        return element->Name[1].TextString;
+    }
+    END_LOOP;
+  }
+  END_LOOP;
   return "unknown";
 }
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs