Hi Ales and all,

On Sunday 17 December 2006 05:07, Ales Hvezda wrote:
> I'm in the process of merging Carlos' glist_dev (only the glist part)
> via PeterB's patchset, and PeterC and I are a little confused by the
> following
>
> change:
> >This patch contains the required updates to the new autonumber code
> > required in order to compile gschem with the new GList selection
> > lists.
> >
> >+++ b/gschem/src/x_autonumber.c
> >@@ -582,7 +582,8 @@ void autonumber_remove_number(AUTONUMBER_TEXT *
> > autotext, OBJECT *o_current)
> >       if (slot_str != NULL && o_slot != NULL) {
> >     g_free(slot_str);
> >     /* delete the slot attribute */
> >-    o_selection_remove
> > (autotext->toplevel->page_current->selection2_head, o_slot);
> >+    GList *selection =
> > autotext->toplevel->page_current->selection_list;
> > +   o_selection_remove (&selection, o_slot);

In the old libgeda o_selection_remove is defined as:
void o_selection_remove(SELECTION *head, OBJECT *o_selected)

In the new libgeda o_selection_remove is defined as:
void o_selection_remove(GList **head, OBJECT *o_selected)


If I use the following test case:
Use a schematic with two symbols, both with slot attribute.
Select the two slot attributes and start the autonumber dialog.
Choose tho options refdes=*, autoslotting and remove numbers.

When I print the selection list I get in the first case:
-----snip--------
START printing selection ********************
Selected object: 54643
Selected object: 37380
Selected object: 37432
Selected object: 54453
DONE printing selection ********************

START printing selection ********************
Selected object: 54643
Selected object: 37380
Selected object: 37432
DONE printing selection ********************

START printing selection ********************
Selected object: 54643
Selected object: 37380
Selected object: 37432
DONE printing selection ********************

START printing selection ********************
Selected object: 37380
Selected object: 37432
DONE printing selection ********************
--------------
The two slot objects disappear in the selection list successively.
(I don't know what the two remaining objects are)


In the second case with the new glist_dev code:
-----snip-------
START printing selection ********************
Selected object: 26993
Selected object: 27183
DONE printing selection ********************

START printing selection ********************
DONE printing selection ********************

START printing selection ********************
DONE printing selection ********************

START printing selection ********************
DONE printing selection ********************
------------
Both slot attribute disapear with the first call of 
o_selection_remove().

>       Is this correct?  Did you really want to pass in the address of
> a local variable to o_selection_remove?  Or is the right thing to do
> to pass in the address of
> autotext->toplevel->page_current->selection_list? Please advise.

It should be the adress of selection_list, but I'm wondering what's the 
difference between:
  GList *selection = autotext->toplevel->page_current->selection_list;
  o_selection_remove (&selection, o_slot);
and:
 o_selection_remove(&(autotext->toplevel->page_current->selection_list),
                           o_slot);

I may be blind, here.

>       Also I noticed that autonumber is hanging when trying to autonumber
> the test schematics in gschem/test/autonumber*  It seems to be
> getting stuck in the hierarchy traversal.  Please verify that this is
> working (or not) before you update to CVS HEAD.

Can you please give some more informations. Is gschem seg_faulting or 
just produce some error messages in the log?

Maybe you just need to start gschem inside gschem/test/.

Regards
Werner
Index: src/x_autonumber.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_autonumber.c,v
retrieving revision 1.3
diff -u -r1.3 x_autonumber.c
--- src/x_autonumber.c	17 Dec 2006 04:14:03 -0000	1.3
+++ src/x_autonumber.c	17 Dec 2006 11:04:29 -0000
@@ -582,8 +582,8 @@
       if (slot_str != NULL && o_slot != NULL) {
 	g_free(slot_str);
 	/* delete the slot attribute */
-	GList *selection = autotext->toplevel->page_current->selection_list;
-	o_selection_remove (&selection, o_slot);
+	o_selection_remove(&(autotext->toplevel->page_current->selection_list),
+			   o_slot);
 	o_delete_text (autotext->toplevel, o_slot);
 	/* redraw the slotted object. So that the pinnumbers appear as with slot=1 */
 	/* --> No: should be done by o_delete_text as several dialog use it. */

_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to