[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-372-gc24af02)
The branch, master has been updated
via c24af025cba433db83db48d4b614632b2d5a517c (commit)
from 7f4ec05b6812bf412ad23da67b82c9378c57aa0c (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
=========
gschem/src/o_misc.c | 84 +++++++---------------------------
gschem/src/o_place.c | 10 +---
libgeda/include/prototype.h | 1 -
libgeda/src/s_conn.c | 106 ++++++++++++++++++++-----------------------
4 files changed, 67 insertions(+), 134 deletions(-)
=================
Commit Messages
=================
commit c24af025cba433db83db48d4b614632b2d5a517c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Fri Dec 12 16:08:43 2008 +0000
Replace calls to s_conn_return_complex_others() with s_conn_return_others()
Teach s_conn_return_others() to understand COMPLEX objects.
:100644 100644 8e3180e... 2fdd827... M gschem/src/o_misc.c
:100644 100644 09a1048... 3a5d010... M gschem/src/o_place.c
:100644 100644 f3cc094... 8e3a6ed... M libgeda/include/prototype.h
:100644 100644 a8b3321... ff2f863... M libgeda/src/s_conn.c
=========
Changes
=========
commit c24af025cba433db83db48d4b614632b2d5a517c
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Fri Dec 12 16:08:43 2008 +0000
Replace calls to s_conn_return_complex_others() with s_conn_return_others()
Teach s_conn_return_others() to understand COMPLEX objects.
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 8e3180e..2fdd827 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -210,24 +210,11 @@ void o_rotate_world_update(GSCHEM_TOPLEVEL *w_current,
* connection list. We only _really_ want those objects connected
* to the selection, not those within in it. The extra redraws
* don't _really_ hurt though. */
- o_iter = list;
- while (o_iter != NULL) {
+ for (o_iter = list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
o_current = o_iter->data;
- switch (o_current->type) {
- case OBJ_COMPLEX:
- case OBJ_PLACEHOLDER:
- other_objects =
- s_conn_return_complex_others(other_objects, o_current);
- s_conn_remove_object (toplevel, o_current);
- break;
- case OBJ_NET:
- case OBJ_PIN:
- case OBJ_BUS:
- other_objects = s_conn_return_others(other_objects, o_current);
- s_conn_remove_object (toplevel, o_current);
- break;
- }
- o_iter = g_list_next (o_iter);
+
+ other_objects = s_conn_return_others (other_objects, o_current);
+ s_conn_remove_object (toplevel, o_current);
}
o_glist_rotate_world( toplevel, centerx, centery, angle, list );
@@ -236,24 +223,11 @@ void o_rotate_world_update(GSCHEM_TOPLEVEL *w_current,
* connection list. We only _really_ want those objects connected
* to the selection, not those within in it. The extra redraws dont
* _really_ hurt though. */
- o_iter = list;
- while (o_iter != NULL) {
+ for (o_iter = list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
o_current = o_iter->data;
- switch (o_current->type) {
- case OBJ_COMPLEX:
- case OBJ_PLACEHOLDER:
- s_conn_update_object (toplevel, o_current);
- connected_objects =
- s_conn_return_complex_others(connected_objects, o_current);
- break;
- case OBJ_NET:
- case OBJ_PIN:
- case OBJ_BUS:
- s_conn_update_object (toplevel, o_current);
- connected_objects = s_conn_return_others(connected_objects, o_current);
- break;
- }
- o_iter = g_list_next (o_iter);
+
+ s_conn_update_object (toplevel, o_current);
+ connected_objects = s_conn_return_others (connected_objects, o_current);
}
if (!toplevel->DONT_REDRAW) {
@@ -340,24 +314,11 @@ void o_mirror_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery,
* connection list. We only _really_ want those objects connected
* to the selection, not those within in it. The extra redraws
* don't _really_ hurt though. */
- o_iter = list;
- while (o_iter != NULL) {
+ for (o_iter = list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
o_current = o_iter->data;
- switch (o_current->type) {
- case OBJ_COMPLEX:
- case OBJ_PLACEHOLDER:
- other_objects =
- s_conn_return_complex_others(other_objects, o_current);
- s_conn_remove_object (toplevel, o_current);
- break;
- case OBJ_NET:
- case OBJ_PIN:
- case OBJ_BUS:
- other_objects = s_conn_return_others(other_objects, o_current);
- s_conn_remove_object (toplevel, o_current);
- break;
- }
- o_iter = g_list_next (o_iter);
+
+ other_objects = s_conn_return_others (other_objects, o_current);
+ s_conn_remove_object (toplevel, o_current);
}
o_glist_mirror_world( toplevel, centerx, centery, list );
@@ -366,24 +327,11 @@ void o_mirror_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery,
* connection list. We only _really_ want those objects connected
* to the selection, not those within in it. The extra redraws dont
* _really_ hurt though. */
- o_iter = list;
- while (o_iter != NULL) {
+ for (o_iter = list; o_iter != NULL; o_iter = g_list_next (o_iter)) {
o_current = o_iter->data;
- switch (o_current->type) {
- case OBJ_COMPLEX:
- case OBJ_PLACEHOLDER:
- s_conn_update_object (toplevel, o_current);
- connected_objects =
- s_conn_return_complex_others(connected_objects, o_current);
- break;
- case OBJ_NET:
- case OBJ_PIN:
- case OBJ_BUS:
- s_conn_update_object (toplevel, o_current);
- connected_objects = s_conn_return_others(connected_objects, o_current);
- break;
- }
- o_iter = g_list_next (o_iter);
+
+ s_conn_update_object (toplevel, o_current);
+ connected_objects = s_conn_return_others (connected_objects, o_current);
}
o_draw_list (w_current, list);
diff --git a/gschem/src/o_place.c b/gschem/src/o_place.c
index 09a1048..3a5d010 100644
--- a/gschem/src/o_place.c
+++ b/gschem/src/o_place.c
@@ -102,14 +102,8 @@ void o_place_end (GSCHEM_TOPLEVEL *w_current,
o_selection_add (toplevel->page_current->selection_list, o_current);
/* Update object connectivity */
- if (o_current->type == OBJ_COMPLEX || o_current->type == OBJ_PLACEHOLDER) {
- s_conn_update_object (toplevel, o_current);
- connected_objects =
- s_conn_return_complex_others (connected_objects, o_current);
- } else {
- s_conn_update_object (toplevel, o_current);
- connected_objects = s_conn_return_others (connected_objects, o_current);
- }
+ s_conn_update_object (toplevel, o_current);
+ connected_objects = s_conn_return_others (connected_objects, o_current);
}
o_cue_redraw_all (w_current, temp_dest_list, TRUE);
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index f3cc094..8e3a6ed 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -365,7 +365,6 @@ void s_conn_update_object(TOPLEVEL *toplevel, OBJECT *object);
void s_conn_print(GList *conn_list);
int s_conn_net_search(OBJECT* new_net, int whichone, GList * conn_list);
GList *s_conn_return_others(GList *input_list, OBJECT *object);
-GList *s_conn_return_complex_others(GList *input_list, OBJECT *object);
/* s_cue.c */
void s_cue_postscript_fillbox(TOPLEVEL *toplevel, FILE *fp, int x, int y);
diff --git a/libgeda/src/s_conn.c b/libgeda/src/s_conn.c
index a8b3321..ff2f863 100644
--- a/libgeda/src/s_conn.c
+++ b/libgeda/src/s_conn.c
@@ -788,86 +788,78 @@ int s_conn_net_search(OBJECT* new_net, int whichone, GList * conn_list)
return FALSE;
}
-/*! \brief get a list of all objects connected to this one
+/*! \brief get a list of all objects connected to a list of OBJECTs.
+ *
* \par Function Description
* This function gets all other_object from the connection
- * list of the current object. If an <b>input_list</b> is given, the other
- * objects are appended to that list. If the input list is <b>NULL</b>, a new
- * list is returned
- * \param input_list GList of OBJECT's or NULL
- * \param object OBJECT to get other OBJECTs from
+ * list of the OBJECTs in the pased list.
+ *
+ * \param [in] input_list GList of OBJECT's or NULL
+ * \param [in] obj_list The GList of OBJECT to get connections from
* \return A GList of objects
+ *
* \warning
* Caller must g_list_free returned GList pointer.
* Do not free individual data items in list.
*/
-GList *s_conn_return_others(GList *input_list, OBJECT *object)
+static GList *s_conn_return_glist_others (GList *input_list, GList *obj_list)
{
- CONN *conn;
- GList *cl_current;
- GList *return_list=NULL;
+ GList *return_list;
+ GList *iter;
+ OBJECT *o_current;
return_list = input_list;
-
- cl_current = object->conn_list;
- while (cl_current != NULL) {
- conn = (CONN *) cl_current->data;
-
- if (conn->other_object && conn->other_object != object) {
- return_list = g_list_append(return_list, conn->other_object);
- }
-
- cl_current = g_list_next(cl_current);
+ for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
+ o_current = iter->data;
+ return_list = s_conn_return_others (return_list, o_current);
}
- return(return_list);
+ return return_list;
}
-/*! \brief get a list of all objects connected to this complex one
+/*! \brief get a list of all objects connected to this one
+ *
* \par Function Description
- * This function gets all other_object from the connection
- * list of all underlying OBJECTs of the given complex OBJECT.
- * If an <b>input_list</b> is given, the other
- * objects are appended to that list. If the input list is <b>NULL</b>, a new
- * list is returned
- * \param input_list GList of OBJECT's or NULL
- * \param object complex OBJECT to get other objects from
- * \return A GList of objects
+ * This function gets all other_object from the connection list of the current object.
+ * COMPLEX objects are entered, and their prim_objs processed. If an <b>input_list</b>
+ * is given, the other objects are appended to that list.
+ *
+ * \param [in] input_list GList of OBJECT's
+ * \param [in] object OBJECT to get other OBJECTs from
+ * \return A GList of OBJECTs
+ *
* \warning
* Caller must g_list_free returned GList pointer.
* Do not free individual data items in list.
*/
-GList *s_conn_return_complex_others(GList *input_list, OBJECT *object)
+GList *s_conn_return_others(GList *input_list, OBJECT *object)
{
- OBJECT *o_current;
- CONN *conn;
- GList *cl_current;
- GList *return_list=NULL;
- GList *iter;
-
- if (object->type != OBJ_COMPLEX && object->type != OBJ_PLACEHOLDER) {
- return(NULL);
- }
+ GList *c_iter;
+ GList *return_list;
return_list = input_list;
-
- iter = object->complex->prim_objs;
- while (iter != NULL) {
- o_current = (OBJECT *)iter->data;
- cl_current = o_current->conn_list;
- while (cl_current != NULL) {
-
- conn = (CONN *) cl_current->data;
-
- if (conn->other_object && conn->other_object != o_current) {
- return_list = g_list_append(return_list, conn->other_object);
+
+ switch (object->type) {
+ case OBJ_PIN:
+ case OBJ_NET:
+ case OBJ_BUS:
+ for (c_iter = object->conn_list;
+ c_iter != NULL; c_iter = g_list_next (c_iter)) {
+ CONN *conn = c_iter->data;
+
+ if (conn->other_object && conn->other_object != object) {
+ return_list = g_list_append(return_list, conn->other_object);
+ }
}
-
- cl_current = g_list_next(cl_current);
- }
- iter = g_list_next (iter);
+ break;
+
+ case OBJ_COMPLEX:
+ case OBJ_PLACEHOLDER:
+ return_list = s_conn_return_glist_others (return_list,
+ object->complex->prim_objs);
+ break;
}
-
- return(return_list);
+
+ return return_list;
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs