[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: g_netlist.c
User: sdb
Date: 06/01/04 09:36:25
Modified: . g_netlist.c s_net.c s_rename.c s_traverse.c
Log:
Modified code to emit
"unconnected_pin-<number>" to fix bug noticed by John Doty.
Besides modifying s_net.c to achieve this, I had to change
the strcmp fcn in many files to a strncmp fcn to compare only
the first 15 chars against "unconnected_pin". Added strncmp?
to scheme/gnetlist.scm to do this for Scheme backends.
Revision Changes Path
1.41 +3 -2 eda/geda/devel/gnetlist/src/g_netlist.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: g_netlist.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gnetlist/src/g_netlist.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- g_netlist.c 28 Dec 2005 21:41:41 -0000 1.40
+++ g_netlist.c 4 Jan 2006 14:36:25 -0000 1.41
@@ -166,7 +166,8 @@
net_name = pl_current->net_name;
/* filter off unconnected pins */
- if (strcmp(net_name, "unconnected_pin") != 0) {
+ if (strncmp(net_name, "unconnected_pin", 15) != 0) {
+ /*printf("Got net: `%s'\n",net_name); */
/* add the net name to the list */
#if DEBUG
printf("Got net: `%s'\n", net_name);
@@ -209,7 +210,7 @@
net_name = pl_current->net_name;
/* filter off unconnected pins */
- if (strcmp(net_name, "unconnected_pin") != 0) {
+ if (strncmp(net_name, "unconnected_pin", 15) != 0) {
/* add the net name to the list */
/*printf("Got net: `%s'\n",net_name); */
1.28 +13 -9 eda/geda/devel/gnetlist/src/s_net.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_net.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gnetlist/src/s_net.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- s_net.c 4 Feb 2005 23:14:31 -0000 1.27
+++ s_net.c 4 Jan 2006 14:36:25 -0000 1.28
@@ -40,9 +40,11 @@
#include <dmalloc.h>
#endif
-static int unnamed_counter = 1;
+static int unnamed_net_counter = 1;
+static int unnamed_pin_counter = 1;
-#define MAX_UNNAMED 99999999
+#define MAX_UNNAMED_NETS 99999999
+#define MAX_UNNAMED_PINS 99999999
/* hack rename this to be s_return_tail */
/* update object_tail or any list of that matter */
@@ -431,10 +433,12 @@
if (net_head->nid == -1 && net_head->prev == NULL
&& net_head->next == NULL) {
string =
- (char *) malloc(sizeof(char) * (strlen("unconnected_pin")) +
- 1);
+ (char *) malloc(sizeof(char) * (strlen("unconnected_pin-")) +
+ 10);
+
+ sprintf(string, "unconnected_pin-%d",
+ unnamed_pin_counter++);
- sprintf(string, "unconnected_pin");
return (string);
}
@@ -447,12 +451,12 @@
}
/* have we exceeded the number of unnamed nets? */
- if (unnamed_counter < MAX_UNNAMED) {
+ if (unnamed_net_counter < MAX_UNNAMED_NETS) {
if (netlist_mode == SPICE) {
string =
(char *) malloc(sizeof(char) * (strlen("99999") + 10));
- sprintf(string, "%d", unnamed_counter++);
+ sprintf(string, "%d", unnamed_net_counter++);
return (string);
} else {
@@ -465,7 +469,7 @@
temp =
(char *) malloc(sizeof(char) * (strlen("99999") + 10));
sprintf(temp, "%s%d", pr_current->unnamed_netname,
- unnamed_counter++);
+ unnamed_net_counter++);
misc =
s_hierarchy_create_netname(pr_current, temp,
@@ -474,7 +478,7 @@
free(misc);
} else {
sprintf(string, "%s%d", pr_current->unnamed_netname,
- unnamed_counter++);
+ unnamed_net_counter++);
}
return (string);
1.17 +0 -5 eda/geda/devel/gnetlist/src/s_rename.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_rename.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gnetlist/src/s_rename.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- s_rename.c 15 Aug 2005 01:26:49 -0000 1.16
+++ s_rename.c 4 Jan 2006 14:36:25 -0000 1.17
@@ -294,11 +294,6 @@
for (temp = last_set->first_rename; temp; temp = temp->next)
{
verbose_print("R");
-
-#if DEBUG
- printf("%d Renaming: %s -> %s\n", i, temp->src, temp->dest);
-#endif
-
s_rename_all_lowlevel(netlist_head, temp->src, temp->dest);
}
}
1.41 +0 -6 eda/geda/devel/gnetlist/src/s_traverse.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: s_traverse.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gnetlist/src/s_traverse.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- s_traverse.c 4 Feb 2005 23:14:31 -0000 1.40
+++ s_traverse.c 4 Jan 2006 14:36:25 -0000 1.41
@@ -66,12 +66,6 @@
p_current = pr_current->page_head;
-#if DEBUG
- o_conn_print_hash(pr_current->page_current->conn_table);
-#endif
-
-
-
while (p_current != NULL) {
if (p_current->pid != -1) {