[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.1-20110619-233-g70536e1)
The branch, master has been updated
via 70536e15af56db31075d72bef6db37b84098d698 (commit)
via 0fc87a9d985e8bd4f98f77d5130e2515c286518c (commit)
via cd203133272f0ef39629de5229eb54fdcf3178ae (commit)
via 0f978cc519016ac1cbb56c772107e1f23c98c831 (commit)
from 326a4eca0d36eed80a33b201bcbed4942046f61c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/src/i_callbacks.c | 276 +++++++++++++++++-----------------
gschem/src/x_event.c | 18 +-
libgeda/include/libgeda/prototype.h | 2 -
libgeda/src/f_print.c | 3 +-
libgeda/src/o_complex_basic.c | 5 +-
libgeda/src/s_basic.c | 26 ----
libgeda/src/s_clib.c | 16 +-
libgeda/src/s_log.c | 2 +-
libgeda/src/s_slib.c | 9 +-
libgeda/src/scheme_object.c | 7 -
10 files changed, 163 insertions(+), 201 deletions(-)
=================
Commit Messages
=================
commit 70536e15af56db31075d72bef6db37b84098d698
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Remove redundant checks in edascm_to_object_glist().
These checks are repeated by edascm_to_object(), which
edascm_to_object_glist calls.
:100644 100644 1d9ce3f... 901c2be... M libgeda/src/scheme_object.c
commit 0fc87a9d985e8bd4f98f77d5130e2515c286518c
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Remove some exit() calls and assertions.
Try to avoid assertions in libgeda; instead, emit "critical"-level log
messages and fail gently. This patch removes a bunch of assertions
and calls to exit() from libgeda, in favour of trying to keep going
even in the face of programmer errors.
Affects-bug: lp-698851
:100644 100644 2032ddb... a8a8261... M libgeda/src/f_print.c
:100644 100644 48c79c5... 6ae71b2... M libgeda/src/o_complex_basic.c
:100644 100644 ccdee58... eb37f25... M libgeda/src/s_clib.c
:100644 100644 986180b... 51eeb99... M libgeda/src/s_log.c
:100644 100644 d38e0d5... d97a1d9... M libgeda/src/s_slib.c
commit cd203133272f0ef39629de5229eb54fdcf3178ae
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Remove error_if_called().
This silly function is no longer used (fortunately).
Affects-bug: lp-698851
:100644 100644 1f870af... 8bbeb2c... M libgeda/include/libgeda/prototype.h
:100644 100644 a183570... 476f249... M libgeda/src/s_basic.c
commit 0f978cc519016ac1cbb56c772107e1f23c98c831
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Remove exit_if_null().
Replace with g_return_if_fail(), g_return_val_if_fail(), etc. We
shouldn't exit() from a shared library anyway.
Also, this patch makes gschem *not* crash in a bunch of places where
it doesn't really make sense to just give up.
Affects-bug: lp-698851
:100644 100644 7546b00... 043ab70... M gschem/src/i_callbacks.c
:100644 100644 829d531... 54b5a71... M gschem/src/x_event.c
:100644 100644 bb69439... 1f870af... M libgeda/include/libgeda/prototype.h
:100644 100644 71eec87... a183570... M libgeda/src/s_basic.c
=========
Changes
=========
commit 70536e15af56db31075d72bef6db37b84098d698
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
scheme-api: Remove redundant checks in edascm_to_object_glist().
These checks are repeated by edascm_to_object(), which
edascm_to_object_glist calls.
diff --git a/libgeda/src/scheme_object.c b/libgeda/src/scheme_object.c
index 1d9ce3f..901c2be 100644
--- a/libgeda/src/scheme_object.c
+++ b/libgeda/src/scheme_object.c
@@ -107,13 +107,6 @@ edascm_to_object_glist (SCM objs, const char *subr)
for (lst = objs; lst != SCM_EOL; lst = SCM_CDR (lst)) {
SCM smob = SCM_CAR (lst);
- EDASCM_ASSERT_SMOB_VALID (smob);
- if (!EDASCM_OBJECTP (smob)) {
- scm_error_scm (wrong_type_arg_sym,
- scm_from_utf8_string (subr),
- scm_from_utf8_string (_("Expected a gEDA object, found ~A")),
- scm_list_1 (smob), scm_list_1 (smob));
- }
result = g_list_prepend (result, (gpointer) edascm_to_object (smob));
}
commit 0fc87a9d985e8bd4f98f77d5130e2515c286518c
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Remove some exit() calls and assertions.
Try to avoid assertions in libgeda; instead, emit "critical"-level log
messages and fail gently. This patch removes a bunch of assertions
and calls to exit() from libgeda, in favour of trying to keep going
even in the face of programmer errors.
Affects-bug: lp-698851
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 2032ddb..a8a8261 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -338,8 +338,7 @@ void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list,
break;
default:
- fprintf(stderr, "Error type!\n");
- exit(-1);
+ g_return_if_reached ();
break;
}
iter = g_list_next (iter);
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 48c79c5..6ae71b2 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -123,7 +123,10 @@ int world_get_object_glist_bounds(TOPLEVEL *toplevel, const GList *head,
/* Find the first object with bounds, and set the bounds variables, then expand as necessary */
while ( s_current != NULL ) {
o_current = (OBJECT *) s_current->data;
- g_assert (o_current != NULL);
+
+ /* Sanity check */
+ g_return_val_if_fail ((o_current != NULL), found);
+
if ( world_get_single_object_bounds( toplevel, o_current, &rleft, &rtop, &rright, &rbottom) ) {
if ( found ) {
*left = min( *left, rleft );
diff --git a/libgeda/src/s_clib.c b/libgeda/src/s_clib.c
index ccdee58..eb37f25 100644
--- a/libgeda/src/s_clib.c
+++ b/libgeda/src/s_clib.c
@@ -380,11 +380,11 @@ static gint compare_source_name (gconstpointer a, gconstpointer b)
const CLibSource *src1 = a;
const CLibSource *src2 = b;
- g_assert (src1 != NULL);
- g_assert (src2 != NULL);
+ g_return_val_if_fail ((src1 != NULL), 0);
+ g_return_val_if_fail ((src2 != NULL), 0);
- g_assert (src1->name != NULL);
- g_assert (src2->name != NULL);
+ g_return_val_if_fail ((src1->name != NULL), 0);
+ g_return_val_if_fail ((src2->name != NULL), 0);
return strcasecmp(src1->name, src2->name);
}
@@ -405,11 +405,11 @@ static gint compare_symbol_name (gconstpointer a, gconstpointer b)
const CLibSymbol *sym1 = a;
const CLibSymbol *sym2 = b;
- g_assert (sym1 != NULL);
- g_assert (sym2 != NULL);
+ g_return_val_if_fail ((sym1 != NULL), 0);
+ g_return_val_if_fail ((sym2 != NULL), 0);
- g_assert (sym1->name != NULL);
- g_assert (sym2->name != NULL);
+ g_return_val_if_fail ((sym1->name != NULL), 0);
+ g_return_val_if_fail ((sym2->name != NULL), 0);
return strcasecmp(sym1->name, sym2->name);
}
diff --git a/libgeda/src/s_log.c b/libgeda/src/s_log.c
index 986180b..51eeb99 100644
--- a/libgeda/src/s_log.c
+++ b/libgeda/src/s_log.c
@@ -258,7 +258,7 @@ static void s_log_handler (const gchar *log_domain,
if (do_logging == FALSE) {
return;
}
- g_assert (logfile_fd != -1);
+ g_return_if_fail (logfile_fd != -1);
status = write (logfile_fd, message, strlen (message));
if (status == -1) {
diff --git a/libgeda/src/s_slib.c b/libgeda/src/s_slib.c
index d38e0d5..d97a1d9 100644
--- a/libgeda/src/s_slib.c
+++ b/libgeda/src/s_slib.c
@@ -121,10 +121,7 @@ char *s_slib_search_dirs(const char *basename)
ptr = opendir(slib[i].dir_name);
- if (ptr == NULL) {
- fprintf(stderr, "Oops got a null dir_name!\n");
- exit(-1);
- }
+ g_return_val_if_fail ((ptr != NULL), NULL);
dptr = readdir(ptr);
@@ -506,9 +503,7 @@ char *s_slib_getfiles(char *directory, int flag)
whole_dir[count] = g_strdup (dptr->d_name);
count++;
} else {
- fprintf(stderr,
- "uggg. too many files in s_slib_getfiles!\n");
- exit(-1);
+ g_error ("uggg. too many files in s_slib_getfiles!\n");
}
}
commit cd203133272f0ef39629de5229eb54fdcf3178ae
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Remove error_if_called().
This silly function is no longer used (fortunately).
Affects-bug: lp-698851
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 1f870af..8bbeb2c 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -261,7 +261,6 @@ void s_attrib_init(void);
char *s_attrib_get(int counter);
/* s_basic.c */
-void error_if_called(void);
OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name);
OBJECT *s_basic_new_object(int type, char const *prefix);
void print_struct_forw(GList *list);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index a183570..476f249 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -47,18 +47,6 @@
/*! this is modified here and in o_list.c */
int global_sid=0;
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- */
-void error_if_called(void)
-{
- fprintf(stderr, "Somebody called error_if_called!\n");
- g_assert(0);
-}
-
-
/*! \brief Initialize an already-allocated object.
* \par Function Description
* Initializes the members of the OBJECT structure.
commit 0f978cc519016ac1cbb56c772107e1f23c98c831
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Remove exit_if_null().
Replace with g_return_if_fail(), g_return_val_if_fail(), etc. We
shouldn't exit() from a shared library anyway.
Also, this patch makes gschem *not* crash in a bunch of places where
it doesn't really make sense to just give up.
Affects-bug: lp-698851
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 7546b00..043ab70 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -68,7 +68,7 @@ DEFINE_I_CALLBACK(file_new)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*)data;
PAGE *page;
- exit_if_null (w_current);
+ g_return_if_fail (w_current != NULL);
/* create a new page */
page = x_window_open_page (w_current, NULL);
@@ -87,7 +87,7 @@ DEFINE_I_CALLBACK(file_new)
void i_callback_toolbar_file_new(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_file_new(data, 0, NULL);
@@ -138,7 +138,7 @@ DEFINE_I_CALLBACK(file_open)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_fileselect_open (w_current);
}
@@ -156,7 +156,7 @@ DEFINE_I_CALLBACK(file_open)
void i_callback_toolbar_file_open(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_file_open(data, 0, NULL);
@@ -171,7 +171,7 @@ DEFINE_I_CALLBACK(file_script)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
setup_script_selector(w_current);
}
@@ -188,7 +188,7 @@ DEFINE_I_CALLBACK(file_save)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/*! \todo probably there should be a flag that says whether
* page_filename is derived from untitled_name or specified by
@@ -218,7 +218,7 @@ DEFINE_I_CALLBACK(file_save)
void i_callback_toolbar_file_save(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_file_save(data, 0, NULL);
@@ -236,7 +236,7 @@ DEFINE_I_CALLBACK(file_save_all)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (s_page_save_all(w_current->toplevel)) {
i_set_state_msg(w_current, SELECT, _("Failed to Save All"));
@@ -258,7 +258,7 @@ DEFINE_I_CALLBACK(file_save_as)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_fileselect_save (w_current);
}
@@ -273,8 +273,8 @@ DEFINE_I_CALLBACK(file_print)
char *base=NULL, *filename;
char *ps_filename=NULL;
- exit_if_null(w_current);
- exit_if_null(w_current->toplevel->page_current->page_filename);
+ g_return_if_fail (w_current != NULL);
+ g_return_if_fail (w_current->toplevel->page_current->page_filename != NULL);
/* shortcut */
filename = w_current->toplevel->page_current->page_filename;
@@ -310,7 +310,7 @@ DEFINE_I_CALLBACK(file_write_png)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_image_setup(w_current);
}
@@ -329,7 +329,7 @@ DEFINE_I_CALLBACK(file_close)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
s_log_message(_("Closing Window\n"));
x_window_close(w_current);
@@ -349,7 +349,7 @@ int i_callback_close(gpointer data, guint callback_action, GtkWidget *widget)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), FALSE);
i_callback_file_close(w_current, 0, widget);
return(FALSE);
}
@@ -363,7 +363,7 @@ DEFINE_I_CALLBACK(file_quit)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_window_close_all(w_current);
}
@@ -406,7 +406,7 @@ DEFINE_I_CALLBACK(edit_undo)
void i_callback_toolbar_edit_undo(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_edit_undo(data, 0, NULL);
@@ -435,7 +435,7 @@ DEFINE_I_CALLBACK(edit_redo)
void i_callback_toolbar_edit_redo(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_edit_redo(data, 0, NULL);
@@ -470,7 +470,7 @@ DEFINE_I_CALLBACK(edit_select)
void i_callback_toolbar_edit_select(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
if (GTK_TOGGLE_BUTTON (widget)->active) {
@@ -524,7 +524,7 @@ DEFINE_I_CALLBACK(edit_copy)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_copy, _("Copy"));
if (o_select_return_first_object(w_current)) {
@@ -545,7 +545,7 @@ DEFINE_I_CALLBACK(edit_copy_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -569,7 +569,7 @@ DEFINE_I_CALLBACK(edit_mcopy)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_copy, _("Multiple Copy"));
if (o_select_return_first_object(w_current)) {
@@ -590,7 +590,7 @@ DEFINE_I_CALLBACK(edit_mcopy_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -614,7 +614,7 @@ DEFINE_I_CALLBACK(edit_move)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_move, _("Move"));
if (o_select_return_first_object(w_current)) {
@@ -635,7 +635,7 @@ DEFINE_I_CALLBACK(edit_move_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -658,7 +658,7 @@ DEFINE_I_CALLBACK(edit_delete)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_delete, _("Delete"));
@@ -683,7 +683,7 @@ DEFINE_I_CALLBACK(edit_edit)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_edit, _("Edit"));
o_edit(w_current, geda_list_get_glist( w_current->toplevel->page_current->selection_list ) );
@@ -698,7 +698,7 @@ DEFINE_I_CALLBACK(edit_pin_type)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button (w_current, i_callback_edit_pin_type, _("Edit pin type"));
@@ -717,7 +717,7 @@ DEFINE_I_CALLBACK(edit_text)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
OBJECT *object;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_text, _("Edit Text"));
object = o_select_return_first_object(w_current);
@@ -738,7 +738,7 @@ DEFINE_I_CALLBACK(edit_slot)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
OBJECT *object;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
object = o_select_return_first_object(w_current);
@@ -757,7 +757,7 @@ DEFINE_I_CALLBACK(edit_color)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_color, _("Color"));
@@ -774,7 +774,7 @@ DEFINE_I_CALLBACK(edit_rotate_90)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* If inside an appropriate action, send a button 2 released,
* so rotating will be handled by x_event.c */
@@ -811,7 +811,7 @@ DEFINE_I_CALLBACK(edit_rotate_90_hotkey)
GList *object_list;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -860,7 +860,7 @@ DEFINE_I_CALLBACK(edit_mirror)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_set_state(w_current, ENDMIRROR);
i_update_middle_button(w_current, i_callback_edit_mirror, _("Mirror"));
@@ -877,7 +877,7 @@ DEFINE_I_CALLBACK(edit_mirror_hotkey)
GList *object_list;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -907,7 +907,7 @@ DEFINE_I_CALLBACK(edit_lock)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_lock, _("Lock"));
@@ -925,7 +925,7 @@ DEFINE_I_CALLBACK(edit_unlock)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_unlock, _("Unlock"));
if (o_select_return_first_object(w_current)) {
@@ -942,7 +942,7 @@ DEFINE_I_CALLBACK(edit_translate)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current,
i_callback_edit_translate, _("Translate"));
@@ -970,7 +970,7 @@ DEFINE_I_CALLBACK(edit_invoke_macro)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
gtk_widget_show(w_current->macro_box);
gtk_widget_grab_focus(w_current->macro_entry);
@@ -987,7 +987,7 @@ DEFINE_I_CALLBACK(edit_embed)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
OBJECT *o_current;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_embed, _("Embed"));
/* anything selected ? */
@@ -1026,7 +1026,7 @@ DEFINE_I_CALLBACK(edit_unembed)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
OBJECT *o_current;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_edit_unembed, _("Unembed"));
/* anything selected ? */
@@ -1108,7 +1108,7 @@ DEFINE_I_CALLBACK(edit_show_hidden)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -1132,7 +1132,7 @@ DEFINE_I_CALLBACK(edit_find)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -1151,7 +1151,7 @@ DEFINE_I_CALLBACK(edit_hide_text)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -1170,7 +1170,7 @@ DEFINE_I_CALLBACK(edit_show_text)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -1189,7 +1189,7 @@ DEFINE_I_CALLBACK(edit_autonumber_text)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -1208,7 +1208,7 @@ DEFINE_I_CALLBACK(edit_linetype)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
line_type_dialog(w_current);
}
@@ -1222,7 +1222,7 @@ DEFINE_I_CALLBACK(edit_filltype)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
fill_type_dialog(w_current);
}
@@ -1240,7 +1240,7 @@ DEFINE_I_CALLBACK(view_redraw)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_invalidate_all (w_current);
}
@@ -1255,7 +1255,7 @@ DEFINE_I_CALLBACK(view_zoom_full)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* scroll bar stuff */
a_zoom(w_current, ZOOM_FULL, DONTCARE, 0);
@@ -1276,7 +1276,7 @@ DEFINE_I_CALLBACK(view_zoom_extents)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* scroll bar stuff */
a_zoom_extents (w_current,
@@ -1297,7 +1297,7 @@ DEFINE_I_CALLBACK(view_zoom_box)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
w_current->inside_action = 0;
@@ -1314,7 +1314,7 @@ DEFINE_I_CALLBACK(view_zoom_box_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, FALSE, &wx, &wy))
return;
@@ -1337,7 +1337,7 @@ DEFINE_I_CALLBACK(view_zoom_in)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_zoom(w_current, ZOOM_IN, MENU, 0);
@@ -1357,7 +1357,7 @@ DEFINE_I_CALLBACK(view_zoom_out)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_zoom(w_current, ZOOM_OUT, MENU, 0);
@@ -1378,7 +1378,7 @@ DEFINE_I_CALLBACK(view_zoom_in_hotkey)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_zoom(w_current, ZOOM_IN, HOTKEY, 0);
@@ -1398,7 +1398,7 @@ DEFINE_I_CALLBACK(view_zoom_out_hotkey)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_zoom(w_current, ZOOM_OUT, HOTKEY, 0);
@@ -1416,7 +1416,7 @@ DEFINE_I_CALLBACK(view_pan)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
w_current->inside_action = 0;
@@ -1434,7 +1434,7 @@ DEFINE_I_CALLBACK(view_pan_left)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_pan_mouse(w_current, w_current->keyboardpan_gain, 0);
}
@@ -1447,7 +1447,7 @@ DEFINE_I_CALLBACK(view_pan_right)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* yes, that's a negative sign there */
a_pan_mouse(w_current, -w_current->keyboardpan_gain, 0);
@@ -1461,7 +1461,7 @@ DEFINE_I_CALLBACK(view_pan_up)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
a_pan_mouse(w_current, 0, w_current->keyboardpan_gain);
}
@@ -1474,7 +1474,7 @@ DEFINE_I_CALLBACK(view_pan_down)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* yes, that's a negative sign there */
a_pan_mouse(w_current, 0, -w_current->keyboardpan_gain);
@@ -1490,7 +1490,7 @@ DEFINE_I_CALLBACK(view_pan_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, FALSE, &wx, &wy))
return;
@@ -1565,7 +1565,7 @@ DEFINE_I_CALLBACK(page_manager)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_pagesel_open (w_current);
}
@@ -1583,7 +1583,7 @@ DEFINE_I_CALLBACK(page_next)
PAGE *p_new;
GList *iter;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
iter = g_list_find( geda_list_get_glist( toplevel->pages ), p_current );
iter = g_list_next( iter );
@@ -1618,7 +1618,7 @@ DEFINE_I_CALLBACK(page_prev)
PAGE *p_new;
GList *iter;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
iter = g_list_find( geda_list_get_glist( toplevel->pages ), p_current );
iter = g_list_previous( iter );
@@ -1651,7 +1651,7 @@ DEFINE_I_CALLBACK(page_new)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*)data;
PAGE *page;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* create a new page */
page = x_window_open_page (w_current, NULL);
@@ -1668,7 +1668,7 @@ DEFINE_I_CALLBACK(page_close)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->toplevel->page_current->CHANGED) {
x_dialog_close_changed_page (w_current, w_current->toplevel->page_current);
@@ -1694,7 +1694,7 @@ DEFINE_I_CALLBACK(page_revert)
int response;
GtkWidget* dialog;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
dialog = gtk_message_dialog_new ((GtkWindow*) w_current->main_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1740,7 +1740,7 @@ DEFINE_I_CALLBACK(page_discard)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*)data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_window_close_page (w_current, w_current->toplevel->page_current);
}
@@ -1766,7 +1766,7 @@ DEFINE_I_CALLBACK(clipboard_copy)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null (w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current)) return;
i_update_middle_button (w_current, i_callback_clipboard_copy,
@@ -1784,7 +1784,7 @@ DEFINE_I_CALLBACK(clipboard_cut)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null (w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current)) return;
i_update_middle_button (w_current, i_callback_clipboard_cut,
@@ -1804,7 +1804,7 @@ DEFINE_I_CALLBACK(clipboard_paste)
TOPLEVEL *toplevel = w_current->toplevel;
GList *object_list = NULL;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button (w_current, i_callback_buffer_paste1, _("Paste from clipboard"));
@@ -1834,7 +1834,7 @@ DEFINE_I_CALLBACK(clipboard_paste_hotkey)
GList *object_list = NULL;
gint wx, wy;
- exit_if_null (w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position (w_current, TRUE, &wx, &wy))
return;
@@ -1858,7 +1858,7 @@ DEFINE_I_CALLBACK(buffer_copy1)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1877,7 +1877,7 @@ DEFINE_I_CALLBACK(buffer_copy2)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1896,7 +1896,7 @@ DEFINE_I_CALLBACK(buffer_copy3)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1915,7 +1915,7 @@ DEFINE_I_CALLBACK(buffer_copy4)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1934,7 +1934,7 @@ DEFINE_I_CALLBACK(buffer_copy5)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1953,7 +1953,7 @@ DEFINE_I_CALLBACK(buffer_cut1)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1972,7 +1972,7 @@ DEFINE_I_CALLBACK(buffer_cut2)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -1991,7 +1991,7 @@ DEFINE_I_CALLBACK(buffer_cut3)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -2010,7 +2010,7 @@ DEFINE_I_CALLBACK(buffer_cut4)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -2029,7 +2029,7 @@ DEFINE_I_CALLBACK(buffer_cut5)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!o_select_selected (w_current))
return;
@@ -2048,7 +2048,7 @@ DEFINE_I_CALLBACK(buffer_paste1)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_buffer_paste1, _("Paste 1"));
if (object_buffer[0] != NULL) {
@@ -2070,7 +2070,7 @@ DEFINE_I_CALLBACK(buffer_paste2)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_buffer_paste2, _("Paste 2"));
if (object_buffer[1] != NULL) {
@@ -2092,7 +2092,7 @@ DEFINE_I_CALLBACK(buffer_paste3)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_buffer_paste3, _("Paste 3"));
if (object_buffer[2] != NULL) {
@@ -2114,7 +2114,7 @@ DEFINE_I_CALLBACK(buffer_paste4)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_buffer_paste4, _("Paste 4"));
if (object_buffer[3] != NULL) {
@@ -2136,7 +2136,7 @@ DEFINE_I_CALLBACK(buffer_paste5)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
i_update_middle_button(w_current, i_callback_buffer_paste5, _("Paste 5"));
if (object_buffer[4] != NULL) {
@@ -2159,7 +2159,7 @@ DEFINE_I_CALLBACK(buffer_paste1_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (object_buffer[0] == NULL) {
return;
@@ -2181,7 +2181,7 @@ DEFINE_I_CALLBACK(buffer_paste2_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (object_buffer[1] == NULL) {
return;
@@ -2203,7 +2203,7 @@ DEFINE_I_CALLBACK(buffer_paste3_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (object_buffer[2] == NULL) {
return;
@@ -2225,7 +2225,7 @@ DEFINE_I_CALLBACK(buffer_paste4_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (object_buffer[3] == NULL) {
return;
@@ -2247,7 +2247,7 @@ DEFINE_I_CALLBACK(buffer_paste5_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (object_buffer[4] == NULL) {
return;
@@ -2269,7 +2269,7 @@ DEFINE_I_CALLBACK(add_component)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates (w_current);
x_compselect_open (w_current);
@@ -2292,7 +2292,7 @@ DEFINE_I_CALLBACK(add_component)
void i_callback_toolbar_add_component(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_add_component(data, 0, NULL);
@@ -2307,7 +2307,7 @@ DEFINE_I_CALLBACK(add_attribute)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
attrib_edit_dialog(w_current, NULL, FROM_MENU);
i_update_middle_button(w_current, i_callback_add_attribute,
@@ -2326,7 +2326,7 @@ DEFINE_I_CALLBACK(add_attribute_hotkey)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
attrib_edit_dialog(w_current, NULL, FROM_HOTKEY);
i_update_middle_button(w_current, i_callback_add_attribute_hotkey,
@@ -2345,7 +2345,7 @@ DEFINE_I_CALLBACK(add_net)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2369,7 +2369,7 @@ DEFINE_I_CALLBACK(add_net_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2400,7 +2400,7 @@ DEFINE_I_CALLBACK(add_net_hotkey)
void i_callback_toolbar_add_net(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
if (GTK_TOGGLE_BUTTON (widget)->active) {
@@ -2417,7 +2417,7 @@ DEFINE_I_CALLBACK(add_bus)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2441,7 +2441,7 @@ DEFINE_I_CALLBACK(add_bus_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2471,7 +2471,7 @@ DEFINE_I_CALLBACK(add_bus_hotkey)
void i_callback_toolbar_add_bus(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
if (GTK_TOGGLE_BUTTON (widget)->active) {
@@ -2488,7 +2488,7 @@ DEFINE_I_CALLBACK(add_text)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2511,7 +2511,7 @@ DEFINE_I_CALLBACK(add_text)
void i_callback_toolbar_add_text(GtkWidget* widget, gpointer data)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!w_current->window) return;
i_callback_add_text(data, 0, NULL);
@@ -2526,7 +2526,7 @@ DEFINE_I_CALLBACK(add_line)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2546,7 +2546,7 @@ DEFINE_I_CALLBACK(add_line_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2571,7 +2571,7 @@ DEFINE_I_CALLBACK(add_box)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2591,7 +2591,7 @@ DEFINE_I_CALLBACK(add_box_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2616,7 +2616,7 @@ DEFINE_I_CALLBACK(add_picture)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2650,7 +2650,7 @@ DEFINE_I_CALLBACK(add_circle)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2670,7 +2670,7 @@ DEFINE_I_CALLBACK(add_circle_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2696,7 +2696,7 @@ DEFINE_I_CALLBACK(add_arc)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2716,7 +2716,7 @@ DEFINE_I_CALLBACK(add_arc_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2741,7 +2741,7 @@ DEFINE_I_CALLBACK(add_pin)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
o_redraw_cleanstates(w_current);
o_invalidate_rubber (w_current);
@@ -2761,7 +2761,7 @@ DEFINE_I_CALLBACK(add_pin_hotkey)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
gint wx, wy;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (!x_event_get_pointer_position(w_current, TRUE, &wx, &wy))
return;
@@ -2798,7 +2798,7 @@ DEFINE_I_CALLBACK(hierarchy_down_schematic)
int pcount = 0;
int looking_inside=FALSE;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
object = o_select_return_first_object(w_current);
@@ -2909,7 +2909,7 @@ DEFINE_I_CALLBACK(hierarchy_down_symbol)
OBJECT *object;
const CLibSymbol *sym;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
object = o_select_return_first_object(w_current);
if (object != NULL) {
@@ -2947,7 +2947,7 @@ DEFINE_I_CALLBACK(hierarchy_up)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
PAGE *up_page;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
up_page = s_hierarchy_find_up_page (w_current->toplevel->pages,
w_current->toplevel->page_current);
@@ -2971,7 +2971,7 @@ DEFINE_I_CALLBACK(attributes_attach)
GList *s_current;
GList *attached_objects = NULL;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3027,7 +3027,7 @@ DEFINE_I_CALLBACK(attributes_detach)
OBJECT *o_current;
GList *detached_attribs = NULL;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3071,7 +3071,7 @@ DEFINE_I_CALLBACK(attributes_show_name)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
TOPLEVEL *toplevel = w_current->toplevel;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3108,7 +3108,7 @@ DEFINE_I_CALLBACK(attributes_show_value)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
TOPLEVEL *toplevel = w_current->toplevel;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3145,7 +3145,7 @@ DEFINE_I_CALLBACK(attributes_show_both)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
TOPLEVEL *toplevel = w_current->toplevel;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3182,7 +3182,7 @@ DEFINE_I_CALLBACK(attributes_visibility_toggle)
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
TOPLEVEL *toplevel = w_current->toplevel;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
/* This is a new addition 3/15 to prevent this from executing
* inside an action */
@@ -3222,7 +3222,7 @@ DEFINE_I_CALLBACK(script_console)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
printf(_("Sorry but this is a non-functioning menu option\n"));
}
@@ -3240,7 +3240,7 @@ DEFINE_I_CALLBACK(options_text_size)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
text_size_dialog(w_current);
}
@@ -3253,7 +3253,7 @@ DEFINE_I_CALLBACK(options_snap_size)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
snap_size_dialog(w_current);
}
@@ -3266,7 +3266,7 @@ DEFINE_I_CALLBACK(options_scale_up_snap_size)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
w_current->snap_size *= 2;
w_current->toplevel->page_current->CHANGED=1; /* maybe remove those two lines */
@@ -3285,7 +3285,7 @@ DEFINE_I_CALLBACK(options_scale_down_snap_size)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->snap_size % 2 == 0)
w_current->snap_size /= 2;
@@ -3309,7 +3309,7 @@ DEFINE_I_CALLBACK(options_afeedback)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->actionfeedback_mode == BOUNDINGBOX) {
w_current->actionfeedback_mode = OUTLINE;
@@ -3332,7 +3332,7 @@ DEFINE_I_CALLBACK(options_grid)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
switch (w_current->grid) {
case GRID_NONE: w_current->grid = GRID_DOTS; break;
@@ -3432,7 +3432,7 @@ DEFINE_I_CALLBACK(options_show_log_window)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_log_open ();
}
@@ -3484,7 +3484,7 @@ DEFINE_I_CALLBACK(cancel)
TOPLEVEL *toplevel = w_current->toplevel;
GValue value = { 0, };
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->event_state == ENDCOMP &&
w_current->cswindow) {
@@ -3548,7 +3548,7 @@ DEFINE_I_CALLBACK(help_about)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
about_dialog(w_current);
}
@@ -3561,7 +3561,7 @@ DEFINE_I_CALLBACK(help_hotkeys)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
x_dialog_hotkeys(w_current);
}
@@ -3574,7 +3574,7 @@ DEFINE_I_CALLBACK(options_show_coord_window)
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
coord_dialog (w_current, 0, 0);
}
@@ -3596,7 +3596,7 @@ gboolean i_callback_close_wm ( GtkWidget *widget, GdkEvent *event,
{
GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), TRUE);
x_window_close(w_current);
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 829d531..54b5a71 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -59,7 +59,7 @@ gint x_event_expose(GtkWidget *widget, GdkEventExpose *event,
printf("EXPOSE\n");
#endif
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), 0);
save_cr = w_current->cr;
save_pl = w_current->pl;
@@ -97,11 +97,11 @@ gint x_event_button_pressed(GtkWidget *widget, GdkEventButton *event,
int w_x, w_y;
int unsnapped_wx, unsnapped_wy;
+ g_return_val_if_fail ((w_current != NULL), 0);
+
scm_dynwind_begin (0);
g_dynwind_window (w_current);
- exit_if_null(w_current);
-
#if DEBUG
printf("pressed button %d! \n", event->button);
printf("event state: %d \n", event->state);
@@ -527,7 +527,7 @@ gint x_event_button_released(GtkWidget *widget, GdkEventButton *event,
{
int unsnapped_wx, unsnapped_wy;
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), 0);
#if DEBUG
printf("released! %d \n", w_current->event_state);
@@ -734,7 +734,7 @@ gint x_event_motion(GtkWidget *widget, GdkEventMotion *event,
int do_move;
GdkEvent *test_event;
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), 0);
w_current->SHIFTKEY = (event->state & GDK_SHIFT_MASK ) ? 1 : 0;
w_current->CONTROLKEY = (event->state & GDK_CONTROL_MASK) ? 1 : 0;
@@ -1074,7 +1074,7 @@ void x_event_hschanged (GtkAdjustment *adj, GSCHEM_TOPLEVEL *w_current)
int new_left;
GtkAdjustment *hadjustment;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->scrollbars_flag == FALSE) {
return;
@@ -1106,7 +1106,7 @@ void x_event_vschanged (GtkAdjustment *adj, GSCHEM_TOPLEVEL *w_current)
int new_bottom;
GtkAdjustment *vadjustment;
- exit_if_null(w_current);
+ g_return_if_fail (w_current != NULL);
if (w_current->scrollbars_flag == FALSE) {
return;
@@ -1141,7 +1141,7 @@ void x_event_vschanged (GtkAdjustment *adj, GSCHEM_TOPLEVEL *w_current)
gint x_event_enter(GtkWidget *widget, GdkEventCrossing *event,
GSCHEM_TOPLEVEL *w_current)
{
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), 0);
/* do nothing or now */
return(0);
}
@@ -1289,7 +1289,7 @@ gint x_event_scroll (GtkWidget *widget, GdkEventScroll *event,
int pan_direction = 1;
int zoom_direction = ZOOM_IN;
- exit_if_null(w_current);
+ g_return_val_if_fail ((w_current != NULL), 0);
/* update the state of the modifiers */
w_current->SHIFTKEY = (event->state & GDK_SHIFT_MASK ) ? 1 : 0;
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index bb69439..1f870af 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -262,7 +262,6 @@ char *s_attrib_get(int counter);
/* s_basic.c */
void error_if_called(void);
-void exit_if_null(void *ptr);
OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name);
OBJECT *s_basic_new_object(int type, char const *prefix);
void print_struct_forw(GList *list);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 71eec87..a183570 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -58,20 +58,6 @@ void error_if_called(void)
g_assert(0);
}
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- */
-void exit_if_null(void *ptr)
-{
- if (ptr == NULL) {
- fprintf(stderr, "gEDA: Got NULL ptr!, please e-mail maintainer\n");
- g_assert(0);
- exit(-1);
- }
-}
-
/*! \brief Initialize an already-allocated object.
* \par Function Description
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs