[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-23-g932c71e)
The branch, master has been updated
via 932c71ec1b93d9a7e2b833039c75ab987b4956e5 (commit)
via 8686ff1bb3e41a5c0ef785c6749d8491a7182758 (commit)
via 3bf53bf950231cec429819246e46135faea74dde (commit)
from 3d8c6f9e7e5be0728d43b6fba0d366a92a0cdf40 (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
=========
libgeda/include/libgeda/prototype.h | 1 -
libgeda/src/o_attrib.c | 95 -----------------------------------
libgeda/src/o_complex_basic.c | 2 +-
libgeda/src/o_list.c | 3 +
4 files changed, 4 insertions(+), 97 deletions(-)
=================
Commit Messages
=================
commit 932c71ec1b93d9a7e2b833039c75ab987b4956e5
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Remove unused o_attrib_slot_copy() function
The one previous caller of o_attrib_slot_copy() has been reworked in the
preceding patches.
:100644 100644 1a827be... baf0c8e... M libgeda/include/libgeda/prototype.h
:100644 100644 7137087... 56e79a1... M libgeda/src/o_attrib.c
commit 8686ff1bb3e41a5c0ef785c6749d8491a7182758
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Call o_attrib_slot_update(), not o_attrib_slot_copy() in o_complex_copy()
When the appropriate slot= attributes are re-attached to the complex,
the slot will be updated. There is no point in pre-empting the pinnumber
update by looking at the slot= attribute of the source complex.
If the complex were copied, but its slot= attribute were not, the call
could result in incorrect pinnumbers on the new object.
We do want to run o_attrib_slot_update() though, just in case the symbol's
internal slot= attribute would cause a pinnumber update.
:100644 100644 00f6955... 5495deb... M libgeda/src/o_complex_basic.c
commit 3bf53bf950231cec429819246e46135faea74dde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Add special case slot update when copying a slot= attribute
This update is needed to ensure the pinnumbers on the complex are updated
correctly if a slot= attribute is copied along with the symbol.
This hasn't caused a problem since when copying the complex, the pinnumbers
are reset to match that of the object being copied - looking at the slot=
attribute of the complex being copied.
If its slot= attribute is not copied along with the complex, the new
complex will have the incorrect pin numbers. We need to make sure that
when the slot= attribute is re-attached, it updates the pinnumbers
properly - we can then remove the pinnumber update in o_complex_copy().
:100644 100644 9f28a72... 242dbc9... M libgeda/src/o_list.c
=========
Changes
=========
commit 932c71ec1b93d9a7e2b833039c75ab987b4956e5
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Remove unused o_attrib_slot_copy() function
The one previous caller of o_attrib_slot_copy() has been reworked in the
preceding patches.
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 1a827be..baf0c8e 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -116,7 +116,6 @@ char *o_attrib_search_numslots(OBJECT *object);
char *o_attrib_search_default_slot(OBJECT *object);
char *o_attrib_search_component(OBJECT *object, char *name);
void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object);
-void o_attrib_slot_copy(TOPLEVEL *toplevel, OBJECT *original, OBJECT *target);
char *o_attrib_search_toplevel_all(GedaPageList *page_list, char *name);
GList *o_attrib_return_attribs(OBJECT *object);
int o_attrib_is_inherited(OBJECT *attrib);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 7137087..56e79a1 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -1394,101 +1394,6 @@ void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object)
g_free(slotdef);
}
-/*! \brief Copy attributes from OBJECT to OBJECT.
- * \par Function Description
- * This function will perform a slot copy of the <B>original</B> OBJECT
- * to the <B>target</B> OBJECT.
- *
- * \param [in] toplevel The TOPLEVEL object.
- * \param [in] original The original OBJECT to slot copy from.
- * \param [out] target The target OBJECT to slot copy to.
- */
-void o_attrib_slot_copy(TOPLEVEL *toplevel, OBJECT *original, OBJECT *target)
-{
-
- OBJECT *o_current;
- OBJECT *o_slot_attrib;
- OBJECT *o_pin_object;
- OBJECT *o_pinnum_object;
- char *string;
- char *slotdef;
- int slot;
- int pin_counter;
- char* current_pin;
- char* cptr;
-
- o_current = original;
-
- string = o_attrib_search_slot(o_current, &o_slot_attrib);
-
- if (!string) {
- /* s_log_message("Did not find slot= attribute\n"); */
- /* not a serious error */
- return;
- }
- slot = atoi(string);
- g_free(string);
-
- slotdef = o_attrib_search_slotdef(o_current, slot);
-
- if (!slotdef) {
- s_log_message(_("Did not find slotdef=#:#,#,#... attribute\n"));
- return;
- }
-
- if (!strstr(slotdef, ":")) {
- /*! \todo didn't proper slotdef=#:... TODO into log*/
- return;
- }
-
- /* skip over slotdef number */
- /* slotdef is in the form #:#,#,# */
- /* this code skips first #: */
- cptr = slotdef;
- while (*cptr != '\0' && *cptr != ':') {
- cptr++;
- }
- cptr++; /* skip colon */
-
- if (*cptr == '\0') {
- s_log_message(_("Did not find proper slotdef=#:#,#,#... attribute\n"));
- return;
- }
-
- pin_counter = 1;
- current_pin = strtok(cptr, DELIMITERS);
- while(current_pin != NULL) {
-
- o_pin_object = o_attrib_search_pinseq(target->complex->prim_objs,
- pin_counter);
-
- if (o_pin_object) {
-
- string = o_attrib_search_name_single(o_pin_object, "pinnumber",
- &o_pinnum_object);
-
- if (string && o_pinnum_object && o_pinnum_object->type == OBJ_TEXT &&
- o_pinnum_object->text->string) {
-
- g_free(string);
- g_free(o_pinnum_object->text->string);
-
- o_pinnum_object->text->string = g_strdup_printf ("pinnumber=%s", current_pin);
-
- o_text_recreate(toplevel, o_pinnum_object);
- }
-
- pin_counter++;
- } else {
- s_log_message(_("component missing pinseq= attribute\n"));
- }
-
- current_pin = strtok(NULL, DELIMITERS);
- }
-
- g_free(slotdef);
-}
-
/*! \brief Search for first TOPLEVEL attribute.
* \par Function Description
commit 8686ff1bb3e41a5c0ef785c6749d8491a7182758
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Call o_attrib_slot_update(), not o_attrib_slot_copy() in o_complex_copy()
When the appropriate slot= attributes are re-attached to the complex,
the slot will be updated. There is no point in pre-empting the pinnumber
update by looking at the slot= attribute of the source complex.
If the complex were copied, but its slot= attribute were not, the call
could result in incorrect pinnumbers on the new object.
We do want to run o_attrib_slot_update() though, just in case the symbol's
internal slot= attribute would cause a pinnumber update.
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 00f6955..5495deb 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -835,7 +835,7 @@ OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current)
/* Delete or hide attributes eligible for promotion inside the complex */
o_complex_remove_promotable_attribs (toplevel, new_obj);
- o_attrib_slot_copy(toplevel, o_current, new_obj);
+ o_attrib_slot_update (toplevel, new_obj);
/* deal with stuff that has changed */
commit 3bf53bf950231cec429819246e46135faea74dde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
libgeda: Add special case slot update when copying a slot= attribute
This update is needed to ensure the pinnumbers on the complex are updated
correctly if a slot= attribute is copied along with the symbol.
This hasn't caused a problem since when copying the complex, the pinnumbers
are reset to match that of the object being copied - looking at the slot=
attribute of the complex being copied.
If its slot= attribute is not copied along with the complex, the new
complex will have the incorrect pin numbers. We need to make sure that
when the slot= attribute is re-attached, it updates the pinnumbers
properly - we can then remove the pinnumber update in o_complex_copy().
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 9f28a72..242dbc9 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -208,6 +208,9 @@ GList *o_glist_copy_all (TOPLEVEL *toplevel,
src_object->attached_to->copied_to != NULL) {
o_attrib_attach(toplevel, dst_object,
src_object->attached_to->copied_to, FALSE);
+ /* handle slot= attribute, it's a special case */
+ if (g_ascii_strncasecmp (dst_object->text->string, "slot=", 5) == 0)
+ o_attrib_slot_update (toplevel, src_object->attached_to->copied_to);
}
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs