gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sun Aug 2 16:58:32 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/0f9a9e3c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/161a5d60 (commit)
	from  https://github.com/Gnucash/gnucash/commit/103a053e (commit)



commit 0f9a9e3c5eeab4f378b5f2f28491d1303df77f1e
Merge: 103a053e8 161a5d60c
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Aug 2 13:56:31 2020 -0700

    Merge Hong Xu's 'potential_matches' into maint.


commit 161a5d60c0f5fc2352898d82c71141dff50a70d0
Author: Hong Xu <hong at topbug.net>
Date:   Sun Aug 2 12:14:03 2020 -0700

    Variable name correction: "import_trans_account" --> split_account
    
    I'm getting this error:
    
        /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c: In
        function ‘gnc_gen_trans_list_show_all’:
        /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c:1716:28:
        error: ‘import_trans_account’ may be used uninitialized in this
        function [-Werror=maybe-uninitialized]
                 per_account_list = g_hash_table_lookup (lists_per_accounts,
        import_trans_account);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /home/user/src/gnucash/gnucash/import-export/import-main-matcher.c:1676:14:
        note: ‘import_trans_account’ was declared here
             Account *import_trans_account;
    
    Looks like the variable name was incorrect.

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 352ed5eae..9f805d6d4 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -1673,7 +1673,6 @@ static GHashTable*
 create_list_of_potential_matches (GNCImportMainMatcher *gui, GtkTreeModel* model, Query *query, gint match_date_hardlimit)
 {
     GList* query_return = NULL;
-    Account *import_trans_account;
     time64 import_trans_time, min_time=G_MAXINT64, max_time=0;
     GList* all_accounts = NULL;
     static const int secs_per_day = 86400;
@@ -1684,6 +1683,7 @@ create_list_of_potential_matches (GNCImportMainMatcher *gui, GtkTreeModel* model
     // Go through all imported transactions, gather the list of accounts, and min/max date range.
     for (imported_trans=gui->temp_trans_list; imported_trans!=NULL; imported_trans=imported_trans->next)
     {
+        Account *import_trans_account;
         GNCImportTransInfo* transaction_info;
         transaction_info = imported_trans->data;
         import_trans_account = xaccSplitGetAccount (gnc_import_TransInfo_get_fsplit (transaction_info));
@@ -1703,7 +1703,7 @@ create_list_of_potential_matches (GNCImportMainMatcher *gui, GtkTreeModel* model
                              QOF_QUERY_AND);
     query_return = qof_query_run (query);
     g_list_free (all_accounts);
-    
+
     // Now put all potential matches into a hash table based on their account.
     for (potential_match=query_return; potential_match!=NULL; potential_match=potential_match->next)
     {
@@ -1713,10 +1713,10 @@ create_list_of_potential_matches (GNCImportMainMatcher *gui, GtkTreeModel* model
             continue;
         split_account = xaccSplitGetAccount (potential_match->data);
         // g_hash_table_steal_extended would do the two calls in one shot but is not available until 2.58
-        per_account_list = g_hash_table_lookup (lists_per_accounts, import_trans_account);
-        g_hash_table_steal (lists_per_accounts, import_trans_account);
+        per_account_list = g_hash_table_lookup (lists_per_accounts, split_account);
+        g_hash_table_steal (lists_per_accounts, split_account);
         per_account_list = g_slist_prepend (per_account_list, potential_match->data);
-        g_hash_table_insert (lists_per_accounts, import_trans_account, per_account_list);
+        g_hash_table_insert (lists_per_accounts, split_account, per_account_list);
     }
     return lists_per_accounts;
 }



Summary of changes:
 gnucash/import-export/import-main-matcher.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)



More information about the gnucash-changes mailing list