[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (b3c56c74dc5b52651c7f0edd32913172f01b82e3)
The branch, master has been updated
via b3c56c74dc5b52651c7f0edd32913172f01b82e3 (commit)
from ef3f88d72a786cc1fe2f2d5f23b386076a348229 (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/rats.c | 92 ++++++++++++++++++++++++++++++------------------------------
1 files changed, 46 insertions(+), 46 deletions(-)
=================
Commit Messages
=================
commit b3c56c74dc5b52651c7f0edd32913172f01b82e3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
rats.c: Tidy up FindPad()
Changes are aimed to simplify the delta of a future patch relating
to object storage. Moves indexed addressing of object structures to
fewer places.
:100644 100644 c6cdb2d... a6e526c... M src/rats.c
=========
Changes
=========
commit b3c56c74dc5b52651c7f0edd32913172f01b82e3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
rats.c: Tidy up FindPad()
Changes are aimed to simplify the delta of a future patch relating
to object storage. Moves indexed addressing of object structures to
fewer places.
diff --git a/src/rats.c b/src/rats.c
index c6cdb2d..a6e526c 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -125,54 +125,54 @@ FindPad (char *ElementName, char *PinNum, ConnectionType * conn, bool Same)
ElementTypePtr element;
Cardinal i;
- if ((element = SearchElementByName (PCB->Data, ElementName)) != NULL)
+ if ((element = SearchElementByName (PCB->Data, ElementName)) == NULL)
+ return false;
+
+ for (i = 0; i < element->PadN; i++)
{
- for (i = 0; i < element->PadN; i++)
- if (NSTRCMP (PinNum, element->Pad[i].Number) == 0 && (!Same
- ||
- !TEST_FLAG
- (DRCFLAG,
- &element->
- Pad[i])))
- {
- conn->type = PAD_TYPE;
- conn->ptr2 = &element->Pad[i];
- conn->group =
- TEST_FLAG (ONSOLDERFLAG, &element->Pad[i]) ? SLayer : CLayer;
- if (TEST_FLAG (EDGE2FLAG, &element->Pad[i]))
- {
- conn->X = element->Pad[i].Point2.X;
- conn->Y = element->Pad[i].Point2.Y;
- }
- else
- {
- conn->X = element->Pad[i].Point1.X;
- conn->Y = element->Pad[i].Point1.Y;
- }
- break;
- }
- if (i == element->PadN)
- {
- for (i = 0; i < element->PinN; i++)
- if (!TEST_FLAG (HOLEFLAG, &element->Pin[i]) &&
- element->Pin[i].Number &&
- NSTRCMP (PinNum, element->Pin[i].Number) == 0 &&
- (!Same || !TEST_FLAG (DRCFLAG, &element->Pin[i])))
- {
- conn->type = PIN_TYPE;
- conn->ptr2 = &element->Pin[i];
- conn->group = SLayer; /* any layer will do */
- conn->X = element->Pin[i].X;
- conn->Y = element->Pin[i].Y;
- break;
- }
- if (i == element->PinN)
- return (false);
- }
- conn->ptr1 = element;
- return (true);
+ PadType *pad = &element->Pad[i];
+
+ if (NSTRCMP (PinNum, pad->Number) == 0 &&
+ (!Same || !TEST_FLAG (DRCFLAG, pad)))
+ {
+ conn->type = PAD_TYPE;
+ conn->ptr1 = element;
+ conn->ptr2 = pad;
+ conn->group = TEST_FLAG (ONSOLDERFLAG, pad) ? SLayer : CLayer;
+
+ if (TEST_FLAG (EDGE2FLAG, pad))
+ {
+ conn->X = pad->Point2.X;
+ conn->Y = pad->Point2.Y;
+ }
+ else
+ {
+ conn->X = pad->Point1.X;
+ conn->Y = pad->Point1.Y;
+ }
+ return true;
+ }
}
- return (false);
+
+ for (i = 0; i < element->PinN; i++)
+ {
+ PinType *pin = &element->Pin[i];
+
+ if (!TEST_FLAG (HOLEFLAG, pin) &&
+ pin->Number && NSTRCMP (PinNum, pin->Number) == 0 &&
+ (!Same || !TEST_FLAG (DRCFLAG, pin)))
+ {
+ conn->type = PIN_TYPE;
+ conn->ptr1 = element;
+ conn->ptr2 = pin;
+ conn->group = SLayer; /* any layer will do */
+ conn->X = pin->X;
+ conn->Y = pin->Y;
+ return true;
+ }
+ }
+
+ return false;
}
/*--------------------------------------------------------------------------
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs