Fix a bunch of GUILE_WARN_DEPRECATED warnings.

* src/gnc-module/gnc-module.scm: create (and export) a re-export macro
	  is guile doesn't already provide one.  Then re-export the symbols
	  instead of exporting them.  Fixes some deprecated guile warnings.
	* src/guile-mappings.h: convert scm_gc_{un,}protect_object() back
	  to its pre-1.6 type for earlier guiles, but upconvert to the new
	  type to fix a deprecated warning.  Note that g-wrap is still
	  outputting deprecated code.
	* lots of other files:
	  convert scm_{un,}protect_object -> scm_gc_{un,}protect_object because
	  the former is now deprecated in guile.  Fixes a bunch of
	  GUILE_WARN_DEPRECATED warnings (but probably not all of them).


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10094 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2004-06-26 14:52:12 +00:00
parent 456c1de89d
commit 154966f513
21 changed files with 176 additions and 148 deletions

View File

@ -1,3 +1,17 @@
2004-06-26 Derek Atkins <derek@ihtfp.com>
* src/gnc-module/gnc-module.scm: create (and export) a re-export macro
is guile doesn't already provide one. Then re-export the symbols
instead of exporting them. Fixes some deprecated guile warnings.
* src/guile-mappings.h: convert scm_gc_{un,}protect_object() back
to its pre-1.6 type for earlier guiles, but upconvert to the new
type to fix a deprecated warning. Note that g-wrap is still
outputting deprecated code.
* lots of other files:
convert scm_{un,}protect_object -> scm_gc_{un,}protect_object because
the former is now deprecated in guile. Fixes a bunch of
GUILE_WARN_DEPRECATED warnings (but probably not all of them).
2004-06-25 Derek Atkins <derek@ihtfp.com>
* src/engine/gnc-numeric.c: small change to the 128-bit math

View File

@ -466,10 +466,10 @@ gnc_register_gui_component_scm (const char * component_class,
g_return_val_if_fail (ci, NO_COMPONENT);
ci->refresh_handler_scm = refresh_handler;
scm_protect_object (refresh_handler);
scm_gc_protect_object (refresh_handler);
ci->close_handler_scm = close_handler;
scm_protect_object (close_handler);
scm_gc_protect_object (close_handler);
return ci->component_id;
}
@ -575,11 +575,11 @@ gnc_unregister_gui_component (gint component_id)
ci->component_class = NULL;
if (ci->refresh_handler_scm != SCM_BOOL_F)
scm_unprotect_object (ci->refresh_handler_scm);
scm_gc_unprotect_object (ci->refresh_handler_scm);
ci->refresh_handler_scm = SCM_BOOL_F;
if (ci->close_handler_scm != SCM_BOOL_F)
scm_unprotect_object (ci->close_handler_scm);
scm_gc_unprotect_object (ci->close_handler_scm);
ci->close_handler_scm = SCM_BOOL_F;
g_free (ci);

View File

@ -381,7 +381,7 @@ gnc_copy_split(Split *split, gboolean use_cut_semantics)
if(split_type == SCM_UNDEFINED) {
split_type = scm_c_eval_string("<gnc:Split*>");
/* don't really need this - types are bound globally anyway. */
if(split_type != SCM_UNDEFINED) scm_protect_object(split_type);
if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
}
arg = gw_wcp_assimilate_ptr(split, split_type);
@ -430,7 +430,7 @@ gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
if(split_type == SCM_UNDEFINED) {
split_type = scm_c_eval_string("<gnc:Split*>");
/* don't really need this - types are bound globally anyway. */
if(split_type != SCM_UNDEFINED) scm_protect_object(split_type);
if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
}
arg = gw_wcp_assimilate_ptr(split, split_type);
@ -750,7 +750,7 @@ gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
if(trans_type == SCM_UNDEFINED) {
trans_type = scm_c_eval_string("<gnc:Transaction*>");
/* don't really need this - types are bound globally anyway. */
if(trans_type != SCM_UNDEFINED) scm_protect_object(trans_type);
if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
}
arg = gw_wcp_assimilate_ptr(trans, trans_type);
@ -826,7 +826,7 @@ gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
if(trans_type == SCM_UNDEFINED) {
trans_type = scm_c_eval_string("<gnc:Transaction*>");
/* don't really need this - types are bound globally anyway. */
if(trans_type != SCM_UNDEFINED) scm_protect_object(trans_type);
if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
}
arg = gw_wcp_assimilate_ptr(trans, trans_type);

View File

@ -209,7 +209,7 @@ gnc_option_db_new(SCM guile_options)
odb = g_new0(GNCOptionDB, 1);
odb->guile_options = guile_options;
scm_protect_object(guile_options);
scm_gc_protect_object(guile_options);
odb->option_sections = NULL;
odb->options_dirty = FALSE;
@ -369,7 +369,7 @@ gnc_option_db_destroy(GNCOptionDB *odb)
{
GNCOption *option = onode->data;
scm_unprotect_object(option->guile_option);
scm_gc_unprotect_object(option->guile_option);
g_free (option);
}
@ -397,7 +397,7 @@ gnc_option_db_destroy(GNCOptionDB *odb)
option_dbs = NULL;
}
scm_unprotect_object(odb->guile_options);
scm_gc_unprotect_object(odb->guile_options);
odb->guile_options = SCM_UNDEFINED;
g_free(odb);
@ -458,13 +458,13 @@ gnc_option_db_register_change_callback(GNCOptionDB *odb,
if(void_type == SCM_UNDEFINED) {
void_type = scm_c_eval_string("<gw:void*>");
/* don't really need this - types are bound globally anyway. */
if(void_type != SCM_UNDEFINED) scm_protect_object(void_type);
if(void_type != SCM_UNDEFINED) scm_gc_protect_object(void_type);
}
if(callback_type == SCM_UNDEFINED) {
callback_type = scm_c_eval_string("<gnc:OptionChangeCallback>");
/* don't really need this - types are bound globally anyway. */
if(callback_type != SCM_UNDEFINED)
scm_protect_object(callback_type);
scm_gc_protect_object(callback_type);
}
/* Now build the args list for apply */
@ -1461,7 +1461,7 @@ gncp_option_db_register_option(GNCOptionDBHandle handle, SCM guile_option)
option->odb = odb;
/* Prevent guile from garbage collecting the option */
scm_protect_object(guile_option);
scm_gc_protect_object(guile_option);
/* Make the section structure */
section = g_new0(GNCOptionSection, 1);

View File

@ -177,7 +177,7 @@ string_to_double(const char *str, double *result)
if(!ready) {
string_to_number = scm_c_eval_string("string->number");
scm_protect_object(string_to_number);
scm_gc_protect_object(string_to_number);
ready = TRUE;
}

View File

@ -35,7 +35,7 @@ get_acct_type ()
if(account_type == SCM_UNDEFINED) {
account_type = scm_c_eval_string("<gnc:Account*>");
/* don't really need this - types are bound globally anyway. */
if(account_type != SCM_UNDEFINED) scm_protect_object(account_type);
if(account_type != SCM_UNDEFINED) scm_gc_protect_object(account_type);
}
return account_type;

View File

@ -600,13 +600,13 @@ gnc_invoice_window_printCB (GtkWidget *widget, gpointer data)
arg = gw_wcp_assimilate_ptr (invoice, scm_c_eval_string("<gnc:GncInvoice*>"));
args = scm_cons (arg, args);
/* scm_protect_object(func); */
/* scm_gc_protect_object(func); */
arg = scm_apply (func, args, SCM_EOL);
g_return_if_fail (SCM_EXACTP (arg));
report_id = scm_num2int (arg, SCM_ARG1, __FUNCTION__);
/* scm_unprotect_object(func); */
/* scm_gc_unprotect_object(func); */
if (report_id >= 0)
reportWindow (report_id);
}

View File

@ -2102,7 +2102,7 @@ gnc_scm_traversal_adapter(Transaction *t, void *data)
if(trans_type == SCM_BOOL_F) {
trans_type = scm_c_eval_string("<gnc:Transaction*>");
/* don't really need this - types are bound globally anyway. */
if(trans_type != SCM_BOOL_F) scm_protect_object(trans_type);
if(trans_type != SCM_BOOL_F) scm_gc_protect_object(trans_type);
}
scm_trans = gw_wcp_assimilate_ptr(t, trans_type);
@ -2179,7 +2179,7 @@ gnc_scm_to_gint64(SCM num)
if (bits00to15_mask == SCM_BOOL_F) {
bits00to15_mask = scm_ulong2num(0xFFFF);
scm_protect_object (bits00to15_mask);
scm_gc_protect_object (bits00to15_mask);
}
/*
@ -2231,8 +2231,8 @@ gnc_gh_gint64_p(SCM num)
tmp <<= 32;
minval = gnc_gint64_to_scm(tmp);
scm_protect_object(maxval);
scm_protect_object(minval);
scm_gc_protect_object(maxval);
scm_gc_protect_object(minval);
initialized = 1;
}
@ -2301,7 +2301,7 @@ gnc_scm_to_commodity(SCM scm)
if(commodity_type == SCM_UNDEFINED) {
commodity_type = scm_c_eval_string("<gnc:commodity*>");
/* don't really need this - types are bound globally anyway. */
if(commodity_type != SCM_UNDEFINED) scm_protect_object(commodity_type);
if(commodity_type != SCM_UNDEFINED) scm_gc_protect_object(commodity_type);
}
if(!gw_wcp_is_of_type_p(commodity_type, scm)) {
@ -2325,7 +2325,7 @@ gnc_commodity_to_scm (const gnc_commodity *commodity)
if(commodity_type == SCM_UNDEFINED) {
commodity_type = scm_c_eval_string("<gnc:commodity*>");
/* don't really need this - types are bound globally anyway. */
if(commodity_type != SCM_UNDEFINED) scm_protect_object(commodity_type);
if(commodity_type != SCM_UNDEFINED) scm_gc_protect_object(commodity_type);
}
return gw_wcp_assimilate_ptr((void *) commodity, commodity_type);
@ -2348,7 +2348,7 @@ gnc_book_to_scm (QofBook *book)
/* don't really need this - types are bound globally anyway. */
if (book_type != SCM_UNDEFINED)
scm_protect_object (book_type);
scm_gc_protect_object (book_type);
}
return gw_wcp_assimilate_ptr ((void *) book, book_type);
@ -2371,7 +2371,7 @@ qof_session_to_scm (QofSession *session)
/* don't really need this - types are bound globally anyway. */
if (session_type != SCM_UNDEFINED)
scm_protect_object (session_type);
scm_gc_protect_object (session_type);
}
return gw_wcp_assimilate_ptr ((void *) session, session_type);

View File

@ -84,10 +84,10 @@ void
gnc_session_scm_set_callback (SCM percentage_cb)
{
if (gnc_session_scm_gui_cb != SCM_BOOL_F)
scm_unprotect_object(gnc_session_scm_gui_cb);
scm_gc_unprotect_object(gnc_session_scm_gui_cb);
gnc_session_scm_gui_cb = percentage_cb;
if (gnc_session_scm_gui_cb != SCM_BOOL_F)
scm_protect_object(gnc_session_scm_gui_cb);
scm_gc_protect_object(gnc_session_scm_gui_cb);
}

View File

@ -11,12 +11,18 @@
(export gnc:module-system-init)
(if (not (defined? 're-export))
(begin
(defmacro re-export names
`(eval export names))
(export re-export)))
;; symbols from gw-gnc-module
(export gnc:module-system-refresh)
(export gnc:module-load)
(export gnc:module-load-optional)
(export gnc:module-unload)
(export gnc:module-lookup)
(re-export gnc:module-system-refresh)
(re-export gnc:module-load)
(re-export gnc:module-load-optional)
(re-export gnc:module-unload)
(re-export gnc:module-lookup)
(define (gnc:module-system-init)
(let ((lib (if (or (string=? (version) "1.3")

View File

@ -2949,11 +2949,11 @@ scm_close_cb (GNCOptionWin *win, gpointer data)
if (cbdata->close_cb != SCM_BOOL_F) {
scm_call_0 (cbdata->close_cb);
scm_unprotect_object (cbdata->close_cb);
scm_gc_unprotect_object (cbdata->close_cb);
}
if (cbdata->apply_cb != SCM_BOOL_F)
scm_unprotect_object (cbdata->apply_cb);
scm_gc_unprotect_object (cbdata->apply_cb);
g_free (cbdata);
}
@ -2972,10 +2972,10 @@ gnc_options_dialog_set_scm_callbacks (GNCOptionWin *win, SCM apply_cb,
cbdata->close_cb = close_cb;
if (apply_cb != SCM_BOOL_F)
scm_protect_object (cbdata->apply_cb);
scm_gc_protect_object (cbdata->apply_cb);
if (close_cb != SCM_BOOL_F)
scm_protect_object (cbdata->close_cb);
scm_gc_protect_object (cbdata->close_cb);
gnc_options_dialog_set_apply_cb (win, scm_apply_cb, cbdata);
gnc_options_dialog_set_close_cb (win, scm_close_cb, cbdata);

View File

@ -279,7 +279,7 @@ gnc_create_extension_info(SCM extension)
ext_info->info[0].pixmap_type = GNOME_APP_PIXMAP_NONE;
ext_info->info[1].type = GNOME_APP_UI_ENDOFINFO;
scm_protect_object(extension);
scm_gc_protect_object(extension);
/* need to append so we can run them in order */
extension_list = g_slist_append(extension_list, ext_info);
@ -294,7 +294,7 @@ cleanup_extension_info(gpointer extension_info, gpointer not_used)
ExtensionInfo *ext_info = extension_info;
if (ext_info->extension)
scm_unprotect_object(ext_info->extension);
scm_gc_unprotect_object(ext_info->extension);
g_free(ext_info->info[0].label);
g_free(ext_info->info[0].hint);

View File

@ -148,7 +148,7 @@ destroy_cb(GtkObject *object, gpointer data)
/* Make sure the callbacks aren't invoked */
progress->cancel_func = NULL;
if (progress->cancel_scm_func != SCM_UNDEFINED)
scm_unprotect_object (progress->cancel_scm_func);
scm_gc_unprotect_object (progress->cancel_scm_func);
progress->cancel_scm_func = SCM_UNDEFINED;
g_free(progress);
@ -309,12 +309,12 @@ gnc_progress_dialog_set_cancel_scm_func (GNCProgressDialog *progress,
return;
if (progress->cancel_scm_func != SCM_UNDEFINED)
scm_unprotect_object (progress->cancel_scm_func);
scm_gc_unprotect_object (progress->cancel_scm_func);
if (SCM_PROCEDUREP(cancel_scm_func))
{
progress->cancel_scm_func = cancel_scm_func;
scm_protect_object (cancel_scm_func);
scm_gc_protect_object (cancel_scm_func);
gtk_widget_show (progress->cancel_button);
}
else
@ -378,7 +378,7 @@ gnc_progress_dialog_destroy (GNCProgressDialog *progress)
/* Make sure the callbacks aren't invoked */
progress->cancel_func = NULL;
if (progress->cancel_scm_func != SCM_UNDEFINED)
scm_unprotect_object (progress->cancel_scm_func);
scm_gc_unprotect_object (progress->cancel_scm_func);
progress->cancel_scm_func = SCM_UNDEFINED;
if (!progress->finished)

View File

@ -267,7 +267,7 @@ gnc_acct_tree_view_new(GnomeMDIChild * child, gpointer user_data)
mc,
N_("Account Tree"),
N_("Name of account view"));
scm_protect_object(win->name_change_callback_id);
scm_gc_protect_object(win->name_change_callback_id);
gnc_acct_tree_window_create_menu(win, mc);
gnc_acct_tree_window_create_toolbar(win, mc);
@ -1091,9 +1091,9 @@ gnc_acct_tree_window_options_new(GNCAcctTreeWin * win) {
SCM func = scm_c_eval_string("gnc:make-new-acct-tree-window");
SCM opts_and_id = scm_call_0(func);
scm_unprotect_object(win->options);
scm_gc_unprotect_object(win->options);
win->options = SCM_CAR(opts_and_id);
scm_protect_object(win->options);
scm_gc_protect_object(win->options);
win->options_id = scm_num2int(SCM_CDR(opts_and_id), SCM_ARG1, __FUNCTION__);
}
@ -1115,7 +1115,7 @@ gnc_acct_tree_window_destroy(GNCAcctTreeWin * win) {
scm_call_1(free_tree, scm_int2num(win->options_id));
scm_unprotect_object(win->options);
scm_gc_unprotect_object(win->options);
g_free (win);
}
@ -1134,7 +1134,7 @@ gnc_acct_tree_window_new(const gchar * url) {
"Enable EURO support");
treewin->account_tree = gnc_mainwin_account_tree_new();
treewin->options = SCM_BOOL_F;
scm_protect_object(treewin->options);
scm_gc_protect_object(treewin->options);
treewin->editor_dialog = NULL;
/* get the options and the window ID */
@ -1156,9 +1156,9 @@ gnc_acct_tree_window_new(const gchar * url) {
temp = scm_call_1(find_options, scm_int2num(options_id));
if(temp != SCM_BOOL_F) {
scm_unprotect_object(treewin->options);
scm_gc_unprotect_object(treewin->options);
treewin->options = temp;
scm_protect_object(treewin->options);
scm_gc_protect_object(treewin->options);
treewin->options_id = options_id;
}
else {

View File

@ -40,6 +40,8 @@
gh_new_procedure(nm,fn,req,opt,rst)
#define scm_num2long(a,b,c) scm_num2long(a, (char *)b, c)
#define scm_num2ulong(a,b,c) scm_num2ulong(a, (char *)b, c)
#define scm_gc_project_object(x) scm_protect_object(x)
#define scm_gc_unprotect_object(x) scm_unprotect_object(x)
#if ((GNC_GUILE_MAJOR_VERSION == 1) && (GNC_GUILE_MINOR_VERSION < 4))
#define scm_make_real gh_double2scm
@ -59,6 +61,12 @@
#else
#define scm_str2symbol(a) gh_symbol2scm(a)
#endif /* Guile < 1.4 */
#else /* Guile >= 1.6 */
/* This fixes some g-wrap problems.. Once g-wrap fixes this, we can remove this */
#define scm_protect_object(x) scm_gc_protect_object(x)
#define scm_unprotect_object(x) scm_gc_unprotect_object(x)
#endif /* Guile < 1.6 */

View File

@ -259,7 +259,7 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry) {
wind->selected_name = g_strdup(scmname);
free(scmname);
scm_protect_object(wind->map_entry);
scm_gc_protect_object(wind->map_entry);
gtk_signal_connect(GTK_OBJECT(wind->treeview), "tree_select_row",
GTK_SIGNAL_FUNC(gnc_ui_qif_account_picker_select_cb),
@ -279,7 +279,7 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry) {
retval = gnome_dialog_run_and_close(GNOME_DIALOG(wind->dialog));
scm_unprotect_object(wind->map_entry);
scm_gc_unprotect_object(wind->map_entry);
g_free(wind->selected_name);
g_free(wind);

View File

@ -156,20 +156,20 @@ gnc_ui_qif_import_druid_destroy (QIFImportWindow * window)
gtk_widget_destroy(window->window);
scm_unprotect_object(window->imported_files);
scm_unprotect_object(window->selected_file);
scm_unprotect_object(window->gnc_acct_info);
scm_unprotect_object(window->cat_display_info);
scm_unprotect_object(window->cat_map_info);
scm_unprotect_object(window->memo_display_info);
scm_unprotect_object(window->memo_map_info);
scm_unprotect_object(window->acct_display_info);
scm_unprotect_object(window->acct_map_info);
scm_unprotect_object(window->stock_hash);
scm_unprotect_object(window->new_stocks);
scm_unprotect_object(window->ticker_map);
scm_unprotect_object(window->imported_account_group);
scm_unprotect_object(window->match_transactions);
scm_gc_unprotect_object(window->imported_files);
scm_gc_unprotect_object(window->selected_file);
scm_gc_unprotect_object(window->gnc_acct_info);
scm_gc_unprotect_object(window->cat_display_info);
scm_gc_unprotect_object(window->cat_map_info);
scm_gc_unprotect_object(window->memo_display_info);
scm_gc_unprotect_object(window->memo_map_info);
scm_gc_unprotect_object(window->acct_display_info);
scm_gc_unprotect_object(window->acct_map_info);
scm_gc_unprotect_object(window->stock_hash);
scm_gc_unprotect_object(window->new_stocks);
scm_gc_unprotect_object(window->ticker_map);
scm_gc_unprotect_object(window->imported_account_group);
scm_gc_unprotect_object(window->match_transactions);
g_free(window);
}
@ -479,9 +479,9 @@ gnc_ui_qif_import_load_file_next_cb(GnomeDruidPage * page,
scm_qiffile = scm_call_0(make_qif_file);
imported_files = scm_cons(scm_qiffile, imported_files);
scm_unprotect_object(wind->selected_file);
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = scm_qiffile;
scm_protect_object(wind->selected_file);
scm_gc_protect_object(wind->selected_file);
/* load the file */
load_return = scm_call_3(qif_file_load, SCM_CAR(imported_files),
@ -517,9 +517,9 @@ gnc_ui_qif_import_load_file_next_cb(GnomeDruidPage * page,
imported_files =
scm_call_2(unload_qif_file, scm_qiffile, imported_files);
scm_unprotect_object(wind->imported_files);
scm_gc_unprotect_object(wind->imported_files);
wind->imported_files = imported_files;
scm_protect_object(wind->imported_files);
scm_gc_protect_object(wind->imported_files);
return TRUE;
}
@ -590,9 +590,9 @@ gnc_ui_qif_import_load_file_next_cb(GnomeDruidPage * page,
}
}
scm_unprotect_object(wind->imported_files);
scm_gc_unprotect_object(wind->imported_files);
wind->imported_files = imported_files;
scm_protect_object(wind->imported_files);
scm_gc_protect_object(wind->imported_files);
/* turn back the cursor */
gnc_unset_busy_cursor(NULL);
@ -677,10 +677,10 @@ gnc_ui_qif_import_select_loaded_file_cb(GtkCList * list,
if(SCM_LISTP(wind->imported_files) &&
(scm_ilength(wind->imported_files) > row)) {
scm_unprotect_object(wind->selected_file);
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = scm_list_ref(wind->imported_files,
scm_int2num(row));
scm_protect_object(wind->selected_file);
scm_gc_protect_object(wind->selected_file);
}
}
@ -741,13 +741,13 @@ gnc_ui_qif_import_unload_file_cb(GtkButton * button,
imported_files =
scm_call_2(unload_qif_file, wind->selected_file, wind->imported_files);
scm_unprotect_object(wind->imported_files);
scm_gc_unprotect_object(wind->imported_files);
wind->imported_files = imported_files;
scm_protect_object(wind->imported_files);
scm_gc_protect_object(wind->imported_files);
scm_unprotect_object(wind->selected_file);
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = SCM_BOOL_F;
scm_protect_object(wind->selected_file);
scm_gc_protect_object(wind->selected_file);
update_file_page(wind);
}
@ -847,13 +847,13 @@ gnc_ui_qif_import_default_acct_back_cb(GnomeDruidPage * page,
files_list = scm_call_2(unload, wind->selected_file, wind->imported_files);
scm_unprotect_object(wind->imported_files);
scm_gc_unprotect_object(wind->imported_files);
wind->imported_files = files_list;
scm_protect_object(wind->imported_files);
scm_gc_protect_object(wind->imported_files);
scm_unprotect_object(wind->selected_file);
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = SCM_BOOL_F;
scm_protect_object(wind->selected_file);
scm_gc_protect_object(wind->selected_file);
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "load_file_page"));
@ -894,9 +894,9 @@ update_account_picker_page(QIFImportWindow * wind, SCM make_display,
map_info,
wind->gnc_acct_info);
scm_unprotect_object(*display_info);
scm_gc_unprotect_object(*display_info);
*display_info = accts_left;
scm_protect_object(*display_info);
scm_gc_protect_object(*display_info);
gtk_clist_column_titles_passive (GTK_CLIST(list));
@ -1183,14 +1183,14 @@ gnc_ui_qif_import_convert(QIFImportWindow * wind)
_("An error occurred while importing "
"QIF transactions into GnuCash. Your "
"accounts are unchanged."));
scm_unprotect_object(wind->imported_account_group);
scm_gc_unprotect_object(wind->imported_account_group);
wind->imported_account_group = SCM_BOOL_F;
scm_protect_object(wind->imported_account_group);
scm_gc_protect_object(wind->imported_account_group);
}
else {
scm_unprotect_object(wind->imported_account_group);
scm_gc_unprotect_object(wind->imported_account_group);
wind->imported_account_group = retval;
scm_protect_object(wind->imported_account_group);
scm_gc_protect_object(wind->imported_account_group);
/* now detect duplicate transactions */
gnc_set_busy_cursor(NULL, TRUE);
@ -1199,9 +1199,9 @@ gnc_ui_qif_import_convert(QIFImportWindow * wind)
wind->imported_account_group);
gnc_unset_busy_cursor(NULL);
scm_unprotect_object(wind->match_transactions);
scm_gc_unprotect_object(wind->match_transactions);
wind->match_transactions = retval;
scm_protect_object(wind->match_transactions);
scm_gc_protect_object(wind->match_transactions);
/* skip to the last page if we couldn't find duplicates
* in the new group */
@ -1278,10 +1278,10 @@ gnc_ui_qif_import_memo_next_cb(GnomeDruidPage * page,
else {
/* if we need to look at stocks, do that, otherwise import
* xtns and go to the duplicates page */
scm_unprotect_object(wind->new_stocks);
scm_gc_unprotect_object(wind->new_stocks);
wind->new_stocks = scm_call_3(update_stock, wind->stock_hash,
wind->ticker_map, wind->acct_map_info);
scm_protect_object(wind->new_stocks);
scm_gc_protect_object(wind->new_stocks);
if(wind->new_stocks != SCM_BOOL_F) {
if(wind->show_doc_pages) {
@ -1334,10 +1334,10 @@ gnc_ui_qif_import_currency_next_cb(GnomeDruidPage * page,
int show_matches;
gnc_set_busy_cursor(NULL, TRUE);
scm_unprotect_object(wind->new_stocks);
scm_gc_unprotect_object(wind->new_stocks);
wind->new_stocks = scm_call_3(update_stock, wind->stock_hash,
wind->ticker_map, wind->acct_map_info);
scm_protect_object(wind->new_stocks);
scm_gc_protect_object(wind->new_stocks);
if(wind->new_stocks != SCM_BOOL_F) {
if(wind->show_doc_pages) {
@ -2004,20 +2004,20 @@ gnc_ui_qif_import_druid_make(void) {
create_ticker_map = scm_c_eval_string("make-ticker-map");
retval->ticker_map = scm_call_0(create_ticker_map);
scm_protect_object(retval->imported_files);
scm_protect_object(retval->selected_file);
scm_protect_object(retval->gnc_acct_info);
scm_protect_object(retval->cat_display_info);
scm_protect_object(retval->cat_map_info);
scm_protect_object(retval->memo_display_info);
scm_protect_object(retval->memo_map_info);
scm_protect_object(retval->acct_display_info);
scm_protect_object(retval->acct_map_info);
scm_protect_object(retval->stock_hash);
scm_protect_object(retval->new_stocks);
scm_protect_object(retval->ticker_map);
scm_protect_object(retval->imported_account_group);
scm_protect_object(retval->match_transactions);
scm_gc_protect_object(retval->imported_files);
scm_gc_protect_object(retval->selected_file);
scm_gc_protect_object(retval->gnc_acct_info);
scm_gc_protect_object(retval->cat_display_info);
scm_gc_protect_object(retval->cat_map_info);
scm_gc_protect_object(retval->memo_display_info);
scm_gc_protect_object(retval->memo_map_info);
scm_gc_protect_object(retval->acct_display_info);
scm_gc_protect_object(retval->acct_map_info);
scm_gc_protect_object(retval->stock_hash);
scm_gc_protect_object(retval->new_stocks);
scm_gc_protect_object(retval->ticker_map);
scm_gc_protect_object(retval->imported_account_group);
scm_gc_protect_object(retval->match_transactions);
/* set a default currency for new accounts */
gnc_ui_update_commodity_picker(retval->currency_picker,

View File

@ -695,10 +695,10 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
/* unprotect the old object, if any */
if (copied_item != SCM_UNDEFINED)
scm_unprotect_object(copied_item);
scm_gc_unprotect_object(copied_item);
copied_item = new_item;
scm_protect_object(copied_item);
scm_gc_protect_object(copied_item);
copied_class = cursor_class;
}

View File

@ -81,8 +81,8 @@ gnc_column_view_set_option(GNCOptionDB * odb, char * section, char * name,
static void
gnc_column_view_edit_destroy(gnc_column_view_edit * view) {
gnc_options_dialog_destroy(view->optwin);
scm_unprotect_object(view->options);
scm_unprotect_object(view->view);
scm_gc_unprotect_object(view->options);
scm_gc_unprotect_object(view->view);
gnc_option_db_destroy(view->odb);
g_free(view);
}
@ -113,9 +113,9 @@ update_display_lists(gnc_column_view_edit * view) {
selection = SCM_UNDEFINED;
}
scm_unprotect_object(view->available_list);
scm_gc_unprotect_object(view->available_list);
view->available_list = names;
scm_protect_object(view->available_list);
scm_gc_protect_object(view->available_list);
gtk_clist_freeze(view->available);
gtk_clist_clear(view->available);
@ -144,9 +144,9 @@ update_display_lists(gnc_column_view_edit * view) {
selection = SCM_UNDEFINED;
}
scm_unprotect_object(view->contents_list);
scm_gc_unprotect_object(view->contents_list);
view->contents_list = contents;
scm_protect_object(view->contents_list);
scm_gc_protect_object(view->contents_list);
gtk_clist_freeze(view->contents);
gtk_clist_clear(view->contents);
@ -273,10 +273,10 @@ gnc_column_view_edit_options(SCM options, SCM view) {
editor,
gtk_label_new(_("Contents")));
scm_protect_object(r->options);
scm_protect_object(r->view);
scm_protect_object(r->available_list);
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->options);
scm_gc_protect_object(r->view);
scm_gc_protect_object(r->available_list);
scm_gc_protect_object(r->contents_list);
gtk_signal_connect(GTK_OBJECT(r->available), "select_row",
gnc_column_view_select_avail_cb, (gpointer)r);
@ -344,9 +344,9 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data) {
r->contents_selected = oldlength;
}
scm_unprotect_object(r->contents_list);
scm_gc_unprotect_object(r->contents_list);
r->contents_list = newlist;
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->contents_list);
gnc_column_view_set_option(r->odb, "__general", "report-list",
r->contents_list);
@ -380,9 +380,9 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data) {
r->contents_selected --;
}
scm_unprotect_object(r->contents_list);
scm_gc_unprotect_object(r->contents_list);
r->contents_list = newlist;
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->contents_list);
gnc_column_view_set_option(r->odb, "__general", "report-list",
r->contents_list);
@ -413,9 +413,9 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data) {
newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
scm_unprotect_object(r->contents_list);
scm_gc_unprotect_object(r->contents_list);
r->contents_list = newlist;
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->contents_list);
r->contents_selected = r->contents_selected - 1;
@ -448,9 +448,9 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data) {
newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
scm_unprotect_object(r->contents_list);
scm_gc_unprotect_object(r->contents_list);
r->contents_list = newlist;
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->contents_list);
r->contents_selected = r->contents_selected + 1;
@ -501,11 +501,11 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data) {
scm_int2num(gtk_spin_button_get_value_as_int
(GTK_SPIN_BUTTON(rowspin))),
SCM_BOOL_F);
scm_unprotect_object(r->contents_list);
scm_gc_unprotect_object(r->contents_list);
r->contents_list = scm_list_set_x(r->contents_list,
scm_int2num(r->contents_selected),
current);
scm_protect_object(r->contents_list);
scm_gc_protect_object(r->contents_list);
gnc_options_dialog_changed (r->optwin);
update_display_lists(r);
}

View File

@ -87,7 +87,7 @@ row_data_destroy_cb(gpointer data) {
struct ss_info * ss = data;
gnc_option_db_destroy(ss->odb);
gnc_options_dialog_destroy(ss->odialog);
scm_unprotect_object(ss->stylesheet);
scm_gc_unprotect_object(ss->stylesheet);
g_free(ss);
}
@ -113,7 +113,7 @@ gnc_style_sheet_dialog_fill(StyleSheetDialog * ss, SCM selected) {
ssinfo->odb = gnc_option_db_new(scm_options);
ssinfo->stylesheet = SCM_CAR(stylesheets);
scm_protect_object(ssinfo->stylesheet);
scm_gc_protect_object(ssinfo->stylesheet);
gtk_widget_ref(gnc_options_dialog_widget(ssinfo->odialog));
gnc_build_options_dialog_contents(ssinfo->odialog,

View File

@ -667,9 +667,9 @@ gnc_report_window_load_cb(gnc_html * html, URLType type,
}
if(win->initial_report == SCM_BOOL_F) {
scm_unprotect_object(win->initial_report);
scm_gc_unprotect_object(win->initial_report);
win->initial_report = inst_report;
scm_protect_object(win->initial_report);
scm_gc_protect_object(win->initial_report);
scm_call_2(set_needs_save, inst_report, SCM_BOOL_T);
@ -689,9 +689,9 @@ gnc_report_window_load_cb(gnc_html * html, URLType type,
}
if(win->cur_report != SCM_BOOL_F)
scm_unprotect_object(win->cur_report);
scm_gc_unprotect_object(win->cur_report);
win->cur_report = inst_report;
scm_protect_object(win->cur_report);
scm_gc_protect_object(win->cur_report);
win->cur_odb = gnc_option_db_new(scm_call_1(get_options, inst_report));
win->option_change_cb_id =
@ -791,9 +791,9 @@ gnc_report_window_new(GNCMDIChildInfo * mc)
report->edited_reports = SCM_EOL;
report->name_change_cb_id = SCM_BOOL_F;
scm_protect_object(report->cur_report);
scm_protect_object(report->initial_report);
scm_protect_object(report->edited_reports);
scm_gc_protect_object(report->cur_report);
scm_gc_protect_object(report->initial_report);
scm_gc_protect_object(report->edited_reports);
gnc_html_history_set_node_destroy_cb(gnc_html_get_history(report->html),
gnc_report_window_history_destroy_cb,
@ -958,8 +958,8 @@ gnc_report_window_destroy(gnc_report_window * win)
win->container = NULL;
win->html = NULL;
scm_unprotect_object(win->cur_report);
scm_unprotect_object(win->edited_reports);
scm_gc_unprotect_object(win->cur_report);
scm_gc_unprotect_object(win->edited_reports);
g_free(win);
}
@ -1058,7 +1058,7 @@ gnc_options_dialog_close_cb(GNCOptionWin * propertybox,
scm_call_2(set_editor, win->cur_report, SCM_BOOL_F);
gnc_option_db_destroy(win->db);
scm_unprotect_object(win->scm_options);
scm_gc_unprotect_object(win->scm_options);
gnc_options_dialog_destroy(win->win);
g_free(win);
}
@ -1097,8 +1097,8 @@ gnc_report_window_default_params_editor(SCM options, SCM report)
free(title);
}
scm_protect_object(prm->scm_options);
scm_protect_object(prm->cur_report);
scm_gc_protect_object(prm->scm_options);
scm_gc_protect_object(prm->cur_report);
gnc_build_options_dialog_contents(prm->win, prm->db);
gnc_option_db_clean(prm->db);
@ -1120,18 +1120,18 @@ void
gnc_report_window_remove_edited_report(gnc_report_window * win, SCM report)
{
SCM new_edited = scm_delete(win->edited_reports, report);
scm_unprotect_object(win->edited_reports);
scm_gc_unprotect_object(win->edited_reports);
win->edited_reports = new_edited;
scm_protect_object(win->edited_reports);
scm_gc_protect_object(win->edited_reports);
}
void
gnc_report_window_add_edited_report(gnc_report_window * win, SCM report)
{
SCM new_edited = scm_cons(report, win->edited_reports);
scm_unprotect_object(win->edited_reports);
scm_gc_unprotect_object(win->edited_reports);
win->edited_reports = new_edited;
scm_protect_object(win->edited_reports);
scm_gc_protect_object(win->edited_reports);
}
void