gnucash maint: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Sun Dec 21 18:47:53 EST 2014
Updated via https://github.com/Gnucash/gnucash/commit/2ceadfa3 (commit)
via https://github.com/Gnucash/gnucash/commit/02acf2b6 (commit)
via https://github.com/Gnucash/gnucash/commit/745ff9e5 (commit)
via https://github.com/Gnucash/gnucash/commit/a537ff05 (commit)
via https://github.com/Gnucash/gnucash/commit/e55e7db9 (commit)
from https://github.com/Gnucash/gnucash/commit/2ef335d9 (commit)
commit 2ceadfa3a0b9df9347a6a9759a956264fa997970
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 21 15:47:20 2014 -0800
Replace GNC_HOME/bin with gnc_path_get_bindir().
For consistency with the rest of the function.
diff --git a/src/core-utils/gnc-environment.c b/src/core-utils/gnc-environment.c
index b0f4616..51e74f4 100644
--- a/src/core-utils/gnc-environment.c
+++ b/src/core-utils/gnc-environment.c
@@ -107,17 +107,17 @@ gnc_environment_setup (void)
gsize param_count;
gint i;
gboolean got_keyfile;
- gchar *env_parm, *bin_parm;
+ gchar *env_parm;
/* Export default parameters to the environment */
env_parm = gnc_path_get_prefix();
if (!g_setenv("GNC_HOME", env_parm, FALSE))
g_warning ("Couldn't set/override environment variable GNC_HOME.");
- bin_parm = g_build_filename(env_parm, "bin", NULL);
- if (!g_setenv("GNC_BIN", bin_parm, FALSE))
+ g_free (env_parm);
+ env_parm = gnc_path_get_bindir();
+ if (!g_setenv("GNC_BIN", env_parm, FALSE))
g_warning ("Couldn't set/override environment variable GNC_BIN.");
g_free (env_parm);
- g_free (bin_parm);
env_parm = gnc_path_get_pkglibdir();
if (!g_setenv("GNC_LIB", env_parm, FALSE))
g_warning ("Couldn't set/override environment variable GNC_LIB.");
commit 02acf2b6f459bdb730f0ec0dbe44df5006033077
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 21 12:55:07 2014 -0800
Adjust #ifdef __clang__ to exclude clang versions > 6
This works only with Apple clang; the regular clang is at version 3, but
hasn't been tested for what versions emit what sort of function signatures
to logs.
diff --git a/src/engine/test/utest-Account.c b/src/engine/test/utest-Account.c
index 5d717f0..c027d8b 100644
--- a/src/engine/test/utest-Account.c
+++ b/src/engine/test/utest-Account.c
@@ -462,7 +462,7 @@ test_gnc_account_list_name_violations (Fixture *fixture, gconstpointer pData)
{
guint log_level = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
gchar *log_domain = "gnc.engine";
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "GList *gnc_account_list_name_violations(QofBook *, const gchar *)"
#else
#define _func "gnc_account_list_name_violations"
@@ -749,7 +749,7 @@ test_xaccCloneAccount (Fixture *fixture, gconstpointer pData)
Account *clone;
QofBook *book = gnc_account_get_book (fixture->acct);
guint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "Account *xaccCloneAccount(const Account *, QofBook *)"
#else
#define _func "xaccCloneAccount"
@@ -852,7 +852,7 @@ test_xaccFreeAccount (Fixture *fixture, gconstpointer pData)
{
gchar *msg1 = "[xaccFreeAccount()] instead of calling xaccFreeAccount(), please call \n"
" xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "int xaccTransGetSplitIndex(const Transaction *, const Split *)"
#else
#define _func "xaccTransGetSplitIndex"
@@ -966,7 +966,7 @@ test_xaccAccountCommitEdit (Fixture *fixture, gconstpointer pData)
{
gchar *msg1 = "[xaccFreeAccount()] instead of calling xaccFreeAccount(), please call \n"
" xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "int xaccTransGetSplitIndex(const Transaction *, const Split *)"
#else
#define _func "xaccTransGetSplitIndex"
@@ -1083,7 +1083,7 @@ test_gnc_account_insert_remove_split (Fixture *fixture, gconstpointer pData)
Split *split3 = xaccMallocSplit (book);
TestSignal sig1, sig2, sig3;
AccountPrivate *priv = fixture->func->get_private (fixture->acct);
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "gboolean gnc_account_insert_split(Account *, Split *)"
#else
#define _func "gnc_account_insert_split"
diff --git a/src/engine/test/utest-Split.c b/src/engine/test/utest-Split.c
index b1da99b..d3dcc6e 100644
--- a/src/engine/test/utest-Split.c
+++ b/src/engine/test/utest-Split.c
@@ -1269,7 +1269,7 @@ test_get_corr_account_split (Fixture *fixture, gconstpointer pData)
Account *acc1 = xaccMallocAccount (book);
Account *acc2 = xaccMallocAccount (book);
Account *acc3 = xaccMallocAccount (book);
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "gboolean get_corr_account_split(const Split *, const Split **)"
#else
#define _func "get_corr_account_split"
diff --git a/src/engine/test/utest-Transaction.c b/src/engine/test/utest-Transaction.c
index 704b667..0ef350d 100644
--- a/src/engine/test/utest-Transaction.c
+++ b/src/engine/test/utest-Transaction.c
@@ -486,7 +486,7 @@ test_xaccMallocTransaction (Fixture *fixture, gconstpointer pData)
QofBook *book = qof_book_new ();
TestSignal sig1 = test_signal_new (NULL, QOF_EVENT_CREATE,NULL);
Transaction *txn;
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "Transaction *xaccMallocTransaction(QofBook *)"
#else
#define _func "xaccMallocTransaction"
@@ -1272,7 +1272,7 @@ xaccTransGetAccountBalance (const Transaction *trans,// C: 1 Local: 0:0:0
static void
test_xaccTransGetAccountBalance (Fixture *fixture, gconstpointer pData)
{
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "gnc_numeric xaccTransGetAccountBalance(const Transaction *, const Account *)"
#else
#define _func "xaccTransGetAccountBalance"
diff --git a/src/libqof/qof/test/test-gnc-date.c b/src/libqof/qof/test/test-gnc-date.c
index d22728e..a610beb 100644
--- a/src/libqof/qof/test/test-gnc-date.c
+++ b/src/libqof/qof/test/test-gnc-date.c
@@ -69,7 +69,7 @@ test_gnc_localtime (void)
// difference between g_date_time and tm->tm_wday)
};
guint ind;
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "struct tm *gnc_localtime_r(const time64 *, struct tm *)"
#else
#define _func "gnc_localtime_r"
@@ -140,7 +140,7 @@ test_gnc_gmtime (void)
#endif
};
guint ind;
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "struct tm *gnc_gmtime(const time64 *)"
#else
#define _func "gnc_gmtime"
@@ -1718,7 +1718,7 @@ test_gnc_timespec_to_iso8601_buff (void)
gchar *end;
gchar *logdomain = "qof";
guint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "gchar *gnc_timespec_to_iso8601_buff(Timespec, char *)"
#else
#define _func "gnc_timespec_to_iso8601_buff"
diff --git a/src/libqof/qof/test/test-qofbook.c b/src/libqof/qof/test/test-qofbook.c
index 8f3f2fd..ae53b28 100644
--- a/src/libqof/qof/test/test-qofbook.c
+++ b/src/libqof/qof/test/test-qofbook.c
@@ -611,7 +611,7 @@ test_book_foreach_collection( Fixture *fixture, gconstpointer pData )
QofIdType my_type = "my_type", my_type2 = "my_type2";
guint param = (guint) g_test_rand_int();
/* GLib assertion messages which aren't filtered to make clang's output like gcc's */
-#ifdef __clang__
+#if defined(__clang__) && __clang_major__ < 6
#define _func "void qof_book_foreach_collection(const QofBook *, QofCollectionForeachCB, gpointer)"
#else
#define _func "qof_book_foreach_collection"
commit 745ff9e519a42bd43bce840d532836fa5e8aaf53
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 21 12:34:32 2014 -0800
Bug 739584 - gnucash-2.6.4 segfaults regularly on transfer .
Ensure that xferData is nulled after free and that client functions check
for the NULL.
diff --git a/src/gnome-utils/dialog-transfer.c b/src/gnome-utils/dialog-transfer.c
index ccb999d..bd1cda6 100644
--- a/src/gnome-utils/dialog-transfer.c
+++ b/src/gnome-utils/dialog-transfer.c
@@ -184,6 +184,7 @@ static gnc_numeric
gnc_xfer_dialog_compute_price (XferDialog *xferData)
{
gnc_numeric from_amt, to_amt;
+ g_return_val_if_fail (xferData != NULL, gnc_numeric_error (GNC_ERROR_ARG));
from_amt = gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(xferData->amount_edit));
to_amt = gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(xferData->to_amount_edit));
@@ -353,6 +354,7 @@ gnc_xfer_dialog_curr_acct_activate(XferDialog *xferData)
Account *from_account;
gboolean curr_active;
+ g_return_if_fail (xferData != NULL);
from_account =
gnc_transfer_dialog_get_selected_account (xferData, XFER_DIALOG_FROM);
@@ -395,6 +397,7 @@ void
price_amount_radio_toggled_cb(GtkToggleButton *togglebutton, gpointer data)
{
XferDialog *xferData = data;
+ g_return_if_fail (xferData != NULL);
gtk_widget_set_sensitive(xferData->price_edit, gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(xferData->price_radio)));
@@ -536,6 +539,7 @@ gnc_xfer_dialog_fill_tree_view(XferDialog *xferData,
AccountTreeFilterInfo *info;
GtkBuilder *builder = g_object_get_data (G_OBJECT (xferData->dialog), "builder");
+ g_return_if_fail (xferData != NULL);
use_accounting_labels = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL,
GNC_PREF_ACCOUNTING_LABELS);
@@ -620,6 +624,7 @@ static void
gnc_parse_error_dialog (XferDialog *xferData, const char *error_string)
{
const char * parse_error_string;
+ g_return_if_fail (xferData != NULL);
parse_error_string = gnc_exp_parser_error_string ();
if (parse_error_string == NULL)
@@ -777,6 +782,8 @@ gnc_xfer_description_insert_cb(GtkEditable *editable,
const gchar *match_str;
gint prefix_len, new_text_len, match_str_len;
+ g_return_if_fail (xferData != NULL);
+
if (insert_text_len <= 0)
return;
@@ -918,6 +925,7 @@ gnc_xfer_amount_update_cb(GtkWidget *widget, GdkEventFocus *event,
gpointer data)
{
XferDialog * xferData = data;
+ g_return_val_if_fail (xferData != NULL, FALSE);
gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (xferData->amount_edit));
@@ -1363,6 +1371,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
Split *from_split;
Split *to_split;
+ g_return_if_fail (xferData != NULL);
ENTER(" ");
if (response == GTK_RESPONSE_APPLY)
@@ -1695,6 +1704,7 @@ gnc_xfer_dialog_close_cb(GtkDialog *dialog, gpointer data)
g_source_remove (xferData->desc_selection_source_id);
g_free(xferData);
+ xferData = NULL;
DEBUG("xfer dialog destroyed");
}
commit a537ff052b0b61f7c776bc265d87a2139cd45687
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 21 11:13:27 2014 -0800
Fix Guile compiled path in environment.in
Compiled files go to prefix/lib/guile/2.0/ccache, which isn't the same as
where the source files are stored (prefix/share/guile/2.0), so provide a
separate variable for it. Also don't throw away the user's value of
GUILE_LOAD_COMPILED_PATH in favor of GUILE_LOAD_PATH.
diff --git a/src/bin/environment.in b/src/bin/environment.in
index 333525d..68ba017 100644
--- a/src/bin/environment.in
+++ b/src/bin/environment.in
@@ -41,11 +41,14 @@ GNC_MODULE_PATH={GNC_LIB};{GNC_MODULE_PATH}
# Prevent embedded guile from issuing deprecation warnings
GUILE_WARN_DEPRECATED=no
-# Tell Guile where to find GnuCash specific guile modules
-# GUILE_LIBS can be used to override the path to Guile's own modules
+# Tell Guile where to find GnuCash specific guile modules GUILE_LIBS
+# can be used to override the path to Guile's own modules; likewise,
+# GUILE_COMPILED_LIBS overrides the path to Guile's precompiled
+# modules.
# GUILE_LIBS=
+# GUILE_COMPILED_LIBS=
GUILE_LOAD_PATH={GNC_DATA}/scm;{GUILE_LIBS};{GUILE_LOAD_PATH}
-GUILE_LOAD_COMPILED_PATH={GNC_DATA}/scm/ccache/@-GUILE_EFFECTIVE_VERSION-@;{GUILE_LIBS};{GUILE_LOAD_PATH}
+GUILE_LOAD_COMPILED_PATH={GNC_DATA}/scm/ccache/@-GUILE_EFFECTIVE_VERSION-@;{GUILE_COMPILED_LIBS};{GUILE_LOAD_COMPILED_PATH}
# Tell Guile where to find GnuCash specific shared libraries
GNC_LIBRARY_PATH={SYS_LIB}
commit e55e7db9fd47611c2266f33939dc32715314092d
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 21 11:09:21 2014 -0800
Remove note from the top of environment.in. It's obsolete.
diff --git a/src/bin/environment.in b/src/bin/environment.in
index eef7194..333525d 100644
--- a/src/bin/environment.in
+++ b/src/bin/environment.in
@@ -1,8 +1,3 @@
- at -NOTE If you make any changes here, you should probably -@
- at -NOTE also change the equivalent sections in: -@
- at -NOTE - src/bin/gnucash-launcher.in -@
- at -NOTE - packaging/win32/gnucash.iss.in -@
- at -NOTE - packaging/win32/install.sh -@
# environment
#
# This configuration file can be used to change/add environment variables
Summary of changes:
src/bin/environment.in | 14 ++++++--------
src/core-utils/gnc-environment.c | 8 ++++----
src/engine/test/utest-Account.c | 10 +++++-----
src/engine/test/utest-Split.c | 2 +-
src/engine/test/utest-Transaction.c | 4 ++--
src/gnome-utils/dialog-transfer.c | 10 ++++++++++
src/libqof/qof/test/test-gnc-date.c | 6 +++---
src/libqof/qof/test/test-qofbook.c | 2 +-
8 files changed, 32 insertions(+), 24 deletions(-)
More information about the gnucash-changes
mailing list