[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-96-gd7b7b23)
The branch, master has been updated
via d7b7b23721b4054172587c9961d4b87f47bee198 (commit)
via ca6556ace0a06ec1dd697852f7a1f0ffb86bfb97 (commit)
from 15ed098497ddac2bc671657c4d4347eb509f7449 (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
=========
gattrib/include/prototype.h | 18 ++++++------
gattrib/src/s_object.c | 2 +-
gattrib/src/s_sheet_data.c | 23 +++++++++-------
gattrib/src/s_table.c | 10 ++++---
gattrib/src/s_toplevel.c | 12 +++++---
gattrib/src/x_fileselect.c | 12 ++++----
gnetlist/include/prototype.h | 2 +-
gnetlist/src/s_hierarchy.c | 6 ++--
gnetlist/src/s_traverse.c | 16 +++++-----
gschem/include/prototype.h | 14 +++++-----
gschem/src/a_zoom.c | 2 +-
gschem/src/g_funcs.c | 4 +-
gschem/src/g_hook.c | 6 ++--
gschem/src/i_callbacks.c | 13 +++++---
gschem/src/o_attrib.c | 2 +-
gschem/src/o_complex.c | 25 ++++++++---------
gschem/src/o_find.c | 7 +++--
gschem/src/o_misc.c | 37 ++++++++++++++------------
gschem/src/o_select.c | 8 +++---
gschem/src/o_undo.c | 9 +++---
gschem/src/x_autonumber.c | 17 +++++++-----
gschem/src/x_compselect.c | 2 +-
gschem/src/x_dialog.c | 18 +++++++-----
gschem/src/x_preview.c | 16 +++++-----
gschem/src/x_window.c | 2 +-
gsymcheck/include/prototype.h | 28 ++++++++++----------
gsymcheck/src/s_check.c | 54 +++++++++++++++++++-------------------
libgeda/include/prototype.h | 19 +++++++------
libgeda/include/prototype_priv.h | 4 +-
libgeda/include/struct.h | 2 +-
libgeda/src/a_basic.c | 6 ++--
libgeda/src/f_basic.c | 8 +++---
libgeda/src/f_print.c | 27 ++++++++++--------
libgeda/src/o_attrib.c | 10 +++---
libgeda/src/o_complex_basic.c | 9 +++---
libgeda/src/o_list.c | 17 ++++++-----
libgeda/src/o_net_basic.c | 6 ++--
libgeda/src/s_clib.c | 2 +-
libgeda/src/s_cue.c | 4 +-
libgeda/src/s_hierarchy.c | 4 +-
libgeda/src/s_page.c | 34 ++++++++++++++++++-----
utils/gschlas/s_util.c | 2 +-
42 files changed, 281 insertions(+), 238 deletions(-)
=================
Commit Messages
=================
commit d7b7b23721b4054172587c9961d4b87f47bee198
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Dec 31 17:26:03 2008 +0000
libgeda: Remove non-private access of PAGE->object_list
This allows us to keep better track of where the PAGE must be updated
should we have any spatially keyed data-structures in the future.
Rename PAGE->object_list PAGE->_object_list to try and discorage any
use of it outside libgeda (ideally, outside s_page.c) in the future.
:100644 100644 5ba4995... c6cb5b5... M gattrib/src/s_object.c
:100644 100644 1571e06... 345b5cf... M gattrib/src/s_toplevel.c
:100644 100644 3d4bc68... 04a9184... M gattrib/src/x_fileselect.c
:100644 100644 008fe7d... f5ececb... M gnetlist/src/s_hierarchy.c
:100644 100644 c8638b9... 4809b25... M gnetlist/src/s_traverse.c
:100644 100644 e8b0fc5... 7faa171... M gschem/src/g_funcs.c
:100644 100644 c3e92bf... 3c96847... M gschem/src/g_hook.c
:100644 100644 30c8a3a... 054515a... M gschem/src/i_callbacks.c
:100644 100644 555b12b... 6484499... M gschem/src/o_attrib.c
:100644 100644 933a7f8... 6bc69f7... M gschem/src/o_complex.c
:100644 100644 0c97ee2... f878a22... M gschem/src/o_find.c
:100644 100644 5d4500d... 8cf7075... M gschem/src/o_misc.c
:100644 100644 ebbf453... a98f0f4... M gschem/src/o_select.c
:100644 100644 ed41b3a... b59fc3b... M gschem/src/o_undo.c
:100644 100644 3301947... f23f070... M gschem/src/x_autonumber.c
:100644 100644 8cfe2db... eb17b79... M gschem/src/x_compselect.c
:100644 100644 af6a02c... 5a1aa67... M gschem/src/x_dialog.c
:100644 100644 e371cd5... ab6f11a... M gschem/src/x_preview.c
:100644 100644 a2a2ed9... 861ae93... M gschem/src/x_window.c
:100644 100644 6480d9d... 8942ea2... M gsymcheck/src/s_check.c
:100644 100644 13a8a87... 77f1123... M libgeda/include/prototype.h
:100644 100644 f1d0cfe... cacb4f5... M libgeda/include/struct.h
:100644 100644 d1a801a... 0e3a41e... M libgeda/src/a_basic.c
:100644 100644 b9fd712... f90f5ea... M libgeda/src/f_basic.c
:100644 100644 cd7ece4... ee75fa5... M libgeda/src/f_print.c
:100644 100644 0dfe3f6... 63afdaa... M libgeda/src/o_attrib.c
:100644 100644 17bf9ba... d9b50df... M libgeda/src/o_net_basic.c
:100644 100644 86571a5... 2ec82af... M libgeda/src/s_clib.c
:100644 100644 80cf178... 731f094... M libgeda/src/s_hierarchy.c
:100644 100644 f5926e4... 85669a3... M libgeda/src/s_page.c
:100644 100644 e9e04c2... 0f3d33d... M utils/gschlas/s_util.c
commit ca6556ace0a06ec1dd697852f7a1f0ffb86bfb97
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Dec 31 17:25:57 2008 +0000
Add "const" to some places where we deal with GLists of OBJECTs.
These GLists themselves are not (and shouldn't be) modified, although
the OBJECTs they point at may well be.
:100644 100644 d53107b... 4745506... M gattrib/include/prototype.h
:100644 100644 f69934c... 185f832... M gattrib/src/s_sheet_data.c
:100644 100644 52c7bd5... ba00be0... M gattrib/src/s_table.c
:100644 100644 48b53f0... 1571e06... M gattrib/src/s_toplevel.c
:100644 100644 fdf9529... 8e73350... M gnetlist/include/prototype.h
:100644 100644 3970adc... c8638b9... M gnetlist/src/s_traverse.c
:100644 100644 634ad6d... e961fbf... M gschem/include/prototype.h
:100644 100644 b94a5ec... 9ba733a... M gschem/src/a_zoom.c
:100644 100644 abcd684... e8b0fc5... M gschem/src/g_funcs.c
:100644 100644 51614c4... c3e92bf... M gschem/src/g_hook.c
:100644 100644 f5be3a4... 933a7f8... M gschem/src/o_complex.c
:100644 100644 4ea3c0c... 0c97ee2... M gschem/src/o_find.c
:100644 100644 7b356c5... 5d4500d... M gschem/src/o_misc.c
:100644 100644 feb8ae4... ebbf453... M gschem/src/o_select.c
:100644 100644 daee8db... 3301947... M gschem/src/x_autonumber.c
:100644 100644 4d063ee... ad24b2a... M gsymcheck/include/prototype.h
:100644 100644 200fcce... 6480d9d... M gsymcheck/src/s_check.c
:100644 100644 1289c60... 13a8a87... M libgeda/include/prototype.h
:100644 100644 8a36e21... f107194... M libgeda/include/prototype_priv.h
:100644 100644 7acc3d8... d1a801a... M libgeda/src/a_basic.c
:100644 100644 a4ff51d... cd7ece4... M libgeda/src/f_print.c
:100644 100644 1c576d7... 0dfe3f6... M libgeda/src/o_attrib.c
:100644 100644 f7b6c46... 42a8f38... M libgeda/src/o_complex_basic.c
:100644 100644 1dc2048... 9f28a72... M libgeda/src/o_list.c
:100644 100644 f01b0b5... 17bf9ba... M libgeda/src/o_net_basic.c
:100644 100644 c2a7511... aa8888e... M libgeda/src/s_cue.c
:100644 100644 17b18c1... 80cf178... M libgeda/src/s_hierarchy.c
=========
Changes
=========
commit d7b7b23721b4054172587c9961d4b87f47bee198
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Dec 31 17:26:03 2008 +0000
libgeda: Remove non-private access of PAGE->object_list
This allows us to keep better track of where the PAGE must be updated
should we have any spatially keyed data-structures in the future.
Rename PAGE->object_list PAGE->_object_list to try and discorage any
use of it outside libgeda (ideally, outside s_page.c) in the future.
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index 5ba4995..c6cb5b5 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -288,7 +288,7 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
}
} else { /* This must be a floating attrib, but what is that !?!?!?!?! */
world_get_object_glist_bounds(pr_current,
- pr_current->page_current->object_list,
+ s_page_objects (pr_current->page_current),
&left, &top, &right, &bottom);
/* this really is the lower left hand corner */
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index 1571e06..345b5cf 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -96,7 +96,7 @@ void s_toplevel_verify_design(TOPLEVEL *pr_current)
p_iter = g_list_next (p_iter)) {
PAGE *p_current = p_iter->data;
- for (o_iter = p_current->object_list;
+ for (o_iter = s_page_objects (p_current);
o_iter != NULL;
o_iter = g_list_next (o_iter)) {
OBJECT *o_current = o_iter->data;
@@ -410,7 +410,7 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
* from the list during iteration over the list.
*/
/* NB: g_list_copy doesn't declare its input const, so we cast */
- copy_list = g_list_copy ((GList *)page->object_list);
+ copy_list = g_list_copy ((GList *)s_page_objects (page));
/* Iterate backwards since attributes are attached after their
* parent objects in the list. Attributes can get deleted during
@@ -475,7 +475,7 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
* deleted from the list during its iteration.
*/
/* NB: g_list_copy doesn't declare its input const, so we cast */
- copy_list = g_list_copy ((GList *)page->object_list);
+ copy_list = g_list_copy ((GList *)s_page_objects (page));
for (o_iter = g_list_last (copy_list);
o_iter != NULL;
diff --git a/gattrib/src/x_fileselect.c b/gattrib/src/x_fileselect.c
index 3d4bc68..04a9184 100644
--- a/gattrib/src/x_fileselect.c
+++ b/gattrib/src/x_fileselect.c
@@ -147,8 +147,8 @@ x_fileselect_load_files (GSList *filenames)
}
/* Now add all items found to the master lists */
- s_sheet_data_add_master_comp_list_items (pr_current->page_current->object_list);
- s_sheet_data_add_master_comp_attrib_list_items (pr_current->page_current->object_list);
+ s_sheet_data_add_master_comp_list_items (s_page_objects (pr_current->page_current));
+ s_sheet_data_add_master_comp_attrib_list_items (s_page_objects (pr_current->page_current));
#if 0
/* Note that this must be changed. We need to input the entire project
* before doing anything with the nets because we need to first
@@ -157,8 +157,8 @@ x_fileselect_load_files (GSList *filenames)
s_sheet_data_add_master_net_attrib_list_items (pr_current->page_current->object_list);
#endif
- s_sheet_data_add_master_pin_list_items (pr_current->page_current->object_list);
- s_sheet_data_add_master_pin_attrib_list_items (pr_current->page_current->object_list);
+ s_sheet_data_add_master_pin_list_items (s_page_objects (pr_current->page_current));
+ s_sheet_data_add_master_pin_attrib_list_items (s_page_objects (pr_current->page_current));
} /* end of loop over files */
@@ -191,7 +191,7 @@ x_fileselect_load_files (GSList *filenames)
/* only traverse pages which are toplevel */
if (p_local->page_control == 0) {
/* adds all components from page to comp_table */
- s_table_add_toplevel_comp_items_to_comp_table (p_local->object_list);
+ s_table_add_toplevel_comp_items_to_comp_table (s_page_objects (p_local));
#if 0
/* Note that this must be changed. We need to input the entire project
* before doing anything with the nets because we need to first
@@ -202,7 +202,7 @@ x_fileselect_load_files (GSList *filenames)
#endif
/* adds all pins from page to pin_table */
- s_table_add_toplevel_pin_items_to_pin_table (p_local->object_list);
+ s_table_add_toplevel_pin_items_to_pin_table (s_page_objects (p_local));
}
} /* for loop over pages */
diff --git a/gnetlist/src/s_hierarchy.c b/gnetlist/src/s_hierarchy.c
index 008fe7d..f5ececb 100644
--- a/gnetlist/src/s_hierarchy.c
+++ b/gnetlist/src/s_hierarchy.c
@@ -112,9 +112,9 @@ s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
netlist->composite_component = TRUE;
/* can't do the following, don't know why... HACK TODO */
/*netlist->hierarchy_tag = u_basic_strdup (netlist->component_uref);*/
- s_traverse_sheet(pr_current,
- pr_current->page_current->object_list,
- netlist->component_uref);
+ s_traverse_sheet (pr_current,
+ s_page_objects (pr_current->page_current),
+ netlist->component_uref);
verbose_print("^");
}
diff --git a/gnetlist/src/s_traverse.c b/gnetlist/src/s_traverse.c
index c8638b9..4809b25 100644
--- a/gnetlist/src/s_traverse.c
+++ b/gnetlist/src/s_traverse.c
@@ -128,7 +128,7 @@ void s_traverse_start(TOPLEVEL * pr_current)
/* only traverse pages which are toplevel, ie not underneath */
if (p_current->page_control == 0) {
pr_current->page_current = p_current;
- s_traverse_sheet (pr_current, p_current->object_list, NULL);
+ s_traverse_sheet (pr_current, s_page_objects (p_current), NULL);
}
}
@@ -356,8 +356,8 @@ CPINLIST *s_traverse_component(TOPLEVEL * pr_current, OBJECT * component,
c_current->other_object,
hierarchy_tag);
- s_traverse_clear_all_visited(pr_current->
- page_current->object_list);
+ s_traverse_clear_all_visited (
+ s_page_objects (pr_current->page_current));
}
}
@@ -370,8 +370,8 @@ CPINLIST *s_traverse_component(TOPLEVEL * pr_current, OBJECT * component,
/* this is iffy */
/* should pass in page_current in top level func */
}
- s_traverse_clear_all_visited(pr_current->page_current->
- object_list);
+ s_traverse_clear_all_visited (
+ s_page_objects (pr_current->page_current));
}
diff --git a/gschem/src/g_funcs.c b/gschem/src/g_funcs.c
index e8b0fc5..7faa171 100644
--- a/gschem/src/g_funcs.c
+++ b/gschem/src/g_funcs.c
@@ -268,7 +268,7 @@ SCM get_selected_component_attributes(GSCHEM_TOPLEVEL *w_current)
/* build a hash table */
ht = g_hash_table_new (g_str_hash, g_str_equal);
- for (iter = w_current->toplevel->page_current->object_list;
+ for (iter = s_page_objects (w_current->toplevel->page_current);
iter != NULL;
iter = g_list_next (iter)) {
obj = (OBJECT *)iter->data;
diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index c3e92bf..3c96847 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -741,8 +741,8 @@ SCM g_get_objects_in_page(SCM page_smob) {
SCM_ASSERT (g_get_data_from_page_smob (page_smob, &toplevel, &page),
page_smob, SCM_ARG1, "add-component");
- if (page && page->object_list) {
- iter = page->object_list;
+ if (page && s_page_objects (page)) {
+ iter = s_page_objects (page);
while (iter != NULL) {
object = (OBJECT *)iter->data;
return_list = scm_cons (g_make_object_smob(toplevel, object),
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 30c8a3a..054515a 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -1118,7 +1118,8 @@ DEFINE_I_CALLBACK(edit_show_hidden)
i_callback_edit_show_hidden,
_("ShowHidden"));
- o_edit_show_hidden (w_current, w_current->toplevel->page_current->object_list);
+ o_edit_show_hidden (w_current,
+ s_page_objects (w_current->toplevel->page_current));
}
/*! \todo Finish function documentation!!!
@@ -1141,7 +1142,8 @@ DEFINE_I_CALLBACK(edit_make_visible)
i_callback_edit_make_visible,
_("MakeVisible"));
- o_edit_make_visible (w_current, w_current->toplevel->page_current->object_list);
+ o_edit_make_visible (w_current,
+ s_page_objects (w_current->toplevel->page_current));
}
/*! \todo Finish function documentation!!!
@@ -1358,7 +1360,8 @@ DEFINE_I_CALLBACK(view_zoom_extents)
exit_if_null(w_current);
/* scroll bar stuff */
- a_zoom_extents (w_current, w_current->toplevel->page_current->object_list, 0);
+ a_zoom_extents (w_current,
+ s_page_objects (w_current->toplevel->page_current), 0);
if (w_current->undo_panzoom) {
o_undo_savestate(w_current, UNDO_VIEWPORT_ONLY);
}
@@ -2824,7 +2827,7 @@ DEFINE_I_CALLBACK(hierarchy_down_schematic)
/* s_hierarchy_down_schematic_single() will not zoom the loaded page */
if (page_control != -1) {
a_zoom_extents(w_current,
- w_current->toplevel->page_current->object_list,
+ s_page_objects (w_current->toplevel->page_current),
A_PAN_DONT_REDRAW);
o_undo_savestate(w_current, UNDO_ALL);
}
@@ -2917,7 +2920,7 @@ DEFINE_I_CALLBACK(hierarchy_down_symbol)
w_current->toplevel->page_current);
/* s_hierarchy_down_symbol() will not zoom the loaded page */
a_zoom_extents(w_current,
- w_current->toplevel->page_current->object_list,
+ s_page_objects (w_current->toplevel->page_current),
A_PAN_DONT_REDRAW);
o_undo_savestate(w_current, UNDO_ALL);
x_window_set_current_page(w_current, w_current->toplevel->page_current);
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 555b12b..6484499 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -225,7 +225,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
}
} else {
world_get_object_glist_bounds (toplevel,
- toplevel->page_current->object_list,
+ s_page_objects (toplevel->page_current),
&left, &top, &right, &bottom);
/* this really is the lower left hand corner */
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 933a7f8..6bc69f7 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -222,15 +222,14 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
int x, y;
/* first zoom extents */
- a_zoom_extents (w_current, toplevel->page_current->object_list,
- A_PAN_DONT_REDRAW);
+ a_zoom_extents (w_current, s_page_objects (toplevel->page_current),
+ A_PAN_DONT_REDRAW);
o_invalidate_all (w_current);
- world_get_object_glist_bounds (toplevel, toplevel->page_current->object_list,
- &w_rleft,
- &w_rtop,
- &w_rright,
- &w_rbottom);
+ world_get_object_glist_bounds (toplevel,
+ s_page_objects (toplevel->page_current),
+ &w_rleft, &w_rtop,
+ &w_rright, &w_rbottom);
/*! \todo do we want snap grid here? */
x = snap_grid( toplevel, w_rleft );
@@ -240,7 +239,7 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
* the correct sense) were in use . */
y = snap_grid( toplevel, w_rtop );
- iter = toplevel->page_current->object_list;
+ iter = s_page_objects (toplevel->page_current);
while (iter != NULL) {
o_current = iter->data;
s_conn_remove_object (toplevel, o_current);
@@ -250,15 +249,15 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
if (offset == 0) {
s_log_message(_("Translating schematic [%d %d]\n"), -x, -y);
o_glist_translate_world (toplevel, -x, -y,
- toplevel->page_current->object_list);
+ s_page_objects (toplevel->page_current));
} else {
s_log_message(_("Translating schematic [%d %d]\n"),
offset, offset);
o_glist_translate_world (toplevel, offset, offset,
- toplevel->page_current->object_list);
+ s_page_objects (toplevel->page_current));
}
- iter = toplevel->page_current->object_list;
+ iter = s_page_objects (toplevel->page_current);
while (iter != NULL) {
o_current = iter->data;
if (o_current->type != OBJ_COMPLEX && o_current->type != OBJ_PLACEHOLDER) {
@@ -271,7 +270,7 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
/* this is an experimental mod, to be able to translate to all
* places */
- a_zoom_extents (w_current, toplevel->page_current->object_list,
+ a_zoom_extents (w_current, s_page_objects (toplevel->page_current),
A_PAN_DONT_REDRAW);
if (!w_current->SHIFTKEY) o_select_unselect_all(w_current);
o_invalidate_all (w_current);
diff --git a/gschem/src/o_find.c b/gschem/src/o_find.c
index 0c97ee2..f878a22 100644
--- a/gschem/src/o_find.c
+++ b/gschem/src/o_find.c
@@ -106,7 +106,7 @@ gboolean o_find_object (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
at the same place multiple times. */
if (toplevel->page_current->object_lastplace != NULL) {
/* NB: g_list_find doesn't declare its input const, so we cast */
- iter = g_list_find ((GList *)toplevel->page_current->object_list,
+ iter = g_list_find ((GList *)s_page_objects (toplevel->page_current),
toplevel->page_current->object_lastplace);
iter = g_list_next (iter);
}
@@ -122,7 +122,7 @@ gboolean o_find_object (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
}
/* now search from the beginning up until the object_lastplace */
- for (iter = toplevel->page_current->object_list;
+ for (iter = s_page_objects (toplevel->page_current);
iter != NULL; iter = g_list_next (iter)) {
OBJECT *o_current = iter->data;
if (find_single_object (w_current, o_current,
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 5d4500d..8cf7075 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -539,9 +539,9 @@ int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, const GList *o_list,
HIERARCHY_NORMAL_LOAD);
/* o_invalidate_all (w_current); */
- rv = o_edit_find_text(w_current,
- toplevel->page_current->object_list,
- stext, descend, skiplast);
+ rv = o_edit_find_text (w_current,
+ s_page_objects (toplevel->page_current),
+ stext, descend, skiplast);
if (!rv) {
return 0;
}
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index ebbf453..a98f0f4 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -351,7 +351,7 @@ void o_select_box_search(GSCHEM_TOPLEVEL *w_current)
top = min(w_current->first_wy, w_current->second_wy);
bottom = max(w_current->first_wy, w_current->second_wy);
- iter = toplevel->page_current->object_list;
+ iter = s_page_objects (toplevel->page_current);
while (iter != NULL) {
o_current = iter->data;
/* only select visible objects */
@@ -444,7 +444,7 @@ void o_select_connected_nets(GSCHEM_TOPLEVEL *w_current, OBJECT* o_net)
break; /* no new netnames in the stack --> finished */
/* get all the nets of the stacked netnames */
- for (o_iter = toplevel->page_current->object_list;
+ for (o_iter = s_page_objects (toplevel->page_current);
o_iter != NULL;
o_iter = g_list_next (o_iter)) {
o_current = o_iter->data;
diff --git a/gschem/src/o_undo.c b/gschem/src/o_undo.c
index ed41b3a..b59fc3b 100644
--- a/gschem/src/o_undo.c
+++ b/gschem/src/o_undo.c
@@ -117,7 +117,7 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
}
object_list = o_glist_copy_all (toplevel,
- toplevel->page_current->object_list,
+ s_page_objects (toplevel->page_current),
object_list, SELECTION_FLAG);
}
@@ -373,10 +373,9 @@ void o_undo_callback(GSCHEM_TOPLEVEL *w_current, int type)
s_page_delete_objects (toplevel, toplevel->page_current);
- toplevel->page_current->object_list =
- o_glist_copy_all (toplevel, u_current->object_list,
- toplevel->page_current->object_list,
- NORMAL_FLAG);
+ s_page_append_list (toplevel->page_current,
+ o_glist_copy_all (toplevel, u_current->object_list,
+ NULL, NORMAL_FLAG));
x_manual_resize(w_current);
toplevel->page_current->page_control = u_current->page_control;
diff --git a/gschem/src/x_autonumber.c b/gschem/src/x_autonumber.c
index 3301947..f23f070 100644
--- a/gschem/src/x_autonumber.c
+++ b/gschem/src/x_autonumber.c
@@ -394,7 +394,8 @@ void autonumber_get_used(GSCHEM_TOPLEVEL *w_current, AUTONUMBER_TEXT *autotext)
char *numslot_str, *slot_str;
const GList *iter;
- for (iter = w_current->toplevel->page_current->object_list; iter != NULL;
+ for (iter = s_page_objects (w_current->toplevel->page_current);
+ iter != NULL;
iter = g_list_next (iter)) {
o_current = iter->data;
if (autonumber_match(autotext, o_current, &number) == AUTONUMBER_RESPECT) {
@@ -707,8 +708,9 @@ void autonumber_text_autonumber(AUTONUMBER_TEXT *autotext)
for (page_item = pages; page_item != NULL; page_item = g_list_next(page_item)) {
s_page_goto(w_current->toplevel, page_item->data);
/* iterate over all objects an look for matching searchtext's */
- for (iter = w_current->toplevel->page_current->object_list; iter != NULL;
- iter = g_list_next (iter)) {
+ for (iter = s_page_objects (w_current->toplevel->page_current);
+ iter != NULL;
+ iter = g_list_next (iter)) {
o_current = iter->data;
if (o_current->type == OBJ_TEXT) {
if (autotext->scope_number == SCOPE_HIERARCHY
@@ -775,8 +777,9 @@ void autonumber_text_autonumber(AUTONUMBER_TEXT *autotext)
/* RENUMBER CODE FOR ONE PAGE AND ONE SEARCHTEXT*/
/* 1. get objects to renumber */
- for (iter = w_current->toplevel->page_current->object_list; iter != NULL;
- iter = g_list_next (iter)) {
+ for (iter = s_page_objects (w_current->toplevel->page_current);
+ iter != NULL;
+ iter = g_list_next (iter)) {
o_current = iter->data;
if (autonumber_match(autotext, o_current, &number) == AUTONUMBER_RENUMBER) {
/* put number into the used list */
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 8cfe2db..eb17b79 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -513,7 +513,7 @@ update_attributes_model (Compselect *compselect, TOPLEVEL *preview_toplevel)
o_attrlist =
o_complex_get_toplevel_attribs (preview_toplevel,
- preview_toplevel->page_current->object_list);
+ s_page_objects (preview_toplevel->page_current));
filter_list = GSCHEM_DIALOG (compselect)->w_current->component_select_attrlist;
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index af6a02c..5a1aa67 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -2874,10 +2874,10 @@ void find_text_dialog_response(GtkWidget *w, gint response,
s_page_goto(toplevel, remember_page);
}
done =
- o_edit_find_text (w_current, remember_page->object_list, string,
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
- (checkdescend)),
- !start_find);
+ o_edit_find_text (w_current, s_page_objects (remember_page), string,
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+ (checkdescend)),
+ !start_find);
if (done) {
o_invalidate_all (w_current);
close = 1;
@@ -3001,8 +3001,9 @@ void hide_text_dialog_response(GtkWidget *w, gint response,
string = (gchar*) gtk_entry_get_text(GTK_ENTRY(textentry));
strncpy(generic_textstring, string, 256);
- o_edit_hide_specific_text(w_current,
- w_current->toplevel->page_current->object_list, string);
+ o_edit_hide_specific_text (w_current,
+ s_page_objects (w_current->toplevel->page_current),
+ string);
break;
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_DELETE_EVENT:
@@ -3100,8 +3101,9 @@ void show_text_dialog_response(GtkWidget *widget, gint response,
string = (gchar*) gtk_entry_get_text(GTK_ENTRY(textentry));
strncpy(generic_textstring, string, 256);
- o_edit_show_specific_text(w_current,
- w_current->toplevel->page_current->object_list, string);
+ o_edit_show_specific_text (w_current,
+ s_page_objects (w_current->toplevel->page_current),
+ string);
break;
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_DELETE_EVENT:
diff --git a/gschem/src/x_preview.c b/gschem/src/x_preview.c
index e371cd5..ab6f11a 100644
--- a/gschem/src/x_preview.c
+++ b/gschem/src/x_preview.c
@@ -98,7 +98,7 @@ preview_callback_realize (GtkWidget *widget,
preview_toplevel->DONT_REDRAW = 0;
a_zoom_extents(preview_w_current,
- preview_page->object_list,
+ s_page_objects (preview_page),
A_PAN_DONT_REDRAW);
o_invalidate_all (preview_w_current);
@@ -217,10 +217,10 @@ preview_update (Preview *preview)
if (preview->buffer != NULL) {
/* Load the data buffer */
- preview_toplevel->page_current->object_list =
- o_read_buffer (preview_toplevel,
- preview_toplevel->page_current->object_list,
- preview->buffer, -1, _("Preview Buffer"));
+ s_page_append_list (preview_toplevel->page_current,
+ o_read_buffer (preview_toplevel,
+ NULL, preview->buffer, -1,
+ _("Preview Buffer")));
/* Is this needed? */
if (preview_toplevel->net_consolidate == TRUE) {
@@ -230,7 +230,7 @@ preview_update (Preview *preview)
}
if (world_get_object_glist_bounds (preview_toplevel,
- preview_toplevel->page_current->object_list,
+ s_page_objects (preview_toplevel->page_current),
&left, &top,
&right, &bottom)) {
/* Clamp the canvas size to the extents of the page being previewed */
@@ -244,7 +244,7 @@ preview_update (Preview *preview)
/* display current page (possibly empty) */
a_zoom_extents (preview_w_current,
- preview_toplevel->page_current->object_list,
+ s_page_objects (preview_toplevel->page_current),
A_PAN_DONT_REDRAW);
o_invalidate_all (preview_w_current);
@@ -327,7 +327,7 @@ preview_event_configure (GtkWidget *widget,
retval = x_event_configure (widget, event, preview_w_current);
preview_w_current->toplevel->DONT_REDRAW = save_redraw;
if (preview_page != NULL) {
- a_zoom_extents (preview_w_current, preview_page->object_list, 0);
+ a_zoom_extents(preview_w_current, s_page_objects (preview_page), 0);
}
return retval;
}
diff --git a/gschem/src/x_window.c b/gschem/src/x_window.c
index a2a2ed9..861ae93 100644
--- a/gschem/src/x_window.c
+++ b/gschem/src/x_window.c
@@ -755,7 +755,7 @@ x_window_open_page (GSCHEM_TOPLEVEL *w_current, const gchar *filename)
scm_cons (g_make_page_smob (toplevel, page), SCM_EOL));
a_zoom_extents (w_current,
- toplevel->page_current->object_list,
+ s_page_objects (toplevel->page_current),
A_PAN_DONT_REDRAW);
o_undo_savestate (w_current, UNDO_ALL);
diff --git a/gsymcheck/src/s_check.c b/gsymcheck/src/s_check.c
index 6480d9d..8942ea2 100644
--- a/gsymcheck/src/s_check.c
+++ b/gsymcheck/src/s_check.c
@@ -51,10 +51,10 @@ s_check_all(TOPLEVEL *pr_current)
p_current = (PAGE *)iter->data;
- if (p_current->object_list) {
+ if (s_page_objects (p_current)) {
return_status = return_status +
- s_check_symbol(pr_current, p_current,
- p_current->object_list);
+ s_check_symbol (pr_current, p_current,
+ s_page_objects (p_current));
if (!quiet_mode) s_log_message("\n");
}
}
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 13a8a87..77f1123 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -417,6 +417,7 @@ void s_page_append (PAGE *page, OBJECT *object);
void s_page_append_list (PAGE *page, GList *obj_list);
void s_page_remove (PAGE *page, OBJECT *object);
void s_page_delete_objects (TOPLEVEL *toplevel, PAGE *page);
+const GList *s_page_objects (PAGE *page);
GList *s_page_objects_in_region (TOPLEVEL *toplevel, PAGE *page, int min_x, int min_y, int max_x, int max_y);
GList *s_page_objects_in_regions (TOPLEVEL *toplevel, PAGE *page, BOX *rects, int n_rects);
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index f1d0cfe..cacb4f5 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -393,7 +393,7 @@ struct st_page {
int pid;
- GList *object_list;
+ GList *_object_list;
SELECTION *selection_list; /* new selection mechanism */
GList *place_list;
OBJECT *object_lastplace; /* the last found item */
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index d1a801a..0e3a41e 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -74,7 +74,7 @@ gchar *o_save_buffer (TOPLEVEL *toplevel)
acc = g_string_new (o_file_format_header());
- buffer = o_save_objects (toplevel->page_current->object_list, FALSE);
+ buffer = o_save_objects (s_page_objects (toplevel->page_current), FALSE);
g_string_append (acc, buffer);
g_free (buffer);
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index b9fd712..f90f5ea 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -284,12 +284,12 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
* the RC file, it's time to read in the file. */
if (load_backup_file == 1) {
/* Load the backup file */
- toplevel->page_current->object_list = o_read (toplevel, NULL,
- backup_filename, &tmp_err);
+ s_page_append_list (toplevel->page_current,
+ o_read (toplevel, NULL, backup_filename, &tmp_err));
} else {
/* Load the original file */
- toplevel->page_current->object_list = o_read (toplevel, NULL,
- full_filename, &tmp_err);
+ s_page_append_list (toplevel->page_current,
+ o_read (toplevel, NULL, full_filename, &tmp_err));
}
if (tmp_err == NULL)
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index cd7ece4..ee75fa5 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -452,14 +452,15 @@ int f_print_stream(TOPLEVEL *toplevel, FILE *fp)
f_print_initialize_glyph_table(); /* Fill up unicode map */
/* Find all the unicode characters */
- unicode_count = f_print_get_unicode_chars(toplevel,
- toplevel->page_current->object_list,
- 0, unicode_table);
+ unicode_count =
+ f_print_get_unicode_chars (toplevel,
+ s_page_objects (toplevel->page_current),
+ 0, unicode_table);
/* printf("%d %d\n", toplevel->paper_width, toplevel->paper_height);*/
world_get_object_glist_bounds (toplevel,
- toplevel->page_current->object_list,
+ s_page_objects (toplevel->page_current),
&origin_x, &origin_y,
&right, &bottom);
@@ -617,7 +618,7 @@ int f_print_stream(TOPLEVEL *toplevel, FILE *fp)
scale, scale);
/* Print the objects */
- f_print_objects (toplevel, fp, toplevel->page_current->object_list,
+ f_print_objects (toplevel, fp, s_page_objects (toplevel->page_current),
origin_x, origin_y, scale, unicode_count, unicode_table);
f_print_footer(fp);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 0dfe3f6..63afdaa 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -1568,7 +1568,7 @@ char *o_attrib_search_toplevel_all(GedaPageList *page_list, char *name)
p_current = (PAGE *)iter->data;
/* only look for first occurrance of the attribute */
- ret_value = o_attrib_search_toplevel (p_current->object_list, name, 0);
+ ret_value = o_attrib_search_toplevel (s_page_objects (p_current), name, 0);
if (ret_value != NULL) {
return(ret_value);
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 17bf9ba..d9b50df 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -610,7 +610,7 @@ void o_net_consolidate(TOPLEVEL *toplevel)
const GList *iter;
int status = 0;
- iter = toplevel->page_current->object_list;
+ iter = s_page_objects (toplevel->page_current);
while (iter != NULL) {
o_current = (OBJECT *)iter->data;
@@ -620,7 +620,7 @@ void o_net_consolidate(TOPLEVEL *toplevel)
}
if (status == -1) {
- iter = toplevel->page_current->object_list;
+ iter = s_page_objects (toplevel->page_current);
status = 0;
} else {
iter = g_list_next (iter);
diff --git a/libgeda/src/s_clib.c b/libgeda/src/s_clib.c
index 86571a5..2ec82af 100644
--- a/libgeda/src/s_clib.c
+++ b/libgeda/src/s_clib.c
@@ -1445,7 +1445,7 @@ GList *s_toplevel_get_symbols (const TOPLEVEL *toplevel)
p_iter != NULL;
p_iter = g_list_next( p_iter )) {
page = (PAGE *)p_iter->data;
- for (o_iter = page->object_list;
+ for (o_iter = s_page_objects (page);
o_iter != NULL;
o_iter = g_list_next (o_iter)) {
o = (OBJECT *)o_iter->data;
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 80cf178..731f094 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -232,7 +232,7 @@ GList *s_hierarchy_traversepages(TOPLEVEL *toplevel,
}
/* walk throught the page objects and search for underlaying schematics */
- for (iter = p_current->object_list;
+ for (iter = s_page_objects (p_current);
iter != NULL ;
iter = g_list_next (iter)) {
o_current = (OBJECT *)iter->data;
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index f5926e4..85669a3 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -97,7 +97,7 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
s_tile_init (toplevel, page);
/* Init the object list */
- page->object_list = NULL;
+ page->_object_list = NULL;
/* new selection mechanism */
page->selection_list = o_selection_new();
@@ -349,7 +349,7 @@ void s_page_print_all (TOPLEVEL *toplevel)
page = (PAGE *)iter->data;
printf ("FILENAME: %s\n", page->page_filename);
- print_struct_forw (page->object_list);
+ print_struct_forw (page->_object_list);
}
}
@@ -520,7 +520,7 @@ gint s_page_autosave (TOPLEVEL *toplevel)
*/
void s_page_append (PAGE *page, OBJECT *object)
{
- page->object_list = g_list_append (page->object_list, object);
+ page->_object_list = g_list_append (page->_object_list, object);
}
/*! \brief Append a GList of OBJECTs to the PAGE
@@ -534,7 +534,7 @@ void s_page_append (PAGE *page, OBJECT *object)
*/
void s_page_append_list (PAGE *page, GList *obj_list)
{
- page->object_list = g_list_concat (page->object_list, obj_list);
+ page->_object_list = g_list_concat (page->_object_list, obj_list);
}
/*! \brief Remove an OBJECT from the PAGE
@@ -548,7 +548,7 @@ void s_page_append_list (PAGE *page, GList *obj_list)
*/
void s_page_remove (PAGE *page, OBJECT *object)
{
- page->object_list = g_list_remove (page->object_list, object);
+ page->_object_list = g_list_remove (page->_object_list, object);
}
/*! \brief Remove and free all OBJECTs from the PAGE
@@ -561,10 +561,28 @@ void s_page_remove (PAGE *page, OBJECT *object)
*/
void s_page_delete_objects (TOPLEVEL *toplevel, PAGE *page)
{
- s_delete_object_glist (toplevel, page->object_list);
- page->object_list = NULL;
+ s_delete_object_glist (toplevel, page->_object_list);
+ page->_object_list = NULL;
}
+
+/*! \brief Return a GList of OBJECTs on the PAGE
+ *
+ * \par Function Description
+ * An accessor for the PAGE's GList of objects.
+ *
+ * NB: This GList is owned by the PAGE, and must not be
+ * free'd or modified by the caller.
+ *
+ * \param [in] page The PAGE to get objects on.
+ * \returns a const pointer to the PAGE's GList of objects
+ */
+const GList *s_page_objects (PAGE *page)
+{
+ return page->_object_list;
+}
+
+
/*! \brief Find the objects in a given region
*
* \par Function Description
@@ -611,7 +629,7 @@ GList *s_page_objects_in_regions (TOPLEVEL *toplevel, PAGE *page,
GList *list = NULL;
int i;
- for (iter = page->object_list; iter != NULL; iter = g_list_next (iter)) {
+ for (iter = page->_object_list; iter != NULL; iter = g_list_next (iter)) {
OBJECT *object = iter->data;
for (i = 0; i < n_rects; i++) {
diff --git a/utils/gschlas/s_util.c b/utils/gschlas/s_util.c
index e9e04c2..0f3d33d 100644
--- a/utils/gschlas/s_util.c
+++ b/utils/gschlas/s_util.c
@@ -52,7 +52,7 @@ s_util_embed(TOPLEVEL *pr_current, int embed_mode)
p_iter = g_list_next (p_iter)) {
PAGE *p_current = p_iter->data;
- for (o_iter = p_current->object_list;
+ for (o_iter = s_page_objects (p_current);
o_iter != NULL;
o_iter = g_list_next (o_iter)) {
OBJECT *o_current = o_iter->data;
commit ca6556ace0a06ec1dd697852f7a1f0ffb86bfb97
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Dec 31 17:25:57 2008 +0000
Add "const" to some places where we deal with GLists of OBJECTs.
These GLists themselves are not (and shouldn't be) modified, although
the OBJECTs they point at may well be.
diff --git a/gattrib/include/prototype.h b/gattrib/include/prototype.h
index d53107b..4745506 100644
--- a/gattrib/include/prototype.h
+++ b/gattrib/include/prototype.h
@@ -36,12 +36,12 @@ char *s_attrib_get_refdes(OBJECT *object);
/* ------------- s_sheet_data.c ------------- */
SHEET_DATA *s_sheet_data_new();
-void s_sheet_data_add_master_comp_list_items(GList *obj_list);
-void s_sheet_data_add_master_comp_attrib_list_items(GList *obj_list);
-void s_sheet_data_add_master_net_list_items(GList *obj_list);
-void s_sheet_data_add_master_net_attrib_list_items(GList *obj_list);
-void s_sheet_data_add_master_pin_list_items(GList *obj_list);
-void s_sheet_data_add_master_pin_attrib_list_items(GList *obj_list);
+void s_sheet_data_add_master_comp_list_items(const GList *obj_list);
+void s_sheet_data_add_master_comp_attrib_list_items(const GList *obj_list);
+void s_sheet_data_add_master_net_list_items(const GList *obj_list);
+void s_sheet_data_add_master_net_attrib_list_items(const GList *obj_list);
+void s_sheet_data_add_master_pin_list_items(const GList *obj_list);
+void s_sheet_data_add_master_pin_attrib_list_items(const GList *obj_list);
void s_sheet_data_gtksheet_to_sheetdata();
@@ -73,9 +73,9 @@ STRING_LIST *s_table_create_attrib_pair(gchar *row_name,
STRING_LIST *row_list,
int num_attribs);
-void s_table_add_toplevel_comp_items_to_comp_table(GList *obj_list);
-void s_table_add_toplevel_net_items_to_net_table(GList *obj_list);
-void s_table_add_toplevel_pin_items_to_pin_table(GList *obj_list);
+void s_table_add_toplevel_comp_items_to_comp_table(const GList *obj_list);
+void s_table_add_toplevel_net_items_to_net_table(const GList *obj_list);
+void s_table_add_toplevel_pin_items_to_pin_table(const GList *obj_list);
void s_table_gtksheet_to_all_tables();
void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet,
diff --git a/gattrib/src/s_sheet_data.c b/gattrib/src/s_sheet_data.c
index f69934c..185f832 100644
--- a/gattrib/src/s_sheet_data.c
+++ b/gattrib/src/s_sheet_data.c
@@ -100,9 +100,9 @@ SHEET_DATA *s_sheet_data_new()
* OBJECT->attribs(->next. . .)->object->text->string
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_comp_list_items (GList *obj_list) {
+void s_sheet_data_add_master_comp_list_items (const GList *obj_list) {
char *temp_uref;
- GList *iter;
+ const GList *iter;
#ifdef DEBUG
printf("=========== Just entered s_sheet_data_add_master_comp_list_items! ==============\n");
@@ -161,10 +161,11 @@ void s_sheet_data_add_master_comp_list_items (GList *obj_list) {
* sheet_head->component_list_head->attrib->name;
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_comp_attrib_list_items (GList *obj_list) {
+void s_sheet_data_add_master_comp_attrib_list_items (const GList *obj_list) {
char *attrib_text;
char *attrib_name;
- GList *o_iter, *a_iter;
+ const GList *o_iter;
+ GList *a_iter;
OBJECT *a_current;
#ifdef DEBUG
@@ -236,7 +237,7 @@ void s_sheet_data_add_master_comp_attrib_list_items (GList *obj_list) {
* attributes.
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_net_list_items (GList *obj_start) {
+void s_sheet_data_add_master_net_list_items (const GList *obj_start) {
return;
}
@@ -247,7 +248,7 @@ void s_sheet_data_add_master_net_list_items (GList *obj_start) {
* attributes.
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_net_attrib_list_items (GList *obj_start) {
+void s_sheet_data_add_master_net_attrib_list_items (const GList *obj_start) {
return;
}
@@ -269,11 +270,12 @@ void s_sheet_data_add_master_net_attrib_list_items (GList *obj_start) {
* it doesn't return a value.
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_pin_list_items (GList *obj_list) {
+void s_sheet_data_add_master_pin_list_items (const GList *obj_list) {
char *temp_uref;
char *temp_pinnumber;
char *row_label;
- GList *o_iter, *o_lower_iter;
+ const GList *o_iter;
+ GList *o_lower_iter;
#ifdef DEBUG
fflush(stderr);
@@ -356,12 +358,13 @@ void s_sheet_data_add_master_pin_list_items (GList *obj_list) {
* and stick it in the master pin attrib list.
*
*------------------------------------------------------------------*/
-void s_sheet_data_add_master_pin_attrib_list_items (GList *obj_list) {
+void s_sheet_data_add_master_pin_attrib_list_items (const GList *obj_list) {
char *temp_uref;
char *attrib_text;
char *attrib_name;
char *attrib_value;
- GList *o_iter, *o_lower_iter, *a_iter;
+ const GList *o_iter;
+ GList *o_lower_iter, *a_iter;
OBJECT *pin_attrib;
#ifdef DEBUG
diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index 52c7bd5..ba00be0 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -238,13 +238,14 @@ STRING_LIST *s_table_create_attrib_pair(gchar *row_name,
* attribs and sticks them in the TABLE.
*
*------------------------------------------------------------------*/
-void s_table_add_toplevel_comp_items_to_comp_table (GList *obj_list) {
+void s_table_add_toplevel_comp_items_to_comp_table (const GList *obj_list) {
gchar *temp_uref;
int row, col;
gchar *attrib_text;
gchar *attrib_name;
gchar *attrib_value;
- GList *o_iter, *a_iter;
+ const GList *o_iter;
+ GList *a_iter;
OBJECT *a_current;
gint old_visibility, old_show_name_value;
@@ -435,7 +436,7 @@ void s_table_add_toplevel_net_items_to_net_table(OBJECT *start_obj) {
* pin attribs and sticks them into the pin table.
*
*------------------------------------------------------------------*/
-void s_table_add_toplevel_pin_items_to_pin_table (GList *obj_list) {
+void s_table_add_toplevel_pin_items_to_pin_table (const GList *obj_list) {
gchar *temp_uref;
gchar *pinnumber;
gchar *row_label;
@@ -443,7 +444,8 @@ void s_table_add_toplevel_pin_items_to_pin_table (GList *obj_list) {
gchar *attrib_text;
gchar *attrib_name;
gchar *attrib_value;
- GList *o_iter, *a_iter;
+ const GList *o_iter;
+ GList *a_iter;
GList *o_lower_iter;
OBJECT *pin_attrib;
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index 48b53f0..1571e06 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -86,7 +86,9 @@ int s_toplevel_read_page(char *filename)
*/
void s_toplevel_verify_design(TOPLEVEL *pr_current)
{
- GList *p_iter, *o_iter;
+ GList *p_iter;
+ const GList *o_iter;
+
int missing_sym_flag = 0;
for (p_iter = geda_list_get_glist (pr_current->pages);
@@ -407,7 +409,8 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
/* Work from a copy list, as objects can be deleted
* from the list during iteration over the list.
*/
- copy_list = g_list_copy (page->object_list);
+ /* NB: g_list_copy doesn't declare its input const, so we cast */
+ copy_list = g_list_copy ((GList *)page->object_list);
/* Iterate backwards since attributes are attached after their
* parent objects in the list. Attributes can get deleted during
@@ -471,7 +474,8 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
/* Work from a copy list in case objects are
* deleted from the list during its iteration.
*/
- copy_list = g_list_copy (page->object_list);
+ /* NB: g_list_copy doesn't declare its input const, so we cast */
+ copy_list = g_list_copy ((GList *)page->object_list);
for (o_iter = g_list_last (copy_list);
o_iter != NULL;
diff --git a/gnetlist/include/prototype.h b/gnetlist/include/prototype.h
index fdf9529..8e73350 100644
--- a/gnetlist/include/prototype.h
+++ b/gnetlist/include/prototype.h
@@ -108,7 +108,7 @@ SCM g_get_renamed_nets(SCM scm_level);
/* s_traverse.c */
void s_traverse_init(void);
void s_traverse_start(TOPLEVEL *pr_current);
-void s_traverse_sheet(TOPLEVEL *pr_current, GList *obj_list, char *hierarchy_tag);
+void s_traverse_sheet(TOPLEVEL *pr_current, const GList *obj_list, char *hierarchy_tag);
CPINLIST *s_traverse_component(TOPLEVEL *pr_current, OBJECT *component, char *hierarchy_tag);
NET *s_traverse_net(TOPLEVEL *pr_current, OBJECT *previous_object, NET *nets, OBJECT *object, char *hierarchy_tag);
/* vams_misc.c */
diff --git a/gnetlist/src/s_traverse.c b/gnetlist/src/s_traverse.c
index 3970adc..c8638b9 100644
--- a/gnetlist/src/s_traverse.c
+++ b/gnetlist/src/s_traverse.c
@@ -73,7 +73,7 @@ visit(OBJECT *obj)
/*! Reset all visit counts. Simply clears the hashtable completely. */
static inline void
-s_traverse_clear_all_visited (GList *obj_list)
+s_traverse_clear_all_visited (const GList *obj_list)
{
g_hash_table_foreach_remove (visit_table,
(GHRFunc) returns_true,
@@ -148,14 +148,14 @@ void s_traverse_start(TOPLEVEL * pr_current)
void
-s_traverse_sheet (TOPLEVEL * pr_current, GList *obj_list, char *hierarchy_tag)
+s_traverse_sheet (TOPLEVEL * pr_current, const GList *obj_list, char *hierarchy_tag)
{
NETLIST *netlist;
char *temp;
SCM scm_uref;
char *temp_uref;
gboolean is_graphical=FALSE;
- GList *iter;
+ const GList *iter;
if (verbose_mode) {
printf("- Starting internal netlist creation\n");
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 634ad6d..e961fbf 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -9,7 +9,7 @@ void a_pan(GSCHEM_TOPLEVEL *w_current, int x, int y);
void a_pan_mouse(GSCHEM_TOPLEVEL *w_current, int diff_x, int diff_y);
/* a_zoom.c */
void a_zoom(GSCHEM_TOPLEVEL *w_current, int dir, int selected_from, int pan_flags);
-void a_zoom_extents(GSCHEM_TOPLEVEL *w_current, GList *list, int pan_flags);
+void a_zoom_extents(GSCHEM_TOPLEVEL *w_current, const GList *list, int pan_flags);
void a_zoom_box(GSCHEM_TOPLEVEL *w_current, int pan_flags);
void a_zoom_box_start(GSCHEM_TOPLEVEL *w_current, int x, int y);
void a_zoom_box_end(GSCHEM_TOPLEVEL *w_current, int x, int y);
@@ -585,12 +585,12 @@ void o_lock(GSCHEM_TOPLEVEL *w_current);
void o_unlock(GSCHEM_TOPLEVEL *w_current);
void o_rotate_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery, int angle, GList *list);
void o_mirror_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery, GList *list);
-void o_edit_show_hidden_lowlevel(GSCHEM_TOPLEVEL *w_current, GList *o_list);
-void o_edit_show_hidden(GSCHEM_TOPLEVEL *w_current, GList *o_list);
-void o_edit_make_visible(GSCHEM_TOPLEVEL *w_current, GList *o_list);
-int o_edit_find_text(GSCHEM_TOPLEVEL *w_current, GList *o_list, char *stext, int descend, int skip);
-void o_edit_hide_specific_text(GSCHEM_TOPLEVEL *w_current, GList *o_list, char *stext);
-void o_edit_show_specific_text(GSCHEM_TOPLEVEL *w_current, GList *o_list, char *stext);
+void o_edit_show_hidden_lowlevel(GSCHEM_TOPLEVEL *w_current, const GList *o_list);
+void o_edit_show_hidden(GSCHEM_TOPLEVEL *w_current, const GList *o_list);
+void o_edit_make_visible(GSCHEM_TOPLEVEL *w_current, const GList *o_list);
+int o_edit_find_text(GSCHEM_TOPLEVEL *w_current, const GList *o_list, char *stext, int descend, int skip);
+void o_edit_hide_specific_text(GSCHEM_TOPLEVEL *w_current, const GList *o_list, char *stext);
+void o_edit_show_specific_text(GSCHEM_TOPLEVEL *w_current, const GList *o_list, char *stext);
void o_update_component(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
void o_autosave_backups(GSCHEM_TOPLEVEL *w_current);
/* o_move.c */
diff --git a/gschem/src/a_zoom.c b/gschem/src/a_zoom.c
index b94a5ec..9ba733a 100644
--- a/gschem/src/a_zoom.c
+++ b/gschem/src/a_zoom.c
@@ -142,7 +142,7 @@ void a_zoom(GSCHEM_TOPLEVEL *w_current, int dir, int selected_from, int pan_flag
* \par Function Description
*
*/
-void a_zoom_extents (GSCHEM_TOPLEVEL *w_current, GList *list, int pan_flags)
+void a_zoom_extents (GSCHEM_TOPLEVEL *w_current, const GList *list, int pan_flags)
{
TOPLEVEL *toplevel = w_current->toplevel;
int lleft, lright, ltop, lbottom;
diff --git a/gschem/src/g_funcs.c b/gschem/src/g_funcs.c
index abcd684..e8b0fc5 100644
--- a/gschem/src/g_funcs.c
+++ b/gschem/src/g_funcs.c
@@ -264,7 +264,7 @@ SCM get_selected_component_attributes(GSCHEM_TOPLEVEL *w_current)
SCM list = SCM_EOL;
OBJECT *obj;
GHashTable *ht;
- GList *iter;
+ const GList *iter;
/* build a hash table */
ht = g_hash_table_new (g_str_hash, g_str_equal);
diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 51614c4..c3e92bf 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -734,7 +734,7 @@ SCM g_get_objects_in_page(SCM page_smob) {
TOPLEVEL *toplevel;
PAGE *page;
OBJECT *object;
- GList *iter;
+ const GList *iter;
SCM return_list=SCM_EOL;
/* Get toplevel and the page */
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index f5be3a4..933a7f8 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -218,7 +218,7 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
TOPLEVEL *toplevel = w_current->toplevel;
int w_rleft, w_rtop, w_rright, w_rbottom;
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
int x, y;
/* first zoom extents */
diff --git a/gschem/src/o_find.c b/gschem/src/o_find.c
index 4ea3c0c..0c97ee2 100644
--- a/gschem/src/o_find.c
+++ b/gschem/src/o_find.c
@@ -95,7 +95,7 @@ gboolean o_find_object (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
{
TOPLEVEL *toplevel = w_current->toplevel;
int w_slack;
- GList *iter = NULL;
+ const GList *iter = NULL;
w_slack = WORLDabs( toplevel, w_current->select_slack_pixels );
@@ -105,7 +105,8 @@ gboolean o_find_object (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y,
position point. You can change the selected object by clicking
at the same place multiple times. */
if (toplevel->page_current->object_lastplace != NULL) {
- iter = g_list_find (toplevel->page_current->object_list,
+ /* NB: g_list_find doesn't declare its input const, so we cast */
+ iter = g_list_find ((GList *)toplevel->page_current->object_list,
toplevel->page_current->object_lastplace);
iter = g_list_next (iter);
}
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 7b356c5..5d4500d 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -382,11 +382,12 @@ void o_mirror_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery,
* \par Function Description
*
*/
-void o_edit_show_hidden_lowlevel (GSCHEM_TOPLEVEL *w_current, GList *o_list)
+void o_edit_show_hidden_lowlevel (GSCHEM_TOPLEVEL *w_current,
+ const GList *o_list)
{
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
iter = o_list;
while (iter != NULL) {
@@ -426,7 +427,7 @@ void o_edit_show_hidden_lowlevel (GSCHEM_TOPLEVEL *w_current, GList *o_list)
* \par Function Description
*
*/
-void o_edit_show_hidden (GSCHEM_TOPLEVEL *w_current, GList *o_list)
+void o_edit_show_hidden (GSCHEM_TOPLEVEL *w_current, const GList *o_list)
{
/* this function just shows the hidden text, but doesn't toggle it */
/* this function does not change the CHANGED bit, no real changes are */
@@ -452,12 +453,12 @@ void o_edit_show_hidden (GSCHEM_TOPLEVEL *w_current, GList *o_list)
* \par Function Description
*
*/
-void o_edit_make_visible (GSCHEM_TOPLEVEL *w_current, GList *o_list)
+void o_edit_make_visible (GSCHEM_TOPLEVEL *w_current, const GList *o_list)
{
/* this function actually changes the visibility flag */
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
iter = o_list;
while (iter != NULL) {
@@ -492,8 +493,8 @@ int skiplast;
* \par Function Description
*
*/
-int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, GList * o_list, char *stext,
- int descend, int skip)
+int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, const GList *o_list,
+ char *stext, int descend, int skip)
{
TOPLEVEL *toplevel = w_current->toplevel;
char *attrib = NULL;
@@ -504,7 +505,7 @@ int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, GList * o_list, char *stext,
int pcount = 0;
int rv;
int text_screen_height;
- GList *iter;
+ const GList *iter;
OBJECT *o_current;
@@ -598,12 +599,13 @@ int o_edit_find_text (GSCHEM_TOPLEVEL *w_current, GList * o_list, char *stext,
* \par Function Description
*
*/
-void o_edit_hide_specific_text (GSCHEM_TOPLEVEL *w_current, GList * o_list,
- char *stext)
+void o_edit_hide_specific_text (GSCHEM_TOPLEVEL *w_current,
+ const GList *o_list,
+ char *stext)
{
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
iter = o_list;
while (iter != NULL) {
@@ -633,12 +635,13 @@ void o_edit_hide_specific_text (GSCHEM_TOPLEVEL *w_current, GList * o_list,
* \par Function Description
*
*/
-void o_edit_show_specific_text (GSCHEM_TOPLEVEL *w_current, GList * o_list,
- char *stext)
+void o_edit_show_specific_text (GSCHEM_TOPLEVEL *w_current,
+ const GList *o_list,
+ char *stext)
{
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
iter = o_list;
while (iter != NULL) {
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index feb8ae4..ebbf453 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -344,7 +344,7 @@ void o_select_box_search(GSCHEM_TOPLEVEL *w_current)
int count = 0; /* object count */
int SHIFTKEY = w_current->SHIFTKEY;
int left, right, top, bottom;
- GList *iter;
+ const GList *iter;
left = min(w_current->first_wx, w_current->second_wx);
right = max(w_current->first_wx, w_current->second_wx);
@@ -390,7 +390,7 @@ void o_select_box_search(GSCHEM_TOPLEVEL *w_current)
void o_select_connected_nets(GSCHEM_TOPLEVEL *w_current, OBJECT* o_net)
{
TOPLEVEL *toplevel = w_current->toplevel;
- GList *o_iter;
+ const GList *o_iter;
GList *iter1;
OBJECT *o_current;
int count=0;
diff --git a/gschem/src/x_autonumber.c b/gschem/src/x_autonumber.c
index daee8db..3301947 100644
--- a/gschem/src/x_autonumber.c
+++ b/gschem/src/x_autonumber.c
@@ -392,7 +392,7 @@ void autonumber_get_used(GSCHEM_TOPLEVEL *w_current, AUTONUMBER_TEXT *autotext)
AUTONUMBER_SLOT *slot;
GList *slot_item;
char *numslot_str, *slot_str;
- GList *iter;
+ const GList *iter;
for (iter = w_current->toplevel->page_current->object_list; iter != NULL;
iter = g_list_next (iter)) {
@@ -665,7 +665,7 @@ void autonumber_text_autonumber(AUTONUMBER_TEXT *autotext)
gchar *new_searchtext;
gint i, number, slot;
GList *o_list = NULL;
- GList *iter;
+ const GList *iter;
w_current = autotext->w_current;
autotext->current_searchtext = NULL;
diff --git a/gsymcheck/include/prototype.h b/gsymcheck/include/prototype.h
index 4d063ee..ad24b2a 100644
--- a/gsymcheck/include/prototype.h
+++ b/gsymcheck/include/prototype.h
@@ -14,22 +14,22 @@ void usage(char *cmd);
int parse_commandline(int argc, char *argv[]);
/* s_check.c */
int s_check_all(TOPLEVEL *pr_current);
-int s_check_symbol(TOPLEVEL *pr_current, PAGE *p_current, GList *obj_list);
+int s_check_symbol(TOPLEVEL *pr_current, PAGE *p_current, const GList *obj_list);
gboolean s_check_list_has_item(char **list , char *item);
-void s_check_symbol_structure(GList *obj_list, SYMCHECK *s_current);
-void s_check_graphical(GList *obj_list, SYMCHECK *s_current);
-void s_check_device(GList *obj_list, SYMCHECK *s_current);
-void s_check_pinseq(GList *obj_list, SYMCHECK *s_current);
-void s_check_pinnumber(GList *obj_list, SYMCHECK *s_current);
-void s_check_pin_ongrid(GList *obj_list, SYMCHECK *s_current);
-void s_check_slotdef(GList *obj_list, SYMCHECK *s_current);
-void s_check_oldpin(GList *obj_list, SYMCHECK *s_current);
-void s_check_oldslot(GList *obj_list, SYMCHECK *s_current);
-void s_check_nets_buses(GList *obj_list, SYMCHECK *s_current);
-void s_check_connections(GList *obj_list, SYMCHECK *s_current);
+void s_check_symbol_structure(const GList *obj_list, SYMCHECK *s_current);
+void s_check_graphical(const GList *obj_list, SYMCHECK *s_current);
+void s_check_device(const GList *obj_list, SYMCHECK *s_current);
+void s_check_pinseq(const GList *obj_list, SYMCHECK *s_current);
+void s_check_pinnumber(const GList *obj_list, SYMCHECK *s_current);
+void s_check_pin_ongrid(const GList *obj_list, SYMCHECK *s_current);
+void s_check_slotdef(const GList *obj_list, SYMCHECK *s_current);
+void s_check_oldpin(const GList *obj_list, SYMCHECK *s_current);
+void s_check_oldslot(const GList *obj_list, SYMCHECK *s_current);
+void s_check_nets_buses(const GList *obj_list, SYMCHECK *s_current);
+void s_check_connections(const GList *obj_list, SYMCHECK *s_current);
void s_check_missing_attribute(OBJECT *object, char *attribute, SYMCHECK *s_current);
-void s_check_missing_attributes(GList *obj_list, SYMCHECK *s_current);
-void s_check_pintype(GList *obj_list, SYMCHECK *s_current);
+void s_check_missing_attributes(const GList *obj_list, SYMCHECK *s_current);
+void s_check_pintype(const GList *obj_list, SYMCHECK *s_current);
/* s_log.c */
void s_log_update (const gchar *log_domain, GLogLevelFlags log_level, const gchar *buf);
/* s_symstruct.c */
diff --git a/gsymcheck/src/s_check.c b/gsymcheck/src/s_check.c
index 200fcce..6480d9d 100644
--- a/gsymcheck/src/s_check.c
+++ b/gsymcheck/src/s_check.c
@@ -64,7 +64,7 @@ s_check_all(TOPLEVEL *pr_current)
int
-s_check_symbol (TOPLEVEL *pr_current, PAGE *p_current, GList *obj_list)
+s_check_symbol (TOPLEVEL *pr_current, PAGE *p_current, const GList *obj_list)
{
SYMCHECK *s_symcheck=NULL;
int errors=0, warnings=0;
@@ -176,9 +176,9 @@ s_check_list_has_item(char **list , char *item)
}
void
-s_check_symbol_structure (GList *obj_list, SYMCHECK *s_current)
+s_check_symbol_structure (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
gchar *message;
gchar **tokens;
@@ -259,7 +259,7 @@ s_check_symbol_structure (GList *obj_list, SYMCHECK *s_current)
}
void
-s_check_graphical (GList *obj_list, SYMCHECK *s_current)
+s_check_graphical (const GList *obj_list, SYMCHECK *s_current)
{
char *temp;
@@ -273,7 +273,7 @@ s_check_graphical (GList *obj_list, SYMCHECK *s_current)
}
void
-s_check_device (GList *obj_list, SYMCHECK *s_current)
+s_check_device (const GList *obj_list, SYMCHECK *s_current)
{
char *temp;
char *message;
@@ -315,7 +315,7 @@ s_check_device (GList *obj_list, SYMCHECK *s_current)
void
-s_check_pinseq (GList *obj_list, SYMCHECK *s_current)
+s_check_pinseq (const GList *obj_list, SYMCHECK *s_current)
{
char *string;
int found_first=FALSE;
@@ -326,7 +326,7 @@ s_check_pinseq (GList *obj_list, SYMCHECK *s_current)
GList *found_numbers = NULL;
GList *ptr1 = NULL;
GList *ptr2 = NULL;
- GList *iter;
+ const GList *iter;
char *number;
char *message;
@@ -442,7 +442,7 @@ s_check_pinseq (GList *obj_list, SYMCHECK *s_current)
void
-s_check_pinnumber (GList *obj_list, SYMCHECK *s_current)
+s_check_pinnumber (const GList *obj_list, SYMCHECK *s_current)
{
char *string;
int missing_pinnumber_attrib_sum=0;
@@ -456,7 +456,7 @@ s_check_pinnumber (GList *obj_list, SYMCHECK *s_current)
GList *pin_numbers = NULL;
GList *cur = NULL;
GList *cur2 = NULL;
- GList *iter;
+ const GList *iter;
char *message;
char *net = NULL;
@@ -630,10 +630,10 @@ s_check_pinnumber (GList *obj_list, SYMCHECK *s_current)
}
void
-s_check_pin_ongrid (GList *obj_list, SYMCHECK *s_current)
+s_check_pin_ongrid (const GList *obj_list, SYMCHECK *s_current)
{
int x1, x2, y1, y2;
- GList *iter;
+ const GList *iter;
char *message;
for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
@@ -681,7 +681,7 @@ s_check_pin_ongrid (GList *obj_list, SYMCHECK *s_current)
void
-s_check_slotdef (GList *obj_list, SYMCHECK *s_current)
+s_check_slotdef (const GList *obj_list, SYMCHECK *s_current)
{
char* value = NULL;
char* slotdef = NULL;
@@ -976,9 +976,9 @@ s_check_slotdef (GList *obj_list, SYMCHECK *s_current)
void
-s_check_oldpin (GList *obj_list, SYMCHECK *s_current)
+s_check_oldpin (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
char *ptr;
int found_old = FALSE;
int number_counter = 0;
@@ -1048,9 +1048,9 @@ s_check_oldpin (GList *obj_list, SYMCHECK *s_current)
void
-s_check_oldslot (GList *obj_list, SYMCHECK *s_current)
+s_check_oldslot (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
char *ptr;
int found_old = FALSE;
int number_counter = 0;
@@ -1118,9 +1118,9 @@ s_check_oldslot (GList *obj_list, SYMCHECK *s_current)
void
-s_check_nets_buses (GList *obj_list, SYMCHECK *s_current)
+s_check_nets_buses (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
char *message;
for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
@@ -1150,9 +1150,9 @@ s_check_nets_buses (GList *obj_list, SYMCHECK *s_current)
}
void
-s_check_connections (GList *obj_list, SYMCHECK *s_current)
+s_check_connections (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
char *message;
for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
@@ -1224,9 +1224,9 @@ s_check_missing_attribute(OBJECT *object, char *attribute, SYMCHECK *s_current)
}
void
-s_check_missing_attributes (GList *obj_list, SYMCHECK *s_current)
+s_check_missing_attributes (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
char *message;
for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
@@ -1293,9 +1293,9 @@ s_check_missing_attributes (GList *obj_list, SYMCHECK *s_current)
}
-void s_check_pintype (GList *obj_list, SYMCHECK *s_current)
+void s_check_pintype (const GList *obj_list, SYMCHECK *s_current)
{
- GList *iter;
+ const GList *iter;
int counter=0;
char *pintype;
char *message;
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 1289c60..13a8a87 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -117,13 +117,13 @@ void o_attrib_print(GList *attributes);
void o_attrib_remove(GList **list, OBJECT *remove);
gboolean o_attrib_get_name_value (const gchar *string, gchar **name_ptr, gchar **value_ptr);
void o_attrib_set_color(TOPLEVEL *toplevel, GList *attributes);
-char *o_attrib_search_name(GList *list, char *name, int counter);
+char *o_attrib_search_name(const GList *list, char *name, int counter);
OBJECT *o_attrib_search_string_list(GList *list, char *string);
char *o_attrib_search_string_partial(OBJECT *object, char *search_for, int counter);
OBJECT *o_attrib_search_string_single(OBJECT *object, char *search_for);
OBJECT *o_attrib_search_attrib_value(GList *list, char *value, char *name, int counter);
char *o_attrib_search_attrib_name(GList *list, char *name, int counter);
-char *o_attrib_search_toplevel(GList *list, char *name, int counter);
+char *o_attrib_search_toplevel(const GList *list, char *name, int counter);
char *o_attrib_search_name_single(OBJECT *object, char *name, OBJECT **return_found);
char *o_attrib_search_name_single_count(OBJECT *object, char *name, int counter);
char *o_attrib_search_slot(OBJECT *object, OBJECT **return_found);
@@ -182,11 +182,11 @@ void o_circle_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_cent
int world_get_single_object_bounds(TOPLEVEL *toplevel, OBJECT *o_current,
int *rleft, int *rtop,
int *rright, int *rbottom);
-int world_get_object_glist_bounds(TOPLEVEL *toplevel, GList *o_list,
+int world_get_object_glist_bounds(TOPLEVEL *toplevel, const GList *o_list,
int *left, int *top,
int *right, int *bottom);
int o_complex_is_embedded(OBJECT *o_current);
-GList *o_complex_get_toplevel_attribs (TOPLEVEL *toplevel, GList *obj_list);
+GList *o_complex_get_toplevel_attribs (TOPLEVEL *toplevel, const GList *obj_list);
GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int detach);
GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object);
void o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *object);
@@ -226,10 +226,10 @@ double o_line_length(OBJECT *object);
/* o_list.c */
OBJECT *o_object_copy(TOPLEVEL *toplevel, OBJECT *selected, int flag);
-GList *o_glist_copy_all(TOPLEVEL *toplevel, GList *src_list, GList *dest_list, int flag);
-void o_glist_translate_world(TOPLEVEL *toplevel, int dx, int dy, GList *list);
-void o_glist_rotate_world(TOPLEVEL *toplevel, int x, int y, int angle, GList *list);
-void o_glist_mirror_world(TOPLEVEL *toplevel, int x, int y, GList *list);
+GList *o_glist_copy_all(TOPLEVEL *toplevel, const GList *src_list, GList *dest_list, int flag);
+void o_glist_translate_world(TOPLEVEL *toplevel, int dx, int dy, const GList *list);
+void o_glist_rotate_world(TOPLEVEL *toplevel, int x, int y, int angle, const GList *list);
+void o_glist_mirror_world(TOPLEVEL *toplevel, int x, int y, const GList *list);
/* o_net_basic.c */
OBJECT *o_net_new(TOPLEVEL *toplevel, char type, int color, int x1, int y1, int x2, int y2);
@@ -373,7 +373,7 @@ GList *s_conn_return_others(GList *input_list, OBJECT *object);
/* s_cue.c */
void s_cue_postscript_fillbox(TOPLEVEL *toplevel, FILE *fp, int x, int y);
void s_cue_postscript_fillcircle(TOPLEVEL *toplevel, FILE *fp, int x, int y, int size_flag);
-void s_cue_output_all(TOPLEVEL *toplevel, GList *obj_list, FILE *fp, int type);
+void s_cue_output_all(TOPLEVEL *toplevel, const GList *obj_list, FILE *fp, int type);
void s_cue_output_lowlevel(TOPLEVEL *toplevel, OBJECT *object, int whichone, FILE *fp, int output_type);
void s_cue_output_lowlevel_midpoints(TOPLEVEL *toplevel, OBJECT *object, FILE *fp, int output_type);
void s_cue_output_single(TOPLEVEL *toplevel, OBJECT *object, FILE *fp, int type);
diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 8a36e21..f107194 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -1,12 +1,12 @@
/* a_basic.c */
-gchar *o_save_objects(GList *object_list, gboolean save_attribs);
+gchar *o_save_objects(const GList *object_list, gboolean save_attribs);
/* f_print.c */
void f_print_set_line_width(FILE *fp, int width);
void f_print_set_color(TOPLEVEL *toplevel, FILE *fp, int color);
int f_print_header(TOPLEVEL *toplevel, FILE *fp, int paper_size_x, int paper_size_y, int eps);
void f_print_footer(FILE *fp);
-void f_print_objects(TOPLEVEL *toplevel, FILE *fp, GList *obj_list, int start_x, int start_y, float scale, int unicode_count, gunichar *unicode_table);
+void f_print_objects(TOPLEVEL *toplevel, FILE *fp, const GList *obj_list, int start_x, int start_y, float scale, int unicode_count, gunichar *unicode_table);
int f_print_initialize_glyph_table(void);
/* g_rc.c */
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 7acc3d8..d1a801a 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -96,10 +96,10 @@ gchar *o_save_buffer (TOPLEVEL *toplevel)
* \param [in] save_attribs Should attribute objects encounterd be saved?
* \returns a buffer containing schematic data or NULL on failure.
*/
-gchar *o_save_objects (GList *object_list, gboolean save_attribs)
+gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
{
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
gchar *out;
GString *acc;
gboolean already_wrote = FALSE;
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index a4ff51d..cd7ece4 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -36,8 +36,9 @@
*/
GHashTable *unicode_char_to_glyph = NULL;
-static int f_print_get_unicode_chars (TOPLEVEL * toplevel, GList *obj_list,
- int count, gunichar * table);
+static int f_print_get_unicode_chars (TOPLEVEL * toplevel,
+ const GList *obj_list,
+ int count, gunichar * table);
static void f_print_unicode_map(FILE * fp, int count, gunichar * table);
/*! \brief Prints the line width in mils to a postscript document.
@@ -226,13 +227,13 @@ void f_print_footer(FILE *fp)
*
* \todo what happens if snap is off? hack deal with this !!!!!!!!
*/
-void f_print_objects (TOPLEVEL *toplevel, FILE *fp, GList *obj_list,
+void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
int start_x, int start_y, float scale,
int unicode_count, gunichar *unicode_table)
{
OBJECT *o_current=NULL;
int origin_x, origin_y;
- GList *iter;
+ const GList *iter;
origin_x = start_x;
origin_y = start_y;
@@ -647,14 +648,15 @@ void f_print_set_type(TOPLEVEL *toplevel, int type)
* \param [in] table The unicode table.
* \return count on success, 0 otherwise.
*/
-static int f_print_get_unicode_chars (TOPLEVEL *toplevel, GList *obj_list,
- int count, gunichar *table)
+static int f_print_get_unicode_chars (TOPLEVEL *toplevel,
+ const GList *obj_list,
+ int count, gunichar *table)
{
OBJECT *o_current = NULL;
gchar *aux;
gunichar current_char;
int i, found;
- GList *iter;
+ const GList *iter;
iter = obj_list;
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 1c576d7..0dfe3f6 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -511,7 +511,7 @@ void o_attrib_set_color(TOPLEVEL *toplevel, GList *attributes)
* \warning
* Caller must g_free returned character string.
*/
-char *o_attrib_search_name (GList *list, char *name, int counter)
+char *o_attrib_search_name (const GList *list, char *name, int counter)
{
OBJECT *o_current;
OBJECT *a_current;
@@ -521,7 +521,7 @@ char *o_attrib_search_name (GList *list, char *name, int counter)
char *found_name = NULL;
char *found_value = NULL;
char *return_string = NULL;
- GList *iter;
+ const GList *iter;
iter = list;
@@ -914,7 +914,7 @@ o_attrib_search_attrib_name(GList *list, char *name, int counter)
* \warning
* Caller must g_free returned character string.
*/
-char *o_attrib_search_toplevel (GList *list, char *name, int counter)
+char *o_attrib_search_toplevel (const GList *list, char *name, int counter)
{
OBJECT *o_current;
int val;
@@ -922,7 +922,7 @@ char *o_attrib_search_toplevel (GList *list, char *name, int counter)
char *found_name = NULL;
char *found_value = NULL;
char *return_string = NULL;
- GList *iter;
+ const GList *iter;
iter = list;
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index f7b6c46..42a8f38 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -113,10 +113,10 @@ int world_get_single_object_bounds(TOPLEVEL *toplevel, OBJECT *o_current,
* \retval 0 No bounds were found
* \retval 1 Bound was found
*/
-int world_get_object_glist_bounds(TOPLEVEL *toplevel, GList *head,
+int world_get_object_glist_bounds(TOPLEVEL *toplevel, const GList *head,
int *left, int *top, int *right, int *bottom)
{
- GList *s_current=NULL;
+ const GList *s_current=NULL;
OBJECT *o_current=NULL;
int rleft, rtop, rright, rbottom;
int found = 0;
@@ -247,11 +247,12 @@ int o_complex_is_embedded(OBJECT *o_current)
* \param [in] obj_list The object list to search for attributes
* \returns A GList of attribute OBJECTs
*/
-GList *o_complex_get_toplevel_attribs (TOPLEVEL *toplevel, GList *obj_list)
+GList *o_complex_get_toplevel_attribs (TOPLEVEL *toplevel,
+ const GList *obj_list)
{
OBJECT *o_current;
GList *attr_list = NULL;
- GList *iter;
+ const GList *iter;
for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
o_current = iter->data;
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index 1dc2048..9f28a72 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -146,10 +146,11 @@ OBJECT *o_object_copy (TOPLEVEL *toplevel,
* \return the dest_list GList with objects appended to it.
*/
GList *o_glist_copy_all (TOPLEVEL *toplevel,
- GList *src_list,
+ const GList *src_list,
GList *dest_list, int flag)
{
- GList *src, *dest;
+ const GList *src;
+ GList *dest;
OBJECT *src_object, *dst_object;
int adding_sel_save;
int selected_save;
@@ -238,9 +239,9 @@ GList *o_glist_copy_all (TOPLEVEL *toplevel,
* \brief
* \par Function Description
*/
-void o_glist_translate_world(TOPLEVEL *toplevel, int dx, int dy, GList *list)
+void o_glist_translate_world(TOPLEVEL *toplevel, int dx, int dy, const GList *list)
{
- GList *iter = list;
+ const GList *iter = list;
OBJECT *o_current;
while ( iter != NULL ) {
@@ -255,9 +256,9 @@ void o_glist_translate_world(TOPLEVEL *toplevel, int dx, int dy, GList *list)
* \brief
* \par Function Description
*/
-void o_glist_rotate_world (TOPLEVEL *toplevel, int x, int y, int angle, GList *list)
+void o_glist_rotate_world (TOPLEVEL *toplevel, int x, int y, int angle, const GList *list)
{
- GList *iter = list;
+ const GList *iter = list;
OBJECT *o_current;
while ( iter != NULL ) {
@@ -272,9 +273,9 @@ void o_glist_rotate_world (TOPLEVEL *toplevel, int x, int y, int angle, GList *l
* \brief
* \par Function Description
*/
-void o_glist_mirror_world (TOPLEVEL *toplevel, int x, int y, GList *list)
+void o_glist_mirror_world (TOPLEVEL *toplevel, int x, int y, const GList *list)
{
- GList *iter = list;
+ const GList *iter = list;
OBJECT *o_current;
while ( iter != NULL ) {
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index f01b0b5..17bf9ba 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -607,7 +607,7 @@ int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
void o_net_consolidate(TOPLEVEL *toplevel)
{
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
int status = 0;
iter = toplevel->page_current->object_list;
diff --git a/libgeda/src/s_cue.c b/libgeda/src/s_cue.c
index c2a7511..aa8888e 100644
--- a/libgeda/src/s_cue.c
+++ b/libgeda/src/s_cue.c
@@ -83,11 +83,11 @@ void s_cue_postscript_fillcircle(TOPLEVEL * toplevel, FILE * fp,
* \par Function Description
*
*/
-void s_cue_output_all (TOPLEVEL * toplevel, GList *obj_list, FILE * fp,
+void s_cue_output_all (TOPLEVEL * toplevel, const GList *obj_list, FILE * fp,
int type)
{
OBJECT *o_current;
- GList *iter;
+ const GList *iter;
iter = obj_list;
while (iter != NULL) {
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 17b18c1..80cf178 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -212,7 +212,7 @@ GList *s_hierarchy_traversepages(TOPLEVEL *toplevel,
char *filename = NULL;
gint page_control = 0;
static GList *pages = NULL;
- GList *iter;
+ const GList *iter;
/* init static variables the first time*/
if (!(flags & HIERARCHY_INNERLOOP)) {
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs