gnucash maint: Fix a missed g_value_dup_string and some no longer used variables.

John Ralls jralls at code.gnucash.org
Mon Feb 27 19:30:41 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/7f0353ad (commit)
	from  https://github.com/Gnucash/gnucash/commit/8a7c5392 (commit)



commit 7f0353adc4b0dc73586bdf056dc5a97eda2599f9
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 27 16:09:27 2023 -0800

    Fix a missed g_value_dup_string and some no longer used variables.

diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 987706f74..1a77c4146 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -2385,7 +2385,6 @@ xaccTransGetDocLink (const Transaction *trans)
     g_return_val_if_fail (trans, NULL);
 
     GValue v = G_VALUE_INIT;
-    Transaction *t = (Transaction*) trans;
     qof_instance_get_kvp (QOF_INSTANCE (trans), &v, 1, doclink_uri_str);
     const char* doclink = G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
     g_value_unset (&v);
@@ -2399,9 +2398,8 @@ xaccTransGetNotes (const Transaction *trans)
     g_return_val_if_fail (trans, NULL);
 
     GValue v = G_VALUE_INIT;
-    Transaction *t = (Transaction*) trans;
     qof_instance_get_kvp (QOF_INSTANCE (trans), &v, 1, trans_notes_str);
-    const char *notes = G_VALUE_HOLDS_STRING (&v) ? g_value_dup_string (&v) : NULL;
+    const char *notes = G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
     g_value_unset (&v);
 
     return notes;
@@ -2412,7 +2410,6 @@ xaccTransGetIsClosingTxn (const Transaction *trans)
 {
     if (!trans) return FALSE;
 
-    Transaction* trans_nonconst = (Transaction*) trans;
     GValue v = G_VALUE_INIT;
     gboolean rv;
     qof_instance_get_kvp (QOF_INSTANCE (trans), &v, 1, trans_is_closing_str);
diff --git a/libgnucash/engine/kvp-frame.cpp b/libgnucash/engine/kvp-frame.cpp
index c21370d05..48d300b4e 100644
--- a/libgnucash/engine/kvp-frame.cpp
+++ b/libgnucash/engine/kvp-frame.cpp
@@ -238,17 +238,6 @@ int compare(const KvpFrameImpl & one, const KvpFrameImpl & two) noexcept
     return 0;
 }
 
-
-static void
-gvalue_list_from_kvp_value (KvpValue *kval, gpointer pList)
-{
-    GList **gvlist = NULL;
-    GValue *gval = gvalue_from_kvp_value (kval);
-    gvlist =  (GList**)pList;
-    if (G_VALUE_TYPE (gval))
-        *gvlist = g_list_prepend (*gvlist, gval);
-}
-
 static void
 kvp_value_list_from_gvalue (GValue *gval, gpointer pList)
 {
@@ -263,10 +252,6 @@ kvp_value_list_from_gvalue (GValue *gval, gpointer pList)
 GValue*
 gvalue_from_kvp_value (const KvpValue *kval, GValue* val)
 {
-    gnc_numeric num;
-    Time64 tm;
-    GDate gdate;
-
     if (kval == NULL) return NULL;
     if (!val)
         val = g_slice_new0 (GValue);



Summary of changes:
 libgnucash/engine/Transaction.c |  5 +----
 libgnucash/engine/kvp-frame.cpp | 15 ---------------
 2 files changed, 1 insertion(+), 19 deletions(-)



More information about the gnucash-changes mailing list