diff --git a/src/gnome/window-autoclear.c b/src/gnome/window-autoclear.c index ea7cb2c15c..96a9bb3518 100644 --- a/src/gnome/window-autoclear.c +++ b/src/gnome/window-autoclear.c @@ -104,7 +104,7 @@ ght_gnc_numeric_hash(gconstpointer v1) { gnc_numeric n1 = *(gnc_numeric *)v1; gdouble d1 = gnc_numeric_to_double(n1); - return g_double_hash(&d1); + return g_str_hash(&d1); } static void @@ -160,14 +160,15 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget, gnc_numeric split_value = xaccSplitGetAmount(split); GHashTableIter iter; - gnc_numeric *key; + gnc_numeric *key = NULL; + gpointer pkey = (gpointer)key; GList *reachable_list = 0, *node; printf(" Split value: %s\n", gnc_numeric_to_string(split_value)); /* For each value in the sack */ g_hash_table_iter_init (&iter, sack); - while (g_hash_table_iter_next (&iter, (gpointer *)&key, NULL)) + while (g_hash_table_iter_next (&iter, &pkey, NULL)) { /* Compute a new reachable value */ gnc_numeric reachable_value = gnc_numeric_add_fixed(*key, split_value); @@ -203,10 +204,11 @@ gnc_autoclear_window_ok_cb (GtkWidget *widget, printf("Rebuilding solution ...\n"); while (!gnc_numeric_zero_p(toclear_value)) { - Split *split; + Split *split = NULL; + gpointer psplit = (gpointer)split; printf(" Left to clear: %s\n", gnc_numeric_to_string(toclear_value)); - if (g_hash_table_lookup_extended(sack, &toclear_value, NULL, (gpointer *)&split)) + if (g_hash_table_lookup_extended(sack, &toclear_value, NULL, &psplit)) { if (split != NULL) { diff --git a/src/report/standard-reports/standard-reports.scm b/src/report/standard-reports/standard-reports.scm index bbf3efc92c..60156a0c63 100644 --- a/src/report/standard-reports/standard-reports.scm +++ b/src/report/standard-reports/standard-reports.scm @@ -66,6 +66,7 @@ (begin (gnc:debug "get-non-split...") (get-non-split type-info))) #f))) + ;; Returns a list of files in a directory ;; ;; Param: @@ -73,6 +74,7 @@ ;; ;; Return value: ;; list of files in the directory + (define (directory-files dir) (let ((dir-stream (opendir dir))) (let loop ((new (readdir dir-stream))