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

gEDA-cvs: gaf.git: branch: master updated (1.7.2-20111231-56-gfac4d11)



The branch, master has been updated
       via  fac4d11b8c7beb6a711a83ba002682bab0168816 (commit)
       via  d207c8af8e1928b26a1f30deabb3e71f9e8ff507 (commit)
       via  ddddb8fafd9c2598e8b9697adc6dda8bb71bed6d (commit)
      from  31440e054a54001bf462f7da9d31bfc0f0063d3f (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
=========

 gnetlist/src/g_netlist.c |  145 ++++++++++++++++++++++------------------------
 1 files changed, 69 insertions(+), 76 deletions(-)


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

commit fac4d11b8c7beb6a711a83ba002682bab0168816
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Output refdes when g_get_nets() fails.
    
    Affects-bug: lp-912976

:100644 100644 6e8d0fe... f297f6f... M	gnetlist/src/g_netlist.c

commit d207c8af8e1928b26a1f30deabb3e71f9e8ff507
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Clean up g_get_nets() control flow.
    
    Reorganise things to reduce insane nesting depth.

:100644 100644 59143e4... 6e8d0fe... M	gnetlist/src/g_netlist.c

commit ddddb8fafd9c2598e8b9697adc6dda8bb71bed6d
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Re-indent g_get_nets() function. [whitespace]

:100644 100644 b0873a1... 59143e4... M	gnetlist/src/g_netlist.c

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

commit fac4d11b8c7beb6a711a83ba002682bab0168816
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Output refdes when g_get_nets() fails.
    
    Affects-bug: lp-912976

diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index 6e8d0fe..f297f6f 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -405,8 +405,8 @@ SCM g_get_nets(SCM scm_uref, SCM scm_pin)
   } else {
     outerlist = scm_cons (scm_from_utf8_string ("ERROR_INVALID_PIN"),
                           outerlist);
-    fprintf(stderr, "Invalid wanted_pin passed to get-nets [%s]\n",
-            wanted_pin);
+    fprintf(stderr, "Invalid refdes ('%s') and pin ('%s') passed to get-nets\n",
+            wanted_uref, wanted_pin);
   }
 
   scm_dynwind_end ();

commit d207c8af8e1928b26a1f30deabb3e71f9e8ff507
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Clean up g_get_nets() control flow.
    
    Reorganise things to reduce insane nesting depth.

diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index 59143e4..6e8d0fe 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -351,60 +351,53 @@ SCM g_get_nets(SCM scm_uref, SCM scm_pin)
 
   /* search for the first instance */
   /* through the entire list */
-  while (nl_current != NULL) {
-
-    if (nl_current->component_uref) {
-
-      if (strcmp(nl_current->component_uref, wanted_uref) == 0) {
+  for (nl_current = netlist_head;
+       nl_current != NULL;
+       nl_current = nl_current->next) {
 
-        pl_current = nl_current->cpins;
-        while (pl_current != NULL) {
+    if (!nl_current->component_uref) continue;
+    if (strcmp (nl_current->component_uref, wanted_uref) != 0) continue;
 
-          if (pl_current->pin_number) {
-            if (strcmp(pl_current->pin_number, wanted_pin) ==
-                0) {
+    for (pl_current = nl_current->cpins;
+         pl_current != NULL;
+         pl_current = pl_current->next) {
 
-              n_current = pl_current->nets;
+      if (!pl_current->pin_number) continue;
+      if (strcmp(pl_current->pin_number, wanted_pin) != 0) continue;
 
-              if (pl_current->net_name) {
-                net_name = pl_current->net_name;
-              }
+      if (pl_current->net_name) {
+        net_name = pl_current->net_name;
+      }
 
-              while (n_current != NULL) {
+      for (n_current = pl_current->nets;
+           n_current != NULL;
+           n_current = n_current->next) {
 
-                if (n_current->connected_to) {
+        if (!n_current->connected_to) continue;
 
-                  pairlist = SCM_EOL;
-                  pin = (char *) g_malloc(sizeof(char) *
-                                          strlen
-                                          (n_current->
-                                           connected_to));
-                  uref =
-                    (char *) g_malloc(sizeof(char) *
-                                      strlen(n_current->
-                                             connected_to));
+        pairlist = SCM_EOL;
+        pin = (char *) g_malloc(sizeof(char) *
+                                strlen
+                                (n_current->
+                                 connected_to));
+        uref =
+          (char *) g_malloc(sizeof(char) *
+                            strlen(n_current->
+                                   connected_to));
 
-                  sscanf(n_current->connected_to,
-                         "%s %s", uref, pin);
+        sscanf(n_current->connected_to,
+               "%s %s", uref, pin);
 
-                  pairlist = scm_list_n (scm_from_utf8_string (uref),
-                                         scm_from_utf8_string (pin),
-                                         SCM_UNDEFINED);
+        pairlist = scm_list_n (scm_from_utf8_string (uref),
+                               scm_from_utf8_string (pin),
+                               SCM_UNDEFINED);
 
-                  pinslist = scm_cons (pairlist, pinslist);
+        pinslist = scm_cons (pairlist, pinslist);
 
-                  g_free(uref);
-                  g_free(pin);
-                }
-                n_current = n_current->next;
-              }
-            }
-          }
-          pl_current = pl_current->next;
-        }
+        g_free(uref);
+        g_free(pin);
       }
     }
-    nl_current = nl_current->next;
   }
 
   if (net_name != NULL) {

commit ddddb8fafd9c2598e8b9697adc6dda8bb71bed6d
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gnetlist: Re-indent g_get_nets() function. [whitespace]

diff --git a/gnetlist/src/g_netlist.c b/gnetlist/src/g_netlist.c
index b0873a1..59143e4 100644
--- a/gnetlist/src/g_netlist.c
+++ b/gnetlist/src/g_netlist.c
@@ -320,105 +320,105 @@ SCM g_get_all_connections(SCM scm_netname)
 /*  (netname (uref pin) (uref pin) ... ) */
 SCM g_get_nets(SCM scm_uref, SCM scm_pin)
 {
-    SCM outerlist = SCM_EOL;
-    SCM pinslist = SCM_EOL;
-    SCM pairlist = SCM_EOL;
-    NETLIST *nl_current = NULL;
-    CPINLIST *pl_current = NULL;
-    NET *n_current;
-    char *wanted_uref = NULL;
-    char *wanted_pin = NULL;
-    char *net_name = NULL;
-
-    char *pin;
-    char *uref;
+  SCM outerlist = SCM_EOL;
+  SCM pinslist = SCM_EOL;
+  SCM pairlist = SCM_EOL;
+  NETLIST *nl_current = NULL;
+  CPINLIST *pl_current = NULL;
+  NET *n_current;
+  char *wanted_uref = NULL;
+  char *wanted_pin = NULL;
+  char *net_name = NULL;
+
+  char *pin;
+  char *uref;
 
-    SCM_ASSERT(scm_is_string (scm_uref), scm_uref, SCM_ARG1, 
-	       "gnetlist:get-nets");
+  SCM_ASSERT(scm_is_string (scm_uref), scm_uref, SCM_ARG1, 
+             "gnetlist:get-nets");
 
-    SCM_ASSERT(scm_is_string (scm_pin), scm_pin, SCM_ARG2, 
-	       "gnetlist:get-nets");
+  SCM_ASSERT(scm_is_string (scm_pin), scm_pin, SCM_ARG2, 
+             "gnetlist:get-nets");
 
-    scm_dynwind_begin (0);
+  scm_dynwind_begin (0);
 
-    wanted_uref = scm_to_utf8_string (scm_uref);
-    scm_dynwind_free (wanted_uref);
+  wanted_uref = scm_to_utf8_string (scm_uref);
+  scm_dynwind_free (wanted_uref);
 
-    wanted_pin = scm_to_utf8_string (scm_pin);
-    scm_dynwind_free (wanted_pin);
+  wanted_pin = scm_to_utf8_string (scm_pin);
+  scm_dynwind_free (wanted_pin);
 
-    nl_current = netlist_head;
+  nl_current = netlist_head;
 
-    /* search for the first instance */
-    /* through the entire list */
-    while (nl_current != NULL) {
+  /* search for the first instance */
+  /* through the entire list */
+  while (nl_current != NULL) {
 
-	if (nl_current->component_uref) {
+    if (nl_current->component_uref) {
 
-	    if (strcmp(nl_current->component_uref, wanted_uref) == 0) {
+      if (strcmp(nl_current->component_uref, wanted_uref) == 0) {
 
-		pl_current = nl_current->cpins;
-		while (pl_current != NULL) {
+        pl_current = nl_current->cpins;
+        while (pl_current != NULL) {
 
-		    if (pl_current->pin_number) {
-			if (strcmp(pl_current->pin_number, wanted_pin) ==
-			    0) {
+          if (pl_current->pin_number) {
+            if (strcmp(pl_current->pin_number, wanted_pin) ==
+                0) {
 
-			    n_current = pl_current->nets;
+              n_current = pl_current->nets;
 
-			    if (pl_current->net_name) {
-				net_name = pl_current->net_name;
-			    }
+              if (pl_current->net_name) {
+                net_name = pl_current->net_name;
+              }
 
-			    while (n_current != NULL) {
+              while (n_current != NULL) {
 
-				if (n_current->connected_to) {
+                if (n_current->connected_to) {
 
-				    pairlist = SCM_EOL;
-				    pin = (char *) g_malloc(sizeof(char) *
-							  strlen
-							  (n_current->
-							   connected_to));
-				    uref =
-					(char *) g_malloc(sizeof(char) *
-							strlen(n_current->
-							       connected_to));
+                  pairlist = SCM_EOL;
+                  pin = (char *) g_malloc(sizeof(char) *
+                                          strlen
+                                          (n_current->
+                                           connected_to));
+                  uref =
+                    (char *) g_malloc(sizeof(char) *
+                                      strlen(n_current->
+                                             connected_to));
 
-				    sscanf(n_current->connected_to,
-					   "%s %s", uref, pin);
+                  sscanf(n_current->connected_to,
+                         "%s %s", uref, pin);
 
-				    pairlist = scm_list_n (scm_from_utf8_string (uref),
-                                           scm_from_utf8_string (pin),
-                                           SCM_UNDEFINED);
+                  pairlist = scm_list_n (scm_from_utf8_string (uref),
+                                         scm_from_utf8_string (pin),
+                                         SCM_UNDEFINED);
 
-				    pinslist = scm_cons (pairlist, pinslist);
+                  pinslist = scm_cons (pairlist, pinslist);
 
-				    g_free(uref);
-				    g_free(pin);
-				}
-				n_current = n_current->next;
-			    }
-			}
-		    }
-		    pl_current = pl_current->next;
-		}
-	    }
-	}
-	nl_current = nl_current->next;
+                  g_free(uref);
+                  g_free(pin);
+                }
+                n_current = n_current->next;
+              }
+            }
+          }
+          pl_current = pl_current->next;
+        }
+      }
     }
+    nl_current = nl_current->next;
+  }
 
-    if (net_name != NULL) {
-      outerlist = scm_cons (scm_from_utf8_string (net_name), pinslist);
-    } else {
-      outerlist = scm_cons (scm_from_utf8_string ("ERROR_INVALID_PIN"),
-                            outerlist);
-	fprintf(stderr, "Invalid wanted_pin passed to get-nets [%s]\n",
-		wanted_pin);
-    }
+  if (net_name != NULL) {
+    outerlist = scm_cons (scm_from_utf8_string (net_name), pinslist);
+  } else {
+    outerlist = scm_cons (scm_from_utf8_string ("ERROR_INVALID_PIN"),
+                          outerlist);
+    fprintf(stderr, "Invalid wanted_pin passed to get-nets [%s]\n",
+            wanted_pin);
+  }
 
-    scm_dynwind_end ();
+  scm_dynwind_end ();
 
-    return (outerlist);
+  return (outerlist);
 }
 
 




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