gnucash maint: Fix some abs() errors from new clang and gcc versions.

John Ralls jralls at code.gnucash.org
Tue Apr 28 13:35:53 EDT 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/61021c46 (commit)
	from  https://github.com/Gnucash/gnucash/commit/405a26b6 (commit)



commit 61021c46208e4ff70b740a07c3c3258889325250
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Apr 28 09:41:05 2015 -0700

    Fix some abs() errors from new clang and gcc versions.

diff --git a/src/gnome-utils/gnc-dense-cal.c b/src/gnome-utils/gnc-dense-cal.c
index 8f2e047..70a8ec2 100644
--- a/src/gnome-utils/gnc-dense-cal.c
+++ b/src/gnome-utils/gnc-dense-cal.c
@@ -585,7 +585,7 @@ gnc_dense_cal_set_num_months(GncDenseCal *dcal, guint num_months)
             gint months_val, delta_months;
 
             gtk_tree_model_get(GTK_TREE_MODEL(options), &view_opts_iter, VIEW_OPTS_COLUMN_NUM_MONTHS, &months_val, -1);
-            delta_months = abs(months_val - num_months);
+            delta_months = abs(months_val - (int)num_months);
             if (delta_months < closest_index_distance)
             {
                 iter_closest_to_req = view_opts_iter;
diff --git a/src/import-export/import-backend.c b/src/import-export/import-backend.c
index 4e0d34e..a50cace 100644
--- a/src/import-export/import-backend.c
+++ b/src/import-export/import-backend.c
@@ -643,7 +643,7 @@ static void split_find_match (GNCImportTransInfo * trans_info,
         /* Date heuristics */
         match_time = xaccTransGetDate (xaccSplitGetParent (split));
         download_time = xaccTransGetDate (new_trans);
-        datediff_day = abs(match_time - download_time) / 86400;
+        datediff_day = llabs(match_time - download_time) / 86400;
         /* Sorry, there are not really functions around at all that
         	 provide for less hacky calculation of days of date
         	 differences. Whatever. On the other hand, the difference



Summary of changes:
 src/gnome-utils/gnc-dense-cal.c    | 2 +-
 src/import-export/import-backend.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list