gEDA-dev: [PATCH][3/3] Merge GList selection changes
Werner Hoch
werner.ho at gmx.de
Sun Dec 17 06:06:51 EST 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autonumber_slot_remove.diff
Type: text/x-diff
Size: 851 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20061217/471b1df8/autonumber_slot_remove-0001.bin
More information about the geda-dev
mailing list