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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-179-g05d7c0a)



The branch, master has been updated
       via  05d7c0a430e2334fc24f561268f5dbcee62d14ad (commit)
       via  fbdc2486cc9bf99bc79408ef5b08189a94c89bc1 (commit)
      from  f4dab83b1ca0e197f02f520a6ae525aeac5a252d (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/docs/vams/vams_mode.txt |    3 +-
 gnetlist/include/prototype.h     |    2 +-
 gnetlist/src/vams_misc.c         |   68 +++++++++++++------------------------
 3 files changed, 26 insertions(+), 47 deletions(-)


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

commit 05d7c0a430e2334fc24f561268f5dbcee62d14ad
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 02:37:02 2008 +0100

    gnetlist: Tidy vams_get_package_attributes() and vams_get_attribs_list()
    
    Refactor the code to be cleaner, fixup whitespace, remove old debug cruft.

:100644 100644 af11a60... 7065b54... M	gnetlist/docs/vams/vams_mode.txt
:100644 100644 eb95810... edde9aa... M	gnetlist/include/prototype.h
:100644 100644 aff0767... 0e31e85... M	gnetlist/src/vams_misc.c

commit fbdc2486cc9bf99bc79408ef5b08189a94c89bc1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 02:36:22 2008 +0100

    Remove ineffective search inside symbol in vams_get_package_attributes()
    
    The call to vams_get_attribs_list (...->complex->prim_objs, ...) will
    always fail to return names. This function operates on the passed
    OBJECT, looking at OBJECT->attribs. In this case, the passed OBJECT
    will always be a complex head node with no attributes.
    
    We _might_ want to list the names of any floating attributes inside the
    object (as seems to have been intended in the original code), however
    all "interesting" generic attributes will probably have been promoted to
    the outside anyway. Promotable attributes inside symbols are only hidden
    by default (not deleted), so listing the internal attributes would mean
    we end up with two copies of each promotable attribute in our SCM list.
    
    There are also quite a number of uninteresting attributes inside most
    symbols which we may not want listing as generics. For now delete the
    broken code attempting to list internal attribute names.
    
    This commit doesn't change any netlist output.

:100644 100644 072264e... aff0767... M	gnetlist/src/vams_misc.c

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

commit 05d7c0a430e2334fc24f561268f5dbcee62d14ad
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 02:37:02 2008 +0100

    gnetlist: Tidy vams_get_package_attributes() and vams_get_attribs_list()
    
    Refactor the code to be cleaner, fixup whitespace, remove old debug cruft.

diff --git a/gnetlist/docs/vams/vams_mode.txt b/gnetlist/docs/vams/vams_mode.txt
index af11a60..7065b54 100644
--- a/gnetlist/docs/vams/vams_mode.txt
+++ b/gnetlist/docs/vams/vams_mode.txt
@@ -365,8 +365,7 @@ CONTENT:
    VHDL-AMS GENERIC MAP.
  
 
-     char* vams_get_attribs_list 
-	   (OBJECT *object, SCM *list, OBJECT **return_found)
+     SCM vams_get_attribs_list(OBJECT *object)
 
    It exists only for the support of the first function.
 	   
diff --git a/gnetlist/include/prototype.h b/gnetlist/include/prototype.h
index eb95810..edde9aa 100644
--- a/gnetlist/include/prototype.h
+++ b/gnetlist/include/prototype.h
@@ -113,5 +113,5 @@ CPINLIST *s_traverse_component(TOPLEVEL *pr_current, OBJECT *component, char *hi
 void s_traverse_clear_all_visited(OBJECT *object_head);
 NET *s_traverse_net(TOPLEVEL *pr_current, OBJECT *previous_object, NET *nets, OBJECT *object, char *hierarchy_tag);
 /* vams_misc.c */
-char *vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found);
+SCM vams_get_attribs_list(OBJECT *object);
 SCM vams_get_package_attributes(SCM scm_uref);
diff --git a/gnetlist/src/vams_misc.c b/gnetlist/src/vams_misc.c
index aff0767..0e31e85 100644
--- a/gnetlist/src/vams_misc.c
+++ b/gnetlist/src/vams_misc.c
@@ -35,10 +35,10 @@
 #include <dmalloc.h>
 #endif
 
-/* be sure caller free's return value */
-char *
-vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found) 
+SCM
+vams_get_attribs_list (OBJECT *object)
 {
+  SCM list = SCM_EOL;
   OBJECT *o_current;
   GList *a_iter;
   OBJECT *a_current;
@@ -47,6 +47,7 @@ vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found)
 
   o_current = object;
 
+  /* search outside the symbol (attached attributes only) */
   a_iter = o_current->attribs;
   while(a_iter != NULL) {
     a_current = a_iter->data;
@@ -55,54 +56,41 @@ vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found)
                                     &found_name, NULL);
 
       if (val) {
-        *list = scm_cons (scm_makfrom0str (found_name), *list);
+        list = scm_cons (scm_makfrom0str (found_name), list);
       }
 
-     g_free(found_name);
-#if DEBUG
-      printf("0 _%s_\n", found->text->string);
-      printf("1 _%s_\n", found_name);
-      printf("2 _%s_\n", found_value);
-#endif
+      g_free (found_name);
     }
     a_iter = g_list_next (a_iter);
   }
 
-  return (NULL);
+  return list;
 }
 
 SCM
 vams_get_package_attributes(SCM scm_uref)
 {
-	SCM list = SCM_EOL;
-	NETLIST *nl_current;
-	char *uref;
-	char *return_value=NULL;
-
-	SCM_ASSERT(scm_is_string (scm_uref), scm_uref, SCM_ARG1, 
-		   "gnetlist:vams-get-package-attributes");
+  NETLIST *nl_current;
+  char *uref;
 
-    uref = SCM_STRING_CHARS (scm_uref);
+  SCM_ASSERT(scm_is_string (scm_uref), scm_uref, SCM_ARG1,
+             "gnetlist:vams-get-package-attributes");
 
-	/* here is where you make it multi page aware */
-	nl_current = netlist_head;
+  uref = SCM_STRING_CHARS (scm_uref);
 
-	/* search for the first instance */
-	/* through the entire list */
-	while(nl_current != NULL) {
+  /* here is where you make it multi page aware */
+  nl_current = netlist_head;
 
-	      if (nl_current->component_uref) {
-		if (strcmp(nl_current->component_uref, uref) == 0) {
+  /* search for the first instance */
+  /* through the entire list */
+  while(nl_current != NULL) {
 
-			/* search outside the symbol (attached attributes only) */
-			return_value = vams_get_attribs_list(
-						    nl_current->object_ptr, &list,NULL);
-			break;
-		}
-	      }
-	      nl_current = nl_current->next;
-	}
+    if (nl_current->component_uref &&
+        strcmp(nl_current->component_uref, uref) == 0) {
+      return vams_get_attribs_list (nl_current->object_ptr);
+    }
+    nl_current = nl_current->next;
+  }
 
-	return(list);
+  return SCM_EOL;
 }
-

commit fbdc2486cc9bf99bc79408ef5b08189a94c89bc1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 02:36:22 2008 +0100

    Remove ineffective search inside symbol in vams_get_package_attributes()
    
    The call to vams_get_attribs_list (...->complex->prim_objs, ...) will
    always fail to return names. This function operates on the passed
    OBJECT, looking at OBJECT->attribs. In this case, the passed OBJECT
    will always be a complex head node with no attributes.
    
    We _might_ want to list the names of any floating attributes inside the
    object (as seems to have been intended in the original code), however
    all "interesting" generic attributes will probably have been promoted to
    the outside anyway. Promotable attributes inside symbols are only hidden
    by default (not deleted), so listing the internal attributes would mean
    we end up with two copies of each promotable attribute in our SCM list.
    
    There are also quite a number of uninteresting attributes inside most
    symbols which we may not want listing as generics. For now delete the
    broken code attempting to list internal attribute names.
    
    This commit doesn't change any netlist output.

diff --git a/gnetlist/src/vams_misc.c b/gnetlist/src/vams_misc.c
index 072264e..aff0767 100644
--- a/gnetlist/src/vams_misc.c
+++ b/gnetlist/src/vams_misc.c
@@ -94,17 +94,9 @@ vams_get_package_attributes(SCM scm_uref)
 	      if (nl_current->component_uref) {
 		if (strcmp(nl_current->component_uref, uref) == 0) {
 
-			/* first search outside the symbol */
+			/* search outside the symbol (attached attributes only) */
 			return_value = vams_get_attribs_list(
 						    nl_current->object_ptr, &list,NULL);
-
-			if (return_value) {
-				break;
-			}
-
-			/* now search inside the symbol */
-			return_value = vams_get_attribs_list(
-						    nl_current->object_ptr->complex->prim_objs, &list,NULL);
 			break;
 		}
 	      }




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