gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Mon Feb 6 14:31:22 EST 2023
Updated via https://github.com/Gnucash/gnucash/commit/464d1d23 (commit)
via https://github.com/Gnucash/gnucash/commit/bd8e81f3 (commit)
via https://github.com/Gnucash/gnucash/commit/1c667972 (commit)
via https://github.com/Gnucash/gnucash/commit/78ec2051 (commit)
via https://github.com/Gnucash/gnucash/commit/c819b03a (commit)
via https://github.com/Gnucash/gnucash/commit/ea2d3be2 (commit)
via https://github.com/Gnucash/gnucash/commit/4e25bbfc (commit)
from https://github.com/Gnucash/gnucash/commit/9446ae7f (commit)
commit 464d1d237b087f17befcf9f5f5b1a1d899fbf126
Merge: 9446ae7fb bd8e81f35
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Feb 6 11:27:16 2023 -0800
Merge Richard Cohen's 'fix-unused-variables-part1' into master.
commit bd8e81f35c86a98ac32827c6352e2927343a740d
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Mon Feb 6 12:16:07 2023 +0000
Move an unused variable into an #ifdef where it is used
diff --git a/libgnucash/core-utils/binreloc.c b/libgnucash/core-utils/binreloc.c
index 9e28cb667..2e10e0d01 100644
--- a/libgnucash/core-utils/binreloc.c
+++ b/libgnucash/core-utils/binreloc.c
@@ -106,7 +106,6 @@ _br_find_exe (Gnc_GbrInitError *error)
char *line, *result;
size_t buf_size = PATH_MAX + 1;
FILE *f;
- uint32_t size2;
#ifdef MAC_INTEGRATION
result = gtkosx_application_get_executable_path();
@@ -115,7 +114,7 @@ _br_find_exe (Gnc_GbrInitError *error)
g_print ("Application Path %s\n", path2);
#elif defined GNC_PLATFORM_OSX
/* Native Mac, but not Aqua */
- size2 = buf_size;
+ uint32_t size2 = buf_size;
if (_NSGetExecutablePath (path2, &size2) != 0)
{
/* buffer not big enough or some other error */
commit 1c6679720b5088d16a251352d4452cf413bc91c5
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Wed Jan 25 13:13:12 2023 +0000
Use some unused variables
diff --git a/gnucash/gnome/dialog-fincalc.c b/gnucash/gnome/dialog-fincalc.c
index 7db7578dc..b6477d44e 100644
--- a/gnucash/gnome/dialog-fincalc.c
+++ b/gnucash/gnome/dialog-fincalc.c
@@ -196,7 +196,10 @@ gui_to_fi (FinCalcDialog *fcd)
{
gnc_numeric out;
gboolean result = string_to_gnc_numeric (text, &out);
- npp = gnc_numeric_convert (out, 1, GNC_HOW_RND_TRUNC);
+ if (result)
+ npp = gnc_numeric_convert (out, 1, GNC_HOW_RND_TRUNC);
+ else
+ npp = gnc_numeric_zero ();
}
else
npp = gnc_numeric_zero ();
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index ef52a28a6..abc382241 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -219,7 +219,7 @@ GncDbiBackend<Type>::set_standard_connection_options (dbi_conn conn,
{
const char *msg = nullptr;
auto err = dbi_conn_error(conn, &msg);
- PERR("Error setting port option to %d: %s", uri.m_portnum, msg);
+ PERR("Error (%d) setting port option to %d: %s", err, uri.m_portnum, msg);
throw std::runtime_error(msg);
}
}
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
index e1f5e3f31..84d48f738 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
@@ -250,7 +250,6 @@ destroy_database (gchar* url)
gchar* port = NULL;
auto pgsql = "pgsql";
dbi_conn conn = NULL;
- auto errfmt = "Unable to delete tables in %s: %s";
gint fail = 0;
dbi_result tables;
StrVec tblnames;
@@ -272,7 +271,7 @@ destroy_database (gchar* url)
port = g_strdup_printf ("%d", portnum);
if (conn == NULL)
{
- g_printf (errfmt, url, "failed to create connection");
+ g_printf ("delete tables in %s: failed to create connection", url);
return;
}
fail = dbi_conn_set_option (conn, "host", host);
@@ -289,7 +288,7 @@ destroy_database (gchar* url)
g_free (port);
if (fail != 0)
{
- g_printf (errfmt, url, "failed to set an option");
+ g_printf ("delete tables in %s: failed to set an option", url);
dbi_conn_close (conn);
return;
}
@@ -298,7 +297,7 @@ destroy_database (gchar* url)
{
const gchar* error;
gint errnum = dbi_conn_error (conn, &error);
- g_printf (errfmt, url, error);
+ g_printf ("delete tables in %s: failed to connect (error %d): %s", url, errnum, error);
dbi_conn_close (conn);
return;
}
@@ -314,6 +313,7 @@ destroy_database (gchar* url)
std::string query{"DROP TABLE "};
query += table;
dbi_result rslt = dbi_conn_query (conn, query.c_str());
+ dbi_result_free(rslt);
});
}
diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp
index 7bbc92e85..b1db4769b 100644
--- a/libgnucash/engine/gnc-timezone.cpp
+++ b/libgnucash/engine/gnc-timezone.cpp
@@ -356,8 +356,8 @@ namespace IANAParser
std::ifstream ifs;
auto tzname = name;
if (tzname.empty())
- if (auto tzenv = getenv("TZ"))
- tzname = std::string(std::getenv("TZ"));
+ if (auto tzenv = std::getenv("TZ"))
+ tzname = std::string(tzenv);
//std::cout << "Testing tzname " << tzname << "\n";
if (!tzname.empty())
{
commit 78ec20515ba5d22766f81b20d88a34780201ff47
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Wed Jan 25 13:06:53 2023 +0000
Remove some unused variables - and the initialization
- checked that any side effects were irrelevant
diff --git a/bindings/guile/gnc-optiondb.i b/bindings/guile/gnc-optiondb.i
index 97b693bdc..9e8e8f471 100644
--- a/bindings/guile/gnc-optiondb.i
+++ b/bindings/guile/gnc-optiondb.i
@@ -386,8 +386,6 @@ scm_to_value<const QofInstance*>(SCM new_value)
if (new_value == SCM_BOOL_F)
return nullptr;
- auto info = SWIG_PointerType(new_value);
-
static const std::array<swig_type_info*, 10> types{
SWIGTYPE_p_QofInstance_s, SWIGTYPE_p_gnc_commodity,
SWIGTYPE_p_budget_s, SWIGTYPE_p__gncInvoice,
@@ -468,7 +466,6 @@ scm_to_value<GncOptionAccountList>(SCM new_value)
GncOptionAccountList retval{};
if (scm_is_false(scm_list_p(new_value)) || scm_is_null(new_value))
return retval;
- auto book{get_current_book()};
auto next{new_value};
while (!scm_is_null(next) && scm_car(next))
{
@@ -524,7 +521,6 @@ void gnc_option_test_book_destroy(QofBook*);
QofBook*
gnc_option_test_book_new()
{
- auto session = gnc_get_current_session();
return get_current_book();
}
@@ -896,11 +892,6 @@ wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
assert(reldate_index >= static_cast<int>(RelativeDatePeriod::ABSOLUTE) && reldate_index < static_cast<int>(relative_date_periods - 1));
return static_cast<RelativeDatePeriod>(reldate_index);
}
- const char* reldate_str;
- if (scm_is_symbol(reldate_scm))
- reldate_str = scm_to_utf8_string(scm_symbol_to_string(reldate_scm));
- else
- reldate_str = scm_to_utf8_string(reldate_scm);
auto date_iter =
std::find_if(reldate_values.begin(), reldate_values.end(),
@@ -925,7 +916,6 @@ wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
if (scm_is_symbol(scm_car(date)))
{
auto car{scm_to_utf8_string(scm_symbol_to_string(scm_car(date)))};
- auto cdr{scm_cdr(date)};
if (strcmp(car, "relative") == 0)
return false;
if (strcmp(car, "absolute") == 0)
@@ -1212,7 +1202,6 @@ inline SCM return_scm_value(ValueType value)
}
if constexpr (is_QofInstanceValue_v<decltype(option)>)
{
- auto uitype{$self->get_ui_type()};
auto serial{option.serialize()};
if (serial.empty())
return no_value;
@@ -1769,7 +1758,6 @@ gnc_register_multichoice_callback_option(GncOptionDBPtr& db,
value)}};
return retval;
}
- auto value{scm_relative_date_get_period(default_val)};
auto retval{new GncOption{GncOptionDateValue(section, name, key,
doc_string, ui_type,
period_set)}};
diff --git a/gnucash/gnome-utils/dialog-options.cpp b/gnucash/gnome-utils/dialog-options.cpp
index 35e350f01..20da225b3 100644
--- a/gnucash/gnome-utils/dialog-options.cpp
+++ b/gnucash/gnome-utils/dialog-options.cpp
@@ -323,7 +323,6 @@ GncOptionsDialog::build_contents(GncOptionDB *odb, bool show_dialog)
m_option_db = odb;
- auto num_sections = odb->num_sections();
auto default_section = odb->get_default_section();
PINFO("Default Section name is %s",
diff --git a/gnucash/gnome-utils/gnc-amount-edit.c b/gnucash/gnome-utils/gnc-amount-edit.c
index 9917925b1..eea7082dc 100644
--- a/gnucash/gnome-utils/gnc-amount-edit.c
+++ b/gnucash/gnome-utils/gnc-amount-edit.c
@@ -104,7 +104,6 @@ static void
gnc_amount_edit_class_init (GNCAmountEditClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
object_class->dispose = gnc_amount_edit_dispose;
object_class->finalize = gnc_amount_edit_finalize;
diff --git a/gnucash/gnome-utils/gnc-cell-renderer-text-flag.c b/gnucash/gnome-utils/gnc-cell-renderer-text-flag.c
index a9d0a2633..d9ef2b5a4 100644
--- a/gnucash/gnome-utils/gnc-cell-renderer-text-flag.c
+++ b/gnucash/gnome-utils/gnc-cell-renderer-text-flag.c
@@ -73,7 +73,6 @@ static void
gnc_cell_renderer_text_flag_init(GncCellRendererTextFlag *celltext)
{
GncCellRendererTextFlagPrivate *priv;
- GtkCellRendererText *cell = GTK_CELL_RENDERER_TEXT(celltext);
celltext->priv =
gnc_cell_renderer_text_flag_get_instance_private(celltext);
diff --git a/gnucash/gnome-utils/gnc-cell-view.c b/gnucash/gnome-utils/gnc-cell-view.c
index 508586a16..f81e8a217 100644
--- a/gnucash/gnome-utils/gnc-cell-view.c
+++ b/gnucash/gnome-utils/gnc-cell-view.c
@@ -93,7 +93,6 @@ static void
gnc_cell_view_class_init (GncCellViewClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
gobject_class->dispose = gnc_cell_view_dispose;
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 5d66f47c8..e2a921bdc 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -3980,7 +3980,6 @@ gnc_main_window_edit_menu_hide_cb (GtkWidget *menu,
static void
gnc_main_window_init_menu_updaters (GncMainWindow *window)
{
- GncMainWindowPrivate *priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
GtkWidget *edit_menu_item, *edit_menu;
edit_menu_item = gnc_main_window_menu_find_menu_item (window, "EditAction");
@@ -4310,7 +4309,6 @@ gnc_quartz_set_menu (GncMainWindow* window)
static gboolean
gnc_main_window_show_summarybar (GncMainWindow *window, GAction *action)
{
- GncMainWindowPrivate *priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
GVariant *state;
gboolean visible;
diff --git a/gnucash/gnome/assistant-hierarchy.cpp b/gnucash/gnome/assistant-hierarchy.cpp
index f6ce21e70..4f7807c48 100644
--- a/gnucash/gnome/assistant-hierarchy.cpp
+++ b/gnucash/gnome/assistant-hierarchy.cpp
@@ -321,7 +321,6 @@ region_combo_changed_cb (GtkComboBox *widget, hierarchy_data *data)
if (gtk_combo_box_get_active_iter (widget, &filter_iter))
{
GtkListStore *cat_list = GTK_LIST_STORE(gtk_tree_view_get_model (data->categories_tree));
- GtkTreeModel *cat_model = gtk_tree_view_get_model (data->categories_tree);
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(data->categories_tree));
GSList *list;
GtkTreePath *path;
@@ -394,7 +393,6 @@ region_combo_change_filter_cb (GtkComboBox *widget, hierarchy_data *data)
{
GtkTreeModel *sort_model = gtk_combo_box_get_model (GTK_COMBO_BOX(data->language_combo));
GtkTreeModel *language_model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT(sort_model));
- GtkListStore *cat_list = GTK_LIST_STORE(gtk_tree_view_get_model (data->categories_tree));
GtkTreeIter *iter = nullptr;
gchar *language = nullptr;
gint count = 0;
diff --git a/gnucash/gnome/dialog-price-edit-db.cpp b/gnucash/gnome/dialog-price-edit-db.cpp
index ff66d2c87..2d60fec62 100644
--- a/gnucash/gnome/dialog-price-edit-db.cpp
+++ b/gnucash/gnome/dialog-price-edit-db.cpp
@@ -451,7 +451,6 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
{
time64 last;
GDate fiscal_end_date = get_fiscal_end_date ();
- PriceRemoveSourceFlags source = PRICE_REMOVE_SOURCE_FQ;
PriceRemoveKeepOptions keep = PRICE_REMOVE_KEEP_NONE;
// disconnect the model to the price treeview
diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c
index 25a03a0c8..678cd899f 100644
--- a/gnucash/gnome/gnc-plugin-page-budget.c
+++ b/gnucash/gnome/gnc-plugin-page-budget.c
@@ -810,7 +810,6 @@ gnc_plugin_page_budget_cmd_edit_tax_options (GSimpleAction *simple,
if (gtk_tree_selection_count_selected_rows (selection) == 1)
{
GList *acc_list = gnc_budget_view_get_selected_accounts (priv->budget_view);
- GList *node = g_list_first (acc_list);
account = acc_list->data;
g_list_free (acc_list);
}
diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.c b/gnucash/gnome/gnc-plugin-page-sx-list.c
index 34d1bbc42..423cb95b5 100644
--- a/gnucash/gnome/gnc-plugin-page-sx-list.c
+++ b/gnucash/gnome/gnc-plugin-page-sx-list.c
@@ -390,9 +390,6 @@ static void
treeview_popup (GtkTreeView *treeview, GdkEvent *event, GncPluginPageSxList *page)
{
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE (page);
- GtkTreeView *tree_view = GTK_TREE_VIEW (priv->tree_view);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
- gint count_selection = gtk_tree_selection_count_selected_rows (selection);
GtkWidget *menu, *menuitem;
gchar *full_action_name;
const gchar *group_name = gnc_plugin_page_get_simple_action_group_name (GNC_PLUGIN_PAGE(page));
@@ -428,7 +425,6 @@ treeview_button_press (GtkTreeView *treeview, GdkEvent *event,
{
GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE (page);
GtkTreeView *tree_view = GTK_TREE_VIEW (priv->tree_view);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (tree_view);
if (event->type == GDK_BUTTON_PRESS)
{
diff --git a/gnucash/html/gnc-html-webkit2.c b/gnucash/html/gnc-html-webkit2.c
index 9e6cce628..683c8eec6 100644
--- a/gnucash/html/gnc-html-webkit2.c
+++ b/gnucash/html/gnc-html-webkit2.c
@@ -56,8 +56,6 @@
#include "gnc-html-webkit.h"
#include "gnc-html-history.h"
#include "print-session.h"
-#include "gnc-state.h"
-#include "print-session.h"
G_DEFINE_TYPE(GncHtmlWebkit, gnc_html_webkit, GNC_TYPE_HTML )
@@ -1127,8 +1125,7 @@ impl_webkit_print (GncHtml* self,const gchar* jobname)
gchar *export_dirname = NULL;
gchar *export_filename = NULL;
gchar* basename = NULL;
- GKeyFile *state_file = gnc_state_get_current();
-
+
g_return_if_fail (self != NULL);
g_return_if_fail (GNC_IS_HTML_WEBKIT (self));
priv = GNC_HTML_WEBKIT_GET_PRIVATE (self);
diff --git a/gnucash/import-export/test/gtest-import-account-matcher.cpp b/gnucash/import-export/test/gtest-import-account-matcher.cpp
index 1c643416e..ac1569636 100644
--- a/gnucash/import-export/test/gtest-import-account-matcher.cpp
+++ b/gnucash/import-export/test/gtest-import-account-matcher.cpp
@@ -59,8 +59,6 @@ protected:
};
auto assets = create_account(m_root, ACCT_TYPE_ASSET,
"Assets", nullptr);
- auto liabilities = create_account(m_root, ACCT_TYPE_LIABILITY,
- "Liabilities", nullptr);
auto expenses = create_account(m_root, ACCT_TYPE_EXPENSE,
"Expenses", nullptr);
create_account(assets, ACCT_TYPE_BANK, "Bank", "Bank");
diff --git a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp
index f9c165172..8a5221d19 100644
--- a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp
+++ b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp
@@ -311,7 +311,6 @@ TEST_F(GncQuotesTest, no_currency)
StrVec err_vec;
auto commtable{gnc_commodity_table_get_table(m_book)};
auto hpe{gnc_commodity_table_lookup(commtable, "NYSE", "HPE")};
- auto usd{gnc_commodity_table_lookup(commtable, "ISO4217", "USD")};
GncQuotesImpl quotes(m_book, std::make_unique<GncMockQuoteSource>(std::move(quote_vec), std::move(err_vec)));
quotes.fetch(hpe);
auto failures{quotes.failures()};
@@ -331,7 +330,6 @@ TEST_F(GncQuotesTest, bad_currency)
StrVec err_vec;
auto commtable{gnc_commodity_table_get_table(m_book)};
auto hpe{gnc_commodity_table_lookup(commtable, "NYSE", "HPE")};
- auto usd{gnc_commodity_table_lookup(commtable, "ISO4217", "USD")};
GncQuotesImpl quotes(m_book, std::make_unique<GncMockQuoteSource>(std::move(quote_vec), std::move(err_vec)));
quotes.fetch(hpe);
auto failures{quotes.failures()};
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
index d98d798d1..6acdcbb25 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
@@ -673,8 +673,6 @@ gnc_sql_load_object (const GncSqlBackend* sql_be, GncSqlRow& row,
QofIdTypeConst obj_name, gpointer pObject,
const EntryVec& table)
{
- QofSetterFunc setter;
-
g_return_if_fail (sql_be != NULL);
g_return_if_fail (pObject != NULL);
diff --git a/libgnucash/engine/Scrub.c b/libgnucash/engine/Scrub.c
index 1754409c4..f1cd86f75 100644
--- a/libgnucash/engine/Scrub.c
+++ b/libgnucash/engine/Scrub.c
@@ -490,7 +490,6 @@ get_trading_split (Transaction *trans, Account *base,
Account *ns_account;
Account *account;
Account* root = gnc_book_get_root_account (xaccTransGetBook (trans));
- gnc_commodity *root_currency = find_root_currency ();
trading_account = xaccScrubUtilityGetOrMakeAccount (root,
NULL,
diff --git a/libgnucash/engine/gnc-option-impl.cpp b/libgnucash/engine/gnc-option-impl.cpp
index 80f7c5aed..7da268f69 100644
--- a/libgnucash/engine/gnc-option-impl.cpp
+++ b/libgnucash/engine/gnc-option-impl.cpp
@@ -328,7 +328,6 @@ GncOptionAccountListValue::get_default_value() const
if (!account_list)
return retval;
- auto book{get_current_book()};
for (auto node = account_list; node; node = g_list_next (node))
{
if (std::find(m_allowed.begin(), m_allowed.end(),
diff --git a/libgnucash/engine/qofbook.cpp b/libgnucash/engine/qofbook.cpp
index ea7a14f6d..127adecc4 100644
--- a/libgnucash/engine/qofbook.cpp
+++ b/libgnucash/engine/qofbook.cpp
@@ -73,7 +73,6 @@ enum
PROP_OPT_DEFAULT_BUDGET, /* KVP */
PROP_OPT_FY_END, /* KVP */
PROP_AB_TEMPLATES, /* KVP */
- N_PROPERTIES /* Just a counter */
};
static void
@@ -93,7 +92,6 @@ G_DEFINE_TYPE(QofBook, qof_book, QOF_TYPE_INSTANCE)
QOF_GOBJECT_DISPOSE(qof_book);
QOF_GOBJECT_FINALIZE(qof_book);
-static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
#undef G_PARAM_READWRITE
#define G_PARAM_READWRITE static_cast<GParamFlags>(G_PARAM_READABLE | G_PARAM_WRITABLE)
/* ====================================================================== */
diff --git a/libgnucash/engine/test/gtest-gnc-int128.cpp b/libgnucash/engine/test/gtest-gnc-int128.cpp
index 7c215409d..23c2b2705 100644
--- a/libgnucash/engine/test/gtest-gnc-int128.cpp
+++ b/libgnucash/engine/test/gtest-gnc-int128.cpp
@@ -24,8 +24,6 @@
#include <gtest/gtest.h>
#include "../gnc-int128.hpp"
-static constexpr uint64_t UPPER_MAX{2305843009213693951};
-
TEST(GncInt128_constructors, test_default_constructor)
{
GncInt128 value {};
@@ -194,33 +192,33 @@ TEST(GncInt128_functions, test_int_functions)
});
GncInt128 value2 (UINT64_C(0), uarg);
- EXPECT_THROW (auto v = static_cast<int64_t>(value2), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value2), std::overflow_error);
EXPECT_EQ (uarg, static_cast<uint64_t>(value2));
GncInt128 value3 (UINT64_C(0), uarg, GncInt128::neg);
- EXPECT_THROW (auto v = static_cast<int64_t>(value3), std::underflow_error);
- EXPECT_THROW (auto v = static_cast<uint64_t>(value3), std::underflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value3), std::underflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value3), std::underflow_error);
GncInt128 value4 (UINT64_C(0), uarg, GncInt128::overflow);
- EXPECT_THROW (auto v = static_cast<int64_t>(value4), std::overflow_error);
- EXPECT_THROW (auto v = static_cast<uint64_t>(value4), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value4), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value4), std::overflow_error);
GncInt128 value5 (UINT64_C(0), uarg, GncInt128::NaN);
- EXPECT_THROW (auto v = static_cast<int64_t>(value5), std::overflow_error);
- EXPECT_THROW (auto v = static_cast<uint64_t>(value5), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value5), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value5), std::overflow_error);
GncInt128 value6 (INT64_C(1), arg);
- EXPECT_THROW (auto v = static_cast<int64_t>(value6), std::overflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value6), std::overflow_error);
EXPECT_EQ (arg + (UINT64_C(0x1) << 63), static_cast<uint64_t>(value6));
GncInt128 value7 (INT64_C(-1), arg);
EXPECT_EQ (-static_cast<int64_t>((UINT64_C(0x1) << 63) - arg),
static_cast<int64_t>(value7));
- EXPECT_THROW (auto v = static_cast<uint64_t>(value7), std::underflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value7), std::underflow_error);
GncInt128 value8 (INT64_C(0), narg);
EXPECT_EQ (narg, static_cast<int64_t>(value8));
- EXPECT_THROW (auto v = static_cast<uint64_t>(value8), std::underflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value8), std::underflow_error);
GncInt128 value9 (INT64_C(1), narg);
EXPECT_EQ (static_cast<int64_t>((UINT64_C(0x1) << 63) + narg),
@@ -228,8 +226,8 @@ TEST(GncInt128_functions, test_int_functions)
EXPECT_EQ ((UINT64_C(0x1) << 63) + narg, static_cast<uint64_t>(value9));
GncInt128 value10 (INT64_C(-2), arg);
- EXPECT_THROW (auto v = static_cast<int64_t>(value10), std::underflow_error);
- EXPECT_THROW (auto v = static_cast<uint64_t>(value10),
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<int64_t>(value10), std::underflow_error);
+ EXPECT_THROW (auto v GTEST_ATTRIBUTE_UNUSED_ = static_cast<uint64_t>(value10),
std::underflow_error);
}
@@ -563,7 +561,6 @@ TEST(GncInt128_functions, GCD)
int64_t barg {INT64_C(4878849681579065407)};
int64_t marg {INT64_C(4344522355275710400)};
int64_t sarg {INT64_C(267163663151677502)};
- uint64_t uarg {UINT64_C(13567894392130486208)};
GncInt128 one (INT64_C(1));
GncInt128 smallest (sarg);
@@ -596,7 +593,7 @@ TEST(GncInt128_functions, pow)
EXPECT_EQ (GncInt128(1), little.pow(0));
EXPECT_EQ (GncInt128(0), GncInt128(0).pow(123));
auto really_big = big * big;
- EXPECT_EQ (big * big, big.pow(2));
+ EXPECT_EQ (really_big, big.pow(2));
EXPECT_EQ (GncInt128(UINT64_C(66326033898754),
UINT64_C(10251549987585143605)), little.pow(7));
EXPECT_EQ (GncInt128(UINT64_C(66326033898754),
diff --git a/libgnucash/engine/test/gtest-import-map.cpp b/libgnucash/engine/test/gtest-import-map.cpp
index b91c28dda..e0938eed4 100644
--- a/libgnucash/engine/test/gtest-import-map.cpp
+++ b/libgnucash/engine/test/gtest-import-map.cpp
@@ -314,7 +314,6 @@ TEST_F(ImapBayesTest, AddAccountBayes)
TEST_F(ImapBayesTest, ConvertBayesData)
{
auto root = qof_instance_get_slots(QOF_INSTANCE(t_bank_account));
- auto book = qof_instance_get_slots(QOF_INSTANCE(gnc_account_get_book(this->t_acc)));
auto acct1_guid = guid_to_string (xaccAccountGetGUID(t_expense_account1)); //Food
auto acct2_guid = guid_to_string (xaccAccountGetGUID(t_expense_account2)); //Drink
auto acct3_guid = guid_to_string (xaccAccountGetGUID(t_asset_account2)); //Asset-Bank
diff --git a/libgnucash/engine/test/gtest-qofevent.cpp b/libgnucash/engine/test/gtest-qofevent.cpp
index a07ca27f8..3ddffdf2c 100644
--- a/libgnucash/engine/test/gtest-qofevent.cpp
+++ b/libgnucash/engine/test/gtest-qofevent.cpp
@@ -104,7 +104,6 @@ static void
compound_handler (QofInstance *ent, QofEventId event_type,
gpointer handler_data, gpointer event_data)
{
- QofInstance entity;
int *data = static_cast<int*>(handler_data);
int increment = GPOINTER_TO_INT(event_data);
diff --git a/libgnucash/engine/test/utest-Transaction.cpp b/libgnucash/engine/test/utest-Transaction.cpp
index 96640e542..d8d507634 100644
--- a/libgnucash/engine/test/utest-Transaction.cpp
+++ b/libgnucash/engine/test/utest-Transaction.cpp
@@ -747,7 +747,6 @@ static void
test_xaccTransEqual (Fixture *fixture, gconstpointer pData)
{
- QofBook *book = qof_instance_get_book (QOF_INSTANCE (fixture->txn));
QofBook *book2 = qof_book_new ();
Transaction *txn0 = fixture->txn;
Transaction *clone = xaccTransClone (txn0);
@@ -1248,7 +1247,6 @@ test_xaccTransGetAccountBalance (Fixture *fixture, gconstpointer pData)
#undef _func
auto loglevel = static_cast<GLogLevelFlags>(G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL);
auto check = test_error_struct_new ("gnc.engine", loglevel, msg1);
- auto split1 = xaccTransFindSplitByAccount(fixture->txn, fixture->acc1);
gnc_numeric rate;
fixture->hdlrs = test_log_set_fatal_handler (fixture->hdlrs, check,
@@ -1410,7 +1408,6 @@ test_do_destroy (GainsFixture *fixture, gconstpointer pData)
{
Fixture *base = &(fixture->base);
auto base_split = static_cast<Split*>(g_list_nth_data (base->txn->splits, 1));
- QofBook *book = qof_instance_get_book (base->txn);
TestSignal sig = test_signal_new (QOF_INSTANCE (base->txn),
QOF_EVENT_DESTROY, NULL);
g_object_add_weak_pointer (G_OBJECT (base->txn->splits->data),
commit c819b03a17b63b2db3e2c371382b274b61f10f2f
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Wed Jan 25 16:20:53 2023 +0000
Remove some unused variables - leave the side effect
diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c
index 3d5b836e9..97d318cb5 100644
--- a/gnucash/gnome/gnc-plugin-page-invoice.c
+++ b/gnucash/gnome/gnc-plugin-page-invoice.c
@@ -452,10 +452,10 @@ gnc_plugin_page_invoice_action_update (GncPluginPage *plugin_page,
for (gint i = 0; (action_list[i].action_name != NULL); i++)
{
- gboolean found = gnc_main_window_update_menu_for_action (window,
- action_list[i].action_name,
- _(action_list[i].label),
- _(action_list[i].tooltip));
+ gnc_main_window_update_menu_for_action (window,
+ action_list[i].action_name,
+ _(action_list[i].label),
+ _(action_list[i].tooltip));
tool_item = gnc_main_window_toolbar_find_tool_item (window,
action_list[i].action_name);
diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp
index 74d4e79e9..5135c8e35 100644
--- a/gnucash/gnome/gnc-plugin-page-report.cpp
+++ b/gnucash/gnome/gnc-plugin-page-report.cpp
@@ -1232,10 +1232,10 @@ gnc_plugin_page_report_menu_update (GncPluginPage *plugin_page,
for (gint i = 0; (tooltip_list[i].action_name != nullptr); i++)
{
- gboolean found = gnc_main_window_update_menu_for_action (window,
- tooltip_list[i].action_name,
- _(tooltip_list[i].label),
- _(tooltip_list[i].tooltip));
+ gnc_main_window_update_menu_for_action (window,
+ tooltip_list[i].action_name,
+ _(tooltip_list[i].label),
+ _(tooltip_list[i].tooltip));
tool_item = gnc_main_window_toolbar_find_tool_item (window,
tooltip_list[i].action_name);
diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp
index 961982e76..933f7ad5f 100644
--- a/libgnucash/engine/guid.cpp
+++ b/libgnucash/engine/guid.cpp
@@ -360,7 +360,7 @@ GUID::is_valid_guid (std::string const & str)
try
{
static boost::uuids::string_generator strgen;
- auto a = strgen (str);
+ strgen (str);
return true;
}
catch (...)
diff --git a/libgnucash/engine/test/test-gnc-guid.cpp b/libgnucash/engine/test/test-gnc-guid.cpp
index f5fc31b39..86baf9ea9 100644
--- a/libgnucash/engine/test/test-gnc-guid.cpp
+++ b/libgnucash/engine/test/test-gnc-guid.cpp
@@ -73,7 +73,7 @@ TEST (GncGUID, from_string)
bool fail = false;
try
{
- auto guid = gnc::GUID::from_string (bogus);
+ gnc::GUID::from_string (bogus);
}
catch (gnc::guid_syntax_exception const &)
{
diff --git a/libgnucash/engine/test/test-qofsession.cpp b/libgnucash/engine/test/test-qofsession.cpp
index 72b701df8..d292fa38b 100644
--- a/libgnucash/engine/test/test-qofsession.cpp
+++ b/libgnucash/engine/test/test-qofsession.cpp
@@ -63,7 +63,7 @@ void QofSessionMockBackend::load (QofBook *book, QofBackendLoadType)
if (load_error)
set_error(ERR_BACKEND_NO_BACKEND);
else
- auto root = gnc_account_create_root (book);
+ gnc_account_create_root (book);
data_loaded = true;
}
commit ea2d3be217d499e3d002b86b57e03a69a18b1518
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Tue Jan 24 16:23:52 2023 +0000
Remove some unused variables with obviously no side effects
diff --git a/bindings/guile/gnc-engine-guile.cpp b/bindings/guile/gnc-engine-guile.cpp
index d9f56f0ee..39f6d2db4 100644
--- a/bindings/guile/gnc-engine-guile.cpp
+++ b/bindings/guile/gnc-engine-guile.cpp
@@ -810,7 +810,6 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
{
QofQueryCompare how;
QofNumericMatch amt_sgn;
- double amount;
gnc_numeric val;
/* how */
@@ -1882,7 +1881,6 @@ scm_hook_cb (gpointer data, GncScmDangler *scm)
void
gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
{
- GHook *hook;
GncScmDangler *scm;
int num_args;
diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index ddda20dc9..489f99671 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -703,7 +703,6 @@ load( state *s, char *testfile)
while (fgets(buf, BUFSIZE, f) && (buf[0] != '.')) {
ub4 curr = 0; /* current offset into buf */
ub4 value; /* token value */
- token_type token; /* token type */
ub4 i;
test *t;
@@ -836,7 +835,7 @@ parse_w( state *s, sb1 *myarg)
ub4 dimension_number;
ub4 curr = 0;
ub4 fe_len, value;
- ub4 i, j, k;
+ ub4 i, j;
size_t len = strlen(myarg);
token_type t = parse_token(myarg, len, &curr, &value);
@@ -1186,7 +1185,6 @@ build_tuples( state *s, ub2 d, ub2 f)
feature tuple[MAX_N]; /* n-tuples that include (d,f) */
sb4 i, j, n;
ub8 count = 0;
- test *t;
tu_iter ctx;
if (s->tc[d][f] > 0 || s->n[d][f] == s->n_final) {
@@ -1282,7 +1280,6 @@ test *t, /* test being built */
ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
{
ub4 i;
- without *w; /* one of the disobeyed withouts */
ub4 count; /* number of withouts currently hit */
ub2 ndim; /* size of dimord[] */
ub2 temp;
@@ -1552,7 +1549,6 @@ cover_tuples( state *s)
/* find a good test */
for (i=0; i<GROUP_SIZE; ++i) {
- tu_iter ctx;
sb4 this_count;
/* generate a test that covers the first tuple */
diff --git a/gnucash/gnome-utils/account-quickfill.c b/gnucash/gnome-utils/account-quickfill.c
index f28e91725..24d982525 100644
--- a/gnucash/gnome-utils/account-quickfill.c
+++ b/gnucash/gnome-utils/account-quickfill.c
@@ -251,7 +251,6 @@ listen_for_account_events (QofInstance* entity, QofEventId event_type,
find_data data = { 0 };
GtkTreePath* path;
GList* tmp;
- gboolean valid;
if (0 == (event_type & (QOF_EVENT_MODIFY | QOF_EVENT_ADD | QOF_EVENT_REMOVE)))
return;
diff --git a/gnucash/gnome-utils/dialog-doclink-utils.c b/gnucash/gnome-utils/dialog-doclink-utils.c
index 038fbdeae..74531996e 100644
--- a/gnucash/gnome-utils/dialog-doclink-utils.c
+++ b/gnucash/gnome-utils/dialog-doclink-utils.c
@@ -394,7 +394,6 @@ gnc_doclink_pref_path_head_changed (GtkWindow *parent, const gchar *old_path_hea
GtkBuilder *builder;
GtkWidget *use_old_path_head, *use_new_path_head;
GtkWidget *old_head_label, *new_head_label;
- GtkWidget *old_hbox, *new_hbox;
gint result;
gchar *new_path_head_uri = gnc_doclink_get_path_head ();
diff --git a/gnucash/gnome-utils/dialog-dup-trans.c b/gnucash/gnome-utils/dialog-dup-trans.c
index 9ee515eeb..df2cdc736 100644
--- a/gnucash/gnome-utils/dialog-dup-trans.c
+++ b/gnucash/gnome-utils/dialog-dup-trans.c
@@ -118,7 +118,6 @@ gnc_dup_key_press_event_cb (GtkWidget *widget, GdkEventKey *event, gpointer user
{
GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
gint increment;
- long int num;
if ((event->state & modifiers) == GDK_CONTROL_MASK ||
(event->state & modifiers) == GDK_MOD1_MASK)
diff --git a/gnucash/gnome-utils/dialog-file-access.c b/gnucash/gnome-utils/dialog-file-access.c
index fe35e7586..7d8c85b7d 100644
--- a/gnucash/gnome-utils/dialog-file-access.c
+++ b/gnucash/gnome-utils/dialog-file-access.c
@@ -72,7 +72,6 @@ geturl( FileAccessWindow* faw )
{
gchar* url = NULL;
const gchar* host = NULL;
- const gchar* database = NULL;
const gchar* username = NULL;
const gchar* password = NULL;
/* Not const as return value of gtk_combo_box_text_get_active_text must be freed */
diff --git a/gnucash/gnome-utils/gnc-autoclear.c b/gnucash/gnome-utils/gnc-autoclear.c
index 267a16545..ccea7afaf 100644
--- a/gnucash/gnome-utils/gnc-autoclear.c
+++ b/gnucash/gnome-utils/gnc-autoclear.c
@@ -31,8 +31,6 @@
#include "qof.h"
#include "gnc-autoclear.h"
-static QofLogModule log_module = GNC_MOD_GUI;
-
/* the following functions are used in window-autoclear: */
#define MAXIMUM_SACK_SIZE 1000000
diff --git a/gnucash/gnome-utils/gnc-frequency.c b/gnucash/gnome-utils/gnc-frequency.c
index d6135e708..f427607c0 100644
--- a/gnucash/gnome-utils/gnc-frequency.c
+++ b/gnucash/gnome-utils/gnc-frequency.c
@@ -83,17 +83,6 @@ enum
PAGE_MONTHLY
};
-static const struct pageDataTuple PAGES[] =
-{
- { PAGE_NONE, UIFREQ_NONE, "None" },
- { PAGE_ONCE, UIFREQ_ONCE, "Once" },
- { PAGE_DAILY, UIFREQ_DAILY, "Daily" },
- { PAGE_WEEKLY, UIFREQ_WEEKLY, "Weekly" },
- { PAGE_SEMI_MONTHLY, UIFREQ_SEMI_MONTHLY, "Semi-Monthly" },
- { PAGE_MONTHLY, UIFREQ_MONTHLY, "Monthly" },
- { 0, 0, 0 }
-};
-
static const char *CHECKBOX_NAMES[] =
{
"wd_check_sun",
diff --git a/gnucash/gnome-utils/gnc-gtk-utils.c b/gnucash/gnome-utils/gnc-gtk-utils.c
index b9b8840d8..4aad7bea4 100644
--- a/gnucash/gnome-utils/gnc-gtk-utils.c
+++ b/gnucash/gnome-utils/gnc-gtk-utils.c
@@ -753,7 +753,6 @@ gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name,
const gchar *label, const gchar *tooltip)
{
GncMenuModelSearch *gsm;
- GtkWidget *menu_item = NULL;
gboolean found = FALSE;
g_return_val_if_fail (menu_model != NULL, FALSE);
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 96d26a0a3..5d66f47c8 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -1102,7 +1102,6 @@ gnc_main_window_all_finish_pending (void)
static gboolean
gnc_main_window_page_exists (GncPluginPage *page)
{
- GncMainWindow *window;
GncMainWindowPrivate *priv;
GList *walker;
@@ -1837,7 +1836,6 @@ gnc_main_window_update_radio_button (GncMainWindow *window)
{
GncMainWindowPrivate *priv;
GAction *action;
- GSList *action_list;
gsize index;
ENTER("window %p", window);
@@ -3409,7 +3407,6 @@ update_menu_model (GncMainWindow *window, const gchar *ui_filename,
{
GncMainWindowPrivate *priv;
GError *error = nullptr;
- const gchar *resource = GNUCASH_RESOURCE_PREFIX "/";
gchar *res_name;
GtkBuilder *builder = gtk_builder_new ();
GMenuModel *menu_model_part;
@@ -4057,10 +4054,8 @@ gnc_main_window_setup_window (GncMainWindow *window)
GtkWidget *main_vbox;
GtkBuilder *builder;
GncPluginManager *manager;
- GtkWidget *extra_item;
GList *plugins;
GError *error = nullptr;
- gchar *filename;
GAction *action;
ENTER(" ");
@@ -4797,7 +4792,6 @@ gnc_main_window_cmd_view_refresh (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindow *window = (GncMainWindow*)user_data;
}
static void
@@ -4910,7 +4904,6 @@ gnc_main_window_cmd_window_new (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
- GncMainWindow *window = (GncMainWindow*)user_data;
GncMainWindow *new_window;
/* Create the new window */
@@ -4995,7 +4988,6 @@ gnc_main_window_cmd_view_tab_position (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindow *window = (GncMainWindow*)user_data;
gint item = g_variant_get_int32 (parameter);
g_action_change_state (G_ACTION(simple), parameter);
diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c
index b54394ce2..41a7d8bf8 100644
--- a/gnucash/gnome-utils/gnc-plugin-file-history.c
+++ b/gnucash/gnome-utils/gnc-plugin-file-history.c
@@ -414,7 +414,6 @@ gnc_history_update_action (GncMainWindow *window,
const gchar *filename)
{
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
- GtkWidget *menu_item = NULL;
gchar *action_name;
gint limit;
gboolean add_item = FALSE;
diff --git a/gnucash/gnome-utils/gnc-query-view.c b/gnucash/gnome-utils/gnc-query-view.c
index e6d5879b3..88b8d21a1 100644
--- a/gnucash/gnome-utils/gnc-query-view.c
+++ b/gnucash/gnome-utils/gnc-query-view.c
@@ -593,7 +593,6 @@ gnc_query_view_get_selected_entry_list (GNCQueryView *qview)
{
GtkTreeSelection *selection;
acc_data acc_entries;
- GList *entries = NULL;
g_return_val_if_fail (qview != NULL, NULL);
g_return_val_if_fail (GNC_IS_QUERY_VIEW(qview), NULL);
diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c
index 3250e6c2f..74fd3ec52 100644
--- a/gnucash/gnome/dialog-doclink.c
+++ b/gnucash/gnome/dialog-doclink.c
@@ -635,7 +635,6 @@ row_selected_bus_cb (GtkTreeView *view, GtkTreePath *path,
if (gtk_tree_view_get_column (GTK_TREE_VIEW (doclink_dialog->view),
DESC_ID - 1) == col)
{
- GncPluginPage *page;
InvoiceWindow *iw;
iw = gnc_ui_invoice_edit (GTK_WINDOW (doclink_dialog->window),
diff --git a/gnucash/gnome/dialog-new-user.c b/gnucash/gnome/dialog-new-user.c
index b9342760b..a926f6028 100644
--- a/gnucash/gnome/dialog-new-user.c
+++ b/gnucash/gnome/dialog-new-user.c
@@ -137,10 +137,8 @@ gnc_ui_new_user_window_present (GtkWindow *window)
static void
gnc_ui_new_user_dialog_create (GNCNewUserDialog *new_user)
{
- GtkWidget *window;
GtkBuilder *builder;
GtkWidget *button;
- gint result;
ENTER(" ");
builder = gtk_builder_new();
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index cbd2dd21f..7703298d2 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -440,7 +440,6 @@ gnc_payment_window_fill_docs_list (PaymentWindow *pw)
GtkListStore *store;
GtkTreeSelection *selection;
GList *list = NULL, *node;
- GNCLot *tx_lot = NULL;
g_return_if_fail (pw->docs_list_tree_view && GTK_IS_TREE_VIEW(pw->docs_list_tree_view));
diff --git a/gnucash/gnome/dialog-report-column-view.cpp b/gnucash/gnome/dialog-report-column-view.cpp
index 12e9a31a0..6cb31baea 100644
--- a/gnucash/gnome/dialog-report-column-view.cpp
+++ b/gnucash/gnome/dialog-report-column-view.cpp
@@ -513,8 +513,6 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
GtkWidget * colspin;
GtkWidget * dlg;
GtkBuilder *builder;
- SCM current;
- int length;
int dlg_ret;
builder = gtk_builder_new();
diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c
index 610bd7da6..f360cb277 100644
--- a/gnucash/gnome/gnc-plugin-basic-commands.c
+++ b/gnucash/gnome/gnc-plugin-basic-commands.c
@@ -469,7 +469,6 @@ gnc_main_window_cmd_actions_scheduled_transaction_editor (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindowActionData *data = user_data;
GncPluginPage *page = gnc_plugin_page_sx_list_new ();
gnc_main_window_open_page (NULL, page);
}
@@ -537,7 +536,6 @@ gnc_main_window_cmd_actions_mortgage_loan (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindowActionData *data = user_data;
gnc_ui_sx_loan_assistant_create ();
}
#ifdef CLOSE_BOOKS_ACTUALLY_WORKS
diff --git a/gnucash/gnome/gnc-plugin-business.c b/gnucash/gnome/gnc-plugin-business.c
index b2196535a..ecd6e4a6a 100644
--- a/gnucash/gnome/gnc-plugin-business.c
+++ b/gnucash/gnome/gnc-plugin-business.c
@@ -701,7 +701,6 @@ gnc_plugin_business_cmd_test_search (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindowActionData *mw = user_data;
gnc_search_dialog_test();
}
diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 62a99ae4b..ed8a7b013 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -1035,7 +1035,6 @@ gnc_plugin_page_account_tree_cmd_file_new_hierarchy (GSimpleAction *simple,
GVariant *paramter,
gpointer user_data)
{
- GncPluginPageAccountTree *page = user_data;
gnc_ui_hierarchy_assistant(FALSE);
}
@@ -1506,7 +1505,6 @@ gnc_plugin_page_account_tree_cmd_delete_account (GSimpleAction *simple,
Adopters adopt;
GList* list;
gint response;
- GList *filter = NULL;
GtkWidget *dialog = NULL;
if (account == NULL)
diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c
index b26502a59..25a03a0c8 100644
--- a/gnucash/gnome/gnc-plugin-page-budget.c
+++ b/gnucash/gnome/gnc-plugin-page-budget.c
@@ -1159,7 +1159,7 @@ gnc_plugin_page_budget_cmd_allperiods_budget (GSimpleAction *simple,
GncPluginPageBudget *page = user_data;
GncPluginPageBudgetPrivate *priv;
GtkTreeSelection *sel;
- GtkWidget *dialog, *gde, *val, *dtr, *add, *mult;
+ GtkWidget *dialog, *val, *dtr, *add, *mult;
gint result;
GtkBuilder *builder;
const gchar *txt;
diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c
index 3859e7904..3d5b836e9 100644
--- a/gnucash/gnome/gnc-plugin-page-invoice.c
+++ b/gnucash/gnome/gnc-plugin-page-invoice.c
@@ -497,7 +497,6 @@ gnc_plugin_page_invoice_update_menus (GncPluginPage *page, gboolean is_posted, g
GncPluginPageInvoicePrivate *priv;
GncInvoiceType invoice_type;
GncInvoice *invoice;
- gint i, j;
action_toolbar_labels *label_list;
action_toolbar_labels *label_layout_list;
gboolean has_uri = FALSE;
@@ -1049,7 +1048,6 @@ gnc_plugin_page_invoice_cmd_sort_changed (GSimpleAction *simple,
gpointer user_data)
{
GncPluginPageInvoicePrivate *priv;
- invoice_sort_type_t value;
GncPluginPageInvoice *plugin_page = user_data;
gint item;
@@ -1218,7 +1216,6 @@ gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple,
{
GncPluginPageInvoice *plugin_page = user_data;
GncPluginPageInvoicePrivate *priv;
- GtkWindow *parent;
GAction *layout_action;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
@@ -1241,7 +1238,6 @@ gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple,
{
GncPluginPageInvoice *plugin_page = user_data;
GncPluginPageInvoicePrivate *priv;
- GtkWindow *parent;
GAction *layout_action;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
diff --git a/gnucash/gnome/gnc-plugin-page-owner-tree.c b/gnucash/gnome/gnc-plugin-page-owner-tree.c
index a08a57ed0..80c4912f9 100644
--- a/gnucash/gnome/gnc-plugin-page-owner-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-owner-tree.c
@@ -247,34 +247,12 @@ typedef struct
GncOwnerType owner_type;
} action_owners_struct;
-static action_owners_struct action_owners[] =
-{
- { "OTEditVendorAction", GNC_OWNER_VENDOR },
- { "OTEditCustomerAction", GNC_OWNER_CUSTOMER },
- { "OTEditEmployeeAction", GNC_OWNER_EMPLOYEE },
- { "OTNewVendorAction", GNC_OWNER_VENDOR },
- { "OTNewCustomerAction", GNC_OWNER_CUSTOMER },
- { "OTNewEmployeeAction", GNC_OWNER_EMPLOYEE },
- { "OTNewBillAction", GNC_OWNER_VENDOR },
- { "OTNewInvoiceAction", GNC_OWNER_CUSTOMER },
- { "OTNewVoucherAction", GNC_OWNER_EMPLOYEE },
- { "OTVendorListingReportAction", GNC_OWNER_VENDOR },
- { "OTCustomerListingReportAction", GNC_OWNER_CUSTOMER },
- { "OTVendorReportAction", GNC_OWNER_VENDOR },
- { "OTCustomerReportAction", GNC_OWNER_CUSTOMER },
- { "OTEmployeeReportAction", GNC_OWNER_EMPLOYEE },
- { NULL, GNC_OWNER_NONE },
-};
-
GncPluginPage *
gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
{
GncPluginPageOwnerTree *plugin_page;
GncPluginPageOwnerTreePrivate *priv;
const GList *item;
- GSimpleActionGroup *simple_action_group;
- GAction *action;
- gint i;
g_return_val_if_fail( (owner_type != GNC_OWNER_UNDEFINED)
&& (owner_type != GNC_OWNER_NONE), NULL);
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 21f898a7c..3020fcc04 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -383,16 +383,6 @@ static const gchar* actions_requiring_account[] =
NULL
};
-/** View Style actions */
-static const gchar* view_style_actions[] =
-{
- "ViewStyleBasicAction",
- "ViewStyleAutoSplitAction",
- "ViewStyleJournalAction",
- "ViewStyleRadioAction",
- NULL
-};
-
static const gchar* actions_requiring_priced_account[] =
{
"ActionsStockAssistantAction",
@@ -1035,7 +1025,6 @@ gnc_plugin_page_register_ui_update (gpointer various,
/* Modifying action descriptions based on cursor class */
{
GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
- GtkWidget *menu_item = NULL;
gboolean found = FALSE;
const char** iter, **label_iter, **tooltip_iter;
gboolean curr_label_trans = FALSE;
@@ -1112,7 +1101,6 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
Account* account;
SplitRegister* reg;
GNCLedgerDisplayType ledger_type;
- int i;
gboolean is_readwrite = !qof_book_is_readonly (gnc_get_current_book());
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
@@ -4961,7 +4949,6 @@ gnc_plugin_page_register_cmd_scrub_current (GSimpleAction *simple,
GncPluginPageRegister* page = user_data;
GncPluginPageRegisterPrivate* priv;
Query* query;
- Split* split;
SplitRegister* reg;
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp
index 7c1ba12b8..74d4e79e9 100644
--- a/gnucash/gnome/gnc-plugin-page-report.cpp
+++ b/gnucash/gnome/gnc-plugin-page-report.cpp
@@ -501,7 +501,6 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
GtkWindow *topLvl;
- GAction *action;
GtkWidget *webview;
URLType type;
char * id_name;
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index ca24beed2..c7db63917 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -411,7 +411,6 @@ static void
gsr_move_sort_and_filter_to_state_file (GNCSplitReg *gsr, GKeyFile* state_file, const gchar *state_section)
{
GNCLedgerDisplayType ledger_type;
- GNCLedgerDisplay* ld;
// Look for any old kvp entries and add them to .gcm file
ledger_type = gnc_ledger_display_type (gsr->ledger);
@@ -1368,7 +1367,6 @@ gsr_default_doclink_remove_handler (GNCSplitReg *gsr)
static void
gsr_default_doclink_from_sheet_handler (GNCSplitReg *gsr)
{
- CursorClass cursor_class;
SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
Transaction *trans;
Split *split;
@@ -2452,7 +2450,6 @@ gtk_callback_bug_workaround (gpointer argp)
GNCLedgerDisplayType ledger_type = gnc_ledger_display_type (args->gsr->ledger);
Account *acc = gnc_ledger_display_leader (args->gsr->ledger);
const gchar *acc_name = NULL;
- gchar *tmp = NULL;
if (acc)
{
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 79ec1e1e9..b43f4208c 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1378,7 +1378,7 @@ gnc_ui_reconcile_window_delete_cb (GSimpleAction *simple,
{
RecnWindow *recnData = user_data;
Transaction *trans;
- Split *split, *next_split;
+ Split *split;
split = gnc_reconcile_window_get_current_split(recnData);
/* This should never be true, but be paranoid */
diff --git a/gnucash/import-export/aqb/assistant-ab-initial.c b/gnucash/import-export/aqb/assistant-ab-initial.c
index dd11bf819..57e76d83c 100644
--- a/gnucash/import-export/aqb/assistant-ab-initial.c
+++ b/gnucash/import-export/aqb/assistant-ab-initial.c
@@ -299,7 +299,6 @@ static void delete_account_match(ABInitialInfo *info, RevLookupData *data)
static void
delete_selected_match_cb(gpointer data, gpointer user_data)
{
- GNC_AB_ACCOUNT_SPEC *ab_acc = NULL;
GtkTreeIter iter;
GtkTreeModel *model = NULL;
RevLookupData revLookupData = {NULL, NULL};
@@ -469,7 +468,7 @@ ab_account_longname(const GNC_AB_ACCOUNT_SPEC *ab_acc)
{
gchar *bankname = NULL;
gchar *result = NULL;
- const char *ab_bankname, *bankcode, *subAccountId, *account_number;
+ const char *bankcode, *subAccountId, *account_number;
g_return_val_if_fail(ab_acc, NULL);
diff --git a/gnucash/import-export/aqb/dialog-ab-trans.c b/gnucash/import-export/aqb/dialog-ab-trans.c
index b6a5c0ba4..04776061a 100644
--- a/gnucash/import-export/aqb/dialog-ab-trans.c
+++ b/gnucash/import-export/aqb/dialog-ab-trans.c
@@ -903,8 +903,7 @@ gnc_ab_trans_dialog_templ_list_row_activated_cb(GtkTreeView *view,
const gchar *new_bankcode;
const gchar *new_purpose;
const gchar *new_purpose_cont;
- const gchar *old_amount_text;
- gnc_numeric old_amount, new_amount;
+ gnc_numeric new_amount;
g_return_if_fail(td);
diff --git a/gnucash/import-export/aqb/gnc-ab-getbalance.c b/gnucash/import-export/aqb/gnc-ab-getbalance.c
index ec2f4bd84..cae7c2988 100644
--- a/gnucash/import-export/aqb/gnc-ab-getbalance.c
+++ b/gnucash/import-export/aqb/gnc-ab-getbalance.c
@@ -47,7 +47,6 @@ void
gnc_ab_getbalance(GtkWidget *parent, Account *gnc_acc)
{
AB_BANKING *api;
- gboolean online = FALSE;
GNC_AB_ACCOUNT_SPEC *ab_acc;
GNC_AB_JOB *job = NULL;
GNC_AB_JOB_LIST2 *job_list = NULL;
diff --git a/gnucash/import-export/aqb/gnc-ab-gettrans.c b/gnucash/import-export/aqb/gnc-ab-gettrans.c
index 190292bbd..edf076077 100644
--- a/gnucash/import-export/aqb/gnc-ab-gettrans.c
+++ b/gnucash/import-export/aqb/gnc-ab-gettrans.c
@@ -97,7 +97,6 @@ void
gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
{
AB_BANKING *api;
- gboolean online = FALSE;
GNC_AB_ACCOUNT_SPEC *ab_acc;
GWEN_TIME *from_date = NULL, *to_date = NULL;
time64 until;
diff --git a/gnucash/import-export/aqb/gnc-ab-transfer.c b/gnucash/import-export/aqb/gnc-ab-transfer.c
index d96363d2d..3cfc1e43b 100644
--- a/gnucash/import-export/aqb/gnc-ab-transfer.c
+++ b/gnucash/import-export/aqb/gnc-ab-transfer.c
@@ -81,7 +81,6 @@ gnc_ab_maketrans(GtkWidget *parent, Account *gnc_acc,
GncABTransType trans_type)
{
AB_BANKING *api;
- gboolean online = FALSE;
GNC_AB_ACCOUNT_SPEC *ab_acc;
GList *templates = NULL;
GncABTransDialog *td = NULL;
diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index f8a01f124..0d7b6e0d8 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.c
+++ b/gnucash/import-export/aqb/gnc-ab-utils.c
@@ -498,7 +498,7 @@ gnc_ab_trans_to_gnc (const AB_TRANSACTION *ab_trans, Account *gnc_acc)
Transaction *gnc_trans;
const gchar *fitid;
const GNC_GWEN_DATE *value_date, *post_date;
- time64 current_time, post_time;
+ time64 post_time;
const char *custref;
gchar *description;
Split *split;
diff --git a/gnucash/import-export/aqb/gnc-gwen-gui.c b/gnucash/import-export/aqb/gnc-gwen-gui.c
index f66e1337a..a39be8870 100644
--- a/gnucash/import-export/aqb/gnc-gwen-gui.c
+++ b/gnucash/import-export/aqb/gnc-gwen-gui.c
@@ -1565,7 +1565,7 @@ checkcert_cb(GWEN_GUI *gwen_gui, const GWEN_SSLCERTDESCR *cert,
const gchar *hash, *status;
GChecksum *gcheck = g_checksum_new (G_CHECKSUM_MD5);
gchar cert_hash[16];
- gint retval, i;
+ gint retval;
gsize hashlen = 0;
g_return_val_if_fail(gui && gui->accepted_certs, -1);
diff --git a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c
index ab48cc862..0d13fa05c 100644
--- a/gnucash/import-export/aqb/gnc-plugin-aqbanking.c
+++ b/gnucash/import-export/aqb/gnc-plugin-aqbanking.c
@@ -605,7 +605,6 @@ gnc_plugin_ab_cmd_view_logwindow (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
- GncMainWindowActionData *data = user_data;
GVariant *state;
state = g_action_get_state (G_ACTION(simple));
diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c
index 431f1f493..72c4d565e 100644
--- a/gnucash/import-export/csv-exp/assistant-csv-export.c
+++ b/gnucash/import-export/csv-exp/assistant-csv-export.c
@@ -852,7 +852,6 @@ static GtkWidget *
csv_export_assistant_create (CsvExportInfo *info)
{
GtkBuilder *builder;
- GtkWidget *h_box;
GtkWidget *button;
GtkWidget *table, *hbox;
diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.c b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
index 5737570c0..713a33906 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-account-import.c
+++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
@@ -562,7 +562,6 @@ static GtkWidget *
csv_import_assistant_create (CsvImportInfo *info)
{
GtkBuilder *builder;
- GtkWidget *button;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
gchar *mnemonic_desc = NULL;
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
index e2894b4ae..b5f906794 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
@@ -543,7 +543,6 @@ void GncPreSplit::add (GncTransPropType prop_type, const std::string& value)
// Drop any existing error for the prop_type we're about to add to
m_errors.erase(prop_type);
- Account *acct = nullptr;
auto num_val = GncNumeric();
switch (prop_type)
{
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 6cbf35bbc..d38f13d75 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -246,7 +246,6 @@ gnc_gen_trans_list_empty (GNCImportMainMatcher *info)
{
GtkTreeModel *model;
GtkTreeIter iter;
- GNCImportTransInfo *trans_info;
g_assert (info);
model = gtk_tree_view_get_model (info->view);
// Check that both the tree model and the temporary list are empty.
@@ -258,7 +257,6 @@ gnc_gen_trans_list_show_accounts_column (GNCImportMainMatcher *info)
{
GtkTreeModel *model;
GtkTreeIter iter;
- GNCImportTransInfo *trans_info;
gboolean multiple_accounts = FALSE;
gboolean valid;
@@ -539,7 +537,6 @@ on_matcher_ok_clicked (GtkButton *button, GNCImportMainMatcher *info)
GNCImportTransInfo *trans_info;
gboolean append_text = gtk_toggle_button_get_active ((GtkToggleButton*) info->append_text);
gboolean first_tran = TRUE;
- gpointer user_data = info->user_data;
g_assert (info);
@@ -879,8 +876,6 @@ gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
GtkTreeView *treeview;
GtkTreeSelection *selection;
GtkTreeModel *model;
- GtkTreeIter iter;
- GNCImportTransInfo *trans_info;
Account *assigned_account;
GList *selected_rows, *l;
gboolean first, is_selection;
@@ -1050,7 +1045,7 @@ static gboolean
input_new_fields (GNCImportMainMatcher *info, RowInfo *rowinfo,
char **new_desc, char **new_notes, char **new_memo)
{
- GtkWidget *desc_entry, *notes_entry, *memo_entry, *label;
+ GtkWidget *desc_entry, *notes_entry, *memo_entry;
GtkWidget *dialog;
GtkBuilder *builder;
gboolean retval = FALSE;
@@ -1184,7 +1179,7 @@ gnc_gen_trans_reset_edits_cb (GtkMenuItem *menuitem, GNCImportMainMatcher *info)
GtkTreeModel *model;
GtkTreeStore *store;
GtkTreeSelection *selection;
- GList *selected_rows, *row_info_list;
+ GList *selected_rows;
g_return_if_fail (info != NULL);
ENTER("gnc_gen_trans_reset_edits_cb");
diff --git a/gnucash/import-export/import-match-picker.c b/gnucash/import-export/import-match-picker.c
index 8b84bb915..fdc6bf06d 100644
--- a/gnucash/import-export/import-match-picker.c
+++ b/gnucash/import-export/import-match-picker.c
@@ -76,12 +76,6 @@ enum matcher_cols
/* Needs to be commented in again if any DEBUG() macro is used here. */
/*static short module = MOD_IMPORT;*/
-/********************************************************************\
- * Constants, should idealy be defined a user preference dialog *
-\********************************************************************/
-
-static const int SHOW_NUMERIC_SCORE = FALSE;
-
/********************************************************************\
* Structures passed between the functions *
\********************************************************************/
diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index 516b5e209..342e3ffbd 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -244,8 +244,6 @@ int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user
char* default_fullname = NULL;
char* default_mnemonic = NULL;
- ofx_info* info = (ofx_info*) security_user_data;
-
if (data.unique_id_valid)
{
cusip = gnc_utf8_strip_invalid_strdup (data.unique_id);
@@ -703,7 +701,6 @@ choose_investment_account(OfxTransactionData *data, ofx_info *info,
gnc_commodity *commodity)
{
Account* investment_account = NULL;
- gnc_numeric gnc_amount, gnc_units;
InvestmentAcctData inv_data = {commodity, NULL, NULL, TRUE};
// As we now have the commodity, select the account with that commodity.
@@ -1295,7 +1292,6 @@ runMatcher (ofx_info* info, char * selected_filename, gboolean go_to_next_file)
{
GtkWindow *parent = info->parent;
GList* trans_list_remain = NULL;
- Account* first_account = NULL;
/* If we have multiple accounts in the ofx file, we need to
* avoid processing transfers between accounts together because this will
@@ -1441,7 +1437,6 @@ void gnc_file_ofx_import (GtkWindow *parent)
GSList* selected_filenames = NULL;
char *default_dir;
GList *filters = NULL;
- GSList* iter = NULL;
ofx_info* info = NULL;
GtkFileFilter* filter = gtk_file_filter_new ();
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index 9231ef308..4117d990a 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -2714,7 +2714,6 @@ gnc_ui_qif_import_commodity_notebook_update_combos (QIFImportWindow * wind, gboo
GList *pageptr;
GtkWidget *notebook_page;
QIFCommNotebookPage *comm_nb_page;
- gboolean pages_complete = TRUE;
for (pageptr = wind->commodity_notebook_pages; pageptr; pageptr = pageptr->next)
{
diff --git a/gnucash/import-export/test/gtest-import-backend.cpp b/gnucash/import-export/test/gtest-import-backend.cpp
index fc19f709c..8fc035ba6 100644
--- a/gnucash/import-export/test/gtest-import-backend.cpp
+++ b/gnucash/import-export/test/gtest-import-backend.cpp
@@ -174,7 +174,6 @@ protected:
//! Test for function gnc_import_TransInfo_new()
TEST_F(ImportBackendTest, CreateTransInfo)
{
- gchar* online_id;
using namespace testing;
diff --git a/gnucash/register/ledger-core/split-register-copy-ops.c b/gnucash/register/ledger-core/split-register-copy-ops.c
index ebee1a1d3..a7d36aff3 100644
--- a/gnucash/register/ledger-core/split-register-copy-ops.c
+++ b/gnucash/register/ledger-core/split-register-copy-ops.c
@@ -252,9 +252,6 @@ SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft)
FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index)
{
- FloatingSplit *fs = NULL;
- guint size = 0;
-
g_return_val_if_fail (ft, NULL);
g_return_val_if_fail (ft->m_splits, NULL);
g_return_val_if_fail (index < g_list_length (ft->m_splits) , NULL);
@@ -263,7 +260,7 @@ FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index
FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs)
{
- guint size = 0, other = 0;
+ guint other = 0;
g_return_val_if_fail (ft, NULL);
g_return_val_if_fail (ft->m_splits, NULL);
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index 5857cf8b3..bc5565118 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -1873,7 +1873,6 @@ gnc_split_register_get_debcred_entry (VirtualLocation virt_loc,
}
else
{
- gboolean currency_match;
switch (reg->type)
{
case STOCK_REGISTER:
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 7f85246ce..1d26e511b 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1009,7 +1009,6 @@ gnc_split_register_paste_current (SplitRegister* reg)
"Are you sure you want to do that?");
Account * copied_leader;
Account * default_account;
- const GncGUID *new_guid;
int trans_split_index;
int split_index;
int num_splits;
diff --git a/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c b/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
index 2712541c8..69e946ae6 100644
--- a/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
+++ b/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
@@ -362,7 +362,7 @@ test_gnc_txn_to_float_txn (Fixture *fixture, gconstpointer pData)
{
FloatingTxn *ft = NULL;
SplitList *sl = xaccTransGetSplitList(fixture->txn), *siter;
- SplitList *fsl, *fsiter;
+ SplitList *fsiter;
FloatingSplit *fs;
Split *s;
@@ -419,7 +419,7 @@ test_gnc_txn_to_float_txn_cut_semantics (Fixture *fixture, gconstpointer pData)
{
FloatingTxn *ft = NULL;
SplitList *sl = xaccTransGetSplitList(fixture->txn), *siter;
- SplitList *fsl, *fsiter;
+ SplitList *fsiter;
FloatingSplit *fs;
Split *s;
@@ -536,7 +536,6 @@ test_gnc_float_txn_to_txn_swap_accounts (FlFixture *fixture, gconstpointer pData
Account *exp_acct1 = fixture->acc1, *exp_acct2 = fixture->acc2;
SplitList *siter;
Split *s;
- gnc_numeric amt;
if (prefs->swap_accts)
{
diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index 6e72d8008..251f83695 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -332,8 +332,6 @@ gnc_combo_cell_destroy (BasicCell* bcell)
if (box != NULL)
{
- GList* node;
-
/* Don't destroy the qf if its not ours to destroy */
if (FALSE == box->use_quickfill_cache)
{
diff --git a/gnucash/register/register-gnome/gnucash-header.c b/gnucash/register/register-gnome/gnucash-header.c
index 05ae7bbc6..e9cad07f5 100644
--- a/gnucash/register/register-gnome/gnucash-header.c
+++ b/gnucash/register/register-gnome/gnucash-header.c
@@ -121,7 +121,6 @@ gnc_header_draw_offscreen (GncHeader *header)
for (j = 0; j < style->ncols; j++)
{
CellDimensions *cd;
- double text_x, text_y, text_w, text_h;
BasicCell *cell;
const char *text;
int width;
diff --git a/gnucash/register/register-gnome/gnucash-item-edit.c b/gnucash/register/register-gnome/gnucash-item-edit.c
index 659b4d4b3..649d6a71f 100644
--- a/gnucash/register/register-gnome/gnucash-item-edit.c
+++ b/gnucash/register/register-gnome/gnucash-item-edit.c
@@ -561,7 +561,6 @@ draw_background_cb (GtkWidget *widget, cairo_t *cr, gpointer user_data)
static void
preedit_changed_cb (GtkEntry* entry, gchar *preedit, GncItemEdit* item_edit)
{
- int pos, bound;
item_edit->preedit_length = g_utf8_strlen (preedit, -1); // Note codepoints not bytes
DEBUG("%s %lu", preedit, item_edit->preedit_length);
}
@@ -1032,7 +1031,7 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
gint popup_x, popup_y;
gint popup_w = -1, popup_h = -1;
gint popup_max_width, popup_max_height;
- gint view_width, view_height;
+ gint view_height;
gint down_height, up_height;
gint sheet_width;
diff --git a/gnucash/register/register-gnome/gnucash-register.c b/gnucash/register/register-gnome/gnucash-register.c
index 4a3b19d16..2fdf417e9 100644
--- a/gnucash/register/register-gnome/gnucash-register.c
+++ b/gnucash/register/register-gnome/gnucash-register.c
@@ -552,7 +552,6 @@ gnucash_register_create_widget (Table *table)
GtkWidget *widget;
GtkWidget *sheet;
GtkWidget *scrollbar;
- GtkWidget *box;
reg = g_object_new (GNUCASH_TYPE_REGISTER, NULL);
widget = GTK_WIDGET(reg);
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index b5586ab3c..d38321903 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -421,7 +421,6 @@ gnucash_sheet_activate_cursor_cell (GnucashSheet *sheet,
GdkRectangle rect;
gint x, y, width, height;
gint index = 0, trailing = 0;
- gboolean result;
gint x_offset = 0;
if (text && *text)
@@ -1811,7 +1810,6 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
VirtualLocation cur_virt_loc;
VirtualLocation new_virt_loc;
gncTableTraversalDir direction = 0;
- int distance;
GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
g_return_val_if_fail (widget != NULL, TRUE);
@@ -1917,8 +1915,6 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
static gint
gnucash_sheet_key_release_event (GtkWidget *widget, GdkEventKey *event)
{
- GnucashSheet *sheet;
-
g_return_val_if_fail (widget != NULL, TRUE);
g_return_val_if_fail (GNUCASH_IS_SHEET(widget), TRUE);
g_return_val_if_fail (event != NULL, TRUE);
diff --git a/gnucash/register/register-gnome/gnucash-style.c b/gnucash/register/register-gnome/gnucash-style.c
index 4f2f38d2f..608fe4498 100644
--- a/gnucash/register/register-gnome/gnucash-style.c
+++ b/gnucash/register/register-gnome/gnucash-style.c
@@ -320,7 +320,6 @@ set_dimensions_pass_two (GnucashSheet *sheet, int default_width)
BasicCell *cell;
const char *text;
int sample_width;
- int old_width;
PangoLayout *layout;
cell = gnc_cellblock_get_cell (cursor, 0, col);
diff --git a/libgnucash/app-utils/gnc-gsettings.cpp b/libgnucash/app-utils/gnc-gsettings.cpp
index 50b55392a..950e3bff8 100644
--- a/libgnucash/app-utils/gnc-gsettings.cpp
+++ b/libgnucash/app-utils/gnc-gsettings.cpp
@@ -48,7 +48,6 @@ namespace bpt = boost::property_tree;
#define NOTIFY_TAG "%s-%s-notify_id"
static GHashTable *schema_hash = NULL;
-static const gchar *gsettings_prefix;
static GHashTable *registered_handlers_hash = NULL;
diff --git a/libgnucash/app-utils/gnc-sx-instance-model.c b/libgnucash/app-utils/gnc-sx-instance-model.c
index 1f69e1ee2..47c945cde 100644
--- a/libgnucash/app-utils/gnc-sx-instance-model.c
+++ b/libgnucash/app-utils/gnc-sx-instance-model.c
@@ -1271,7 +1271,7 @@ static gboolean
create_each_transaction_helper(Transaction *template_txn, void *user_data)
{
Transaction *new_txn;
- GList *txn_splits, *template_splits, *node;
+ GList *txn_splits, *template_splits;
Split *copying_split;
SxTxnCreationData *creation_data = (SxTxnCreationData*)user_data;
SchedXaction *sx = creation_data->instance->parent->sx;
diff --git a/libgnucash/app-utils/gnc-ui-balances.c b/libgnucash/app-utils/gnc-ui-balances.c
index 3893c04e1..ed857d969 100644
--- a/libgnucash/app-utils/gnc-ui-balances.c
+++ b/libgnucash/app-utils/gnc-ui-balances.c
@@ -278,7 +278,6 @@ gnc_ui_account_is_higher_balance_limit_reached (const Account *account,
gnc_numeric balance_limit;
gboolean limit_valid = FALSE;
gboolean retval = FALSE;
- gint compare_result;
g_return_val_if_fail (GNC_IS_ACCOUNT(account), FALSE);
@@ -306,7 +305,6 @@ gnc_ui_account_is_lower_balance_limit_reached (const Account *account,
gnc_numeric balance_limit;
gboolean limit_valid = FALSE;
gboolean retval = FALSE;
- gint compare_result;
g_return_val_if_fail (GNC_IS_ACCOUNT(account), FALSE);
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index 7a0601464..ef52a28a6 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -205,7 +205,6 @@ GncDbiBackend<Type>::set_standard_connection_options (dbi_conn conn,
const UriStrings& uri)
{
- gint result;
PairVec options;
options.push_back(std::make_pair("host", uri.m_host));
options.push_back(std::make_pair("dbname", uri.m_dbname));
@@ -638,7 +637,6 @@ template <DbType Type> void
GncDbiBackend<Type>::session_begin (QofSession* session, const char* new_uri,
SessionOpenMode mode)
{
- GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
PairVec options;
g_return_if_fail (session != nullptr);
diff --git a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
index 36f93818f..2ec6ed41f 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
@@ -540,7 +540,6 @@ GncDbiSqlConnection::quote_string (const std::string& unquoted_str)
const noexcept
{
char* quoted_str;
- size_t size;
dbi_conn_quote_string_copy (m_conn, unquoted_str.c_str(),
"ed_str);
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
index 9dcef907d..e1f5e3f31 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
@@ -246,7 +246,6 @@ destroy_database (gchar* url)
gchar* dbname = NULL;
gchar* username = NULL;
gchar* password = NULL;
- gchar* basename = NULL;
gint portnum = 0;
gchar* port = NULL;
auto pgsql = "pgsql";
diff --git a/libgnucash/backend/sql/gnc-address-sql.cpp b/libgnucash/backend/sql/gnc-address-sql.cpp
index 7ca71473a..8ada624ff 100644
--- a/libgnucash/backend/sql/gnc-address-sql.cpp
+++ b/libgnucash/backend/sql/gnc-address-sql.cpp
@@ -77,9 +77,6 @@ GncSqlColumnTableEntryImpl<CT_ADDRESS>::load (const GncSqlBackend* sql_be,
QofIdTypeConst obj_name,
gpointer pObject) const noexcept
{
- const gchar* s;
-
-
g_return_if_fail (sql_be != NULL);
g_return_if_fail (pObject != NULL);
diff --git a/libgnucash/backend/sql/gnc-recurrence-sql.cpp b/libgnucash/backend/sql/gnc-recurrence-sql.cpp
index 0789d3f63..967d5b81a 100644
--- a/libgnucash/backend/sql/gnc-recurrence-sql.cpp
+++ b/libgnucash/backend/sql/gnc-recurrence-sql.cpp
@@ -398,7 +398,6 @@ void
GncSqlRecurrenceBackend::create_tables (GncSqlBackend* sql_be)
{
gint version;
- gboolean ok;
g_return_if_fail (sql_be != NULL);
diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp
index 19abcfb6d..0d8d0470a 100644
--- a/libgnucash/backend/sql/gnc-slots-sql.cpp
+++ b/libgnucash/backend/sql/gnc-slots-sql.cpp
@@ -514,7 +514,6 @@ static void
set_numeric_val (gpointer pObject, gnc_numeric value)
{
slot_info_t* pInfo = (slot_info_t*)pObject;
- KvpValue* pValue = NULL;
g_return_if_fail (pObject != NULL);
@@ -545,7 +544,6 @@ static void
set_gdate_val (gpointer pObject, GDate* value)
{
slot_info_t* pInfo = (slot_info_t*)pObject;
- KvpValue* pValue = NULL;
g_return_if_fail (pObject != NULL);
diff --git a/libgnucash/backend/sql/gnc-sql-backend.cpp b/libgnucash/backend/sql/gnc-sql-backend.cpp
index 67ab0ca01..cee7d5cdd 100644
--- a/libgnucash/backend/sql/gnc-sql-backend.cpp
+++ b/libgnucash/backend/sql/gnc-sql-backend.cpp
@@ -565,7 +565,6 @@ GncSqlBackend::get_object_backend(const std::string& type) const noexcept
void
GncSqlBackend::commit (QofInstance* inst)
{
- sql_backend be_data;
gboolean is_dirty;
gboolean is_destroying;
gboolean is_infant;
@@ -821,7 +820,6 @@ bool
GncSqlBackend::object_in_db (const char* table_name, QofIdTypeConst obj_name,
const gpointer pObject, const EntryVec& table) const noexcept
{
- guint count;
g_return_val_if_fail (table_name != nullptr, false);
g_return_val_if_fail (obj_name != nullptr, false);
g_return_val_if_fail (pObject != nullptr, false);
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
index f76b26b6e..d98d798d1 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
@@ -323,7 +323,6 @@ GncSqlColumnTableEntryImpl<CT_GUID>::load (const GncSqlBackend* sql_be,
{
GncGUID guid;
- const GncGUID* pGuid;
g_return_if_fail (pObject != NULL);
g_return_if_fail (m_gobj_param_name != nullptr || get_setter(obj_name) != nullptr);
diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp
index d5e877842..54c0aab3b 100644
--- a/libgnucash/backend/sql/gnc-transaction-sql.cpp
+++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp
@@ -204,7 +204,6 @@ load_single_split (GncSqlBackend* sql_be, GncSqlRow& row)
const GncGUID* guid;
GncGUID split_guid;
Split* pSplit = NULL;
- gboolean bad_guid = FALSE;
g_return_val_if_fail (sql_be != NULL, NULL);
@@ -689,8 +688,6 @@ void gnc_sql_transaction_load_tx_for_account (GncSqlBackend* sql_be,
Account* account)
{
const GncGUID* guid;
- gchar guid_buf[GUID_ENCODING_LENGTH + 1];
- gchar* query_sql;
g_return_if_fail (sql_be != NULL);
g_return_if_fail (account != NULL);
@@ -954,8 +951,6 @@ GncSqlColumnTableEntryImpl<CT_TXREF>::load (const GncSqlBackend* sql_be,
QofIdTypeConst obj_name,
gpointer pObject) const noexcept
{
- const gchar* guid_str;
-
g_return_if_fail (sql_be != NULL);
g_return_if_fail (pObject != NULL);
diff --git a/libgnucash/backend/xml/io-gncxml-v1.cpp b/libgnucash/backend/xml/io-gncxml-v1.cpp
index 821ab8ed4..1decb89c5 100644
--- a/libgnucash/backend/xml/io-gncxml-v1.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v1.cpp
@@ -761,8 +761,6 @@ kvp_frame_slot_end_handler (gpointer data_for_children,
gpointer* result, const gchar* tag)
{
KvpFrame* f = (KvpFrame*) parent_data;
- GSList* lp;
- gboolean first = TRUE;
gchar* key = NULL;
KvpValue* value = NULL;
gboolean delete_value = FALSE;
diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp
index 94e6e2fbb..5f27b90e9 100644
--- a/libgnucash/backend/xml/io-gncxml-v2.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v2.cpp
@@ -83,10 +83,6 @@
static QofLogModule log_module = GNC_MOD_IO;
-/* map pointers, e.g. of type FILE*, to GThreads */
-static GHashTable* threads = NULL;
-G_LOCK_DEFINE_STATIC (threads);
-
typedef struct
{
gint fd;
diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp
index 715a0d91f..ed849d5db 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp
@@ -324,8 +324,6 @@ xmlNodePtr
qof_instance_slots_to_dom_tree (const char* tag, const QofInstance* inst)
{
xmlNodePtr ret;
- const char** keys;
- unsigned int i;
KvpFrame* frame = qof_instance_get_slots (inst);
if (!frame || frame->empty())
return nullptr;
diff --git a/libgnucash/backend/xml/test/test-kvp-frames.cpp b/libgnucash/backend/xml/test/test-kvp-frames.cpp
index eca84dda9..3d4f918cd 100644
--- a/libgnucash/backend/xml/test/test-kvp-frames.cpp
+++ b/libgnucash/backend/xml/test/test-kvp-frames.cpp
@@ -30,7 +30,6 @@ test_kvp_get_slot (int run,
}
else
{
- gchar* tmp;
failure_args (msg, __FILE__, __LINE__, "run=%d", run);
printf (" Value is %s\n", test_val2->to_string ().c_str ());
}
@@ -52,7 +51,6 @@ test_kvp_copy_compare (int run,
}
else
{
- gchar* tmp;
failure_args (msg, __FILE__, __LINE__, "run=%d", run);
printf ("Frame1 is %s\n", test_frame1->to_string ().c_str ());
printf ("Frame2 is %s\n", test_frame2->to_string ().c_str ());
@@ -75,7 +73,6 @@ test_kvp_copy_get_slot (int run,
}
else
{
- gchar* tmp;
failure_args (msg, __FILE__, __LINE__, "run=%d", run);
printf ("Frame1 is %s\n", test_frame1->to_string ().c_str ());
printf ("Frame2 is %s\n", test_frame2->to_string ().c_str ());
diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp
index 4f6db842f..a362246c1 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.cpp
+++ b/libgnucash/core-utils/gnc-filepath-utils.cpp
@@ -584,7 +584,6 @@ get_userconfig_home(void)
static std::string migrate_gnc_datahome()
{
- auto success = false;
// Specify location of dictionaries
bfs::path old_dir(g_get_home_dir(), cvt);
old_dir /= ".gnucash";
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index cc4f9f61f..407e1cc8f 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -377,7 +377,6 @@ gnc_account_get_property (GObject *object,
{
Account *account;
AccountPrivate *priv;
- const gchar *key;
g_return_if_fail(GNC_IS_ACCOUNT(object));
@@ -2372,9 +2371,7 @@ xaccAccountOrder (const Account *aa, const Account *ab)
{
AccountPrivate *priv_aa, *priv_ab;
const char *da, *db;
- char *endptr = NULL;
int ta, tb, result;
- long la, lb;
if ( aa && !ab ) return -1;
if ( !aa && ab ) return +1;
diff --git a/libgnucash/engine/Split.c b/libgnucash/engine/Split.c
index af9588982..bd6541206 100644
--- a/libgnucash/engine/Split.c
+++ b/libgnucash/engine/Split.c
@@ -155,7 +155,6 @@ gnc_split_get_property(GObject *object,
GParamSpec *pspec)
{
Split *split;
- gchar *key;
Time64 t;
g_return_if_fail(GNC_IS_SPLIT(object));
@@ -229,7 +228,6 @@ gnc_split_set_property(GObject *object,
{
Split *split;
gnc_numeric* number;
- gchar *key;
Time64 *t;
g_return_if_fail(GNC_IS_SPLIT(object));
diff --git a/libgnucash/engine/TransLog.c b/libgnucash/engine/TransLog.c
index f2bc78495..728a7c87b 100644
--- a/libgnucash/engine/TransLog.c
+++ b/libgnucash/engine/TransLog.c
@@ -244,7 +244,6 @@ xaccTransWriteLog (Transaction *trans, char flag)
for (node = trans->splits; node; node = node->next)
{
- time64 time;
Split *split = node->data;
const char * accname = "";
char acc_guid_str[GUID_ENCODING_LENGTH + 1];
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 4b1888cc3..e7b6ee82a 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -308,7 +308,6 @@ gnc_transaction_get_property(GObject* object,
GParamSpec* pspec)
{
Transaction* tx;
- gchar *key;
Time64 time;
g_return_if_fail(GNC_IS_TRANSACTION(object));
@@ -355,7 +354,6 @@ gnc_transaction_set_property(GObject* object,
GParamSpec* pspec)
{
Transaction* tx;
- gchar *key;
Time64 *t;
g_return_if_fail(GNC_IS_TRANSACTION(object));
@@ -1940,7 +1938,6 @@ xaccTransOrder_num_action (const Transaction *ta, const char *actna,
{
const char *da, *db;
int retval;
- int64_t na, nb;
if ( ta && !tb ) return -1;
if ( !ta && tb ) return +1;
diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp
index ba3c5c84c..adf2600e7 100644
--- a/libgnucash/engine/gnc-date.cpp
+++ b/libgnucash/engine/gnc-date.cpp
@@ -1113,7 +1113,6 @@ gnc_date_timestamp (void)
time64
gnc_iso8601_to_time64_gmt(const char *cstr)
{
- time64 time;
if (!cstr) return INT64_MAX;
try
{
@@ -1138,8 +1137,6 @@ gnc_iso8601_to_time64_gmt(const char *cstr)
char *
gnc_time64_to_iso8601_buff (time64 time, char * buff)
{
- constexpr size_t max_iso_date_length = 32;
-
if (! buff) return NULL;
try
{
diff --git a/libgnucash/engine/gnc-datetime.cpp b/libgnucash/engine/gnc-datetime.cpp
index 62764b672..e263f6517 100644
--- a/libgnucash/engine/gnc-datetime.cpp
+++ b/libgnucash/engine/gnc-datetime.cpp
@@ -43,9 +43,6 @@
#include <gnc-locale-utils.hpp>
#include "gnc-timezone.hpp"
#include "gnc-datetime.hpp"
-#include "qoflog.h"
-
-static const char* log_module = "gnc.engine";
#define N_(string) string //So that xgettext will find it
diff --git a/libgnucash/engine/gnc-int128.cpp b/libgnucash/engine/gnc-int128.cpp
index 5e3201f1c..340dbe1f3 100644
--- a/libgnucash/engine/gnc-int128.cpp
+++ b/libgnucash/engine/gnc-int128.cpp
@@ -697,7 +697,6 @@ div_single_leg (uint64_t* u, size_t m, uint64_t v,
GncInt128& q, GncInt128& r) noexcept
{
uint64_t qv[sublegs] {};
- uint64_t carry {};
bool negative {q.isNeg()};
bool rnegative {r.isNeg()};
for (int i = m - 1; i >= 0; --i)
diff --git a/libgnucash/engine/gnc-lot.c b/libgnucash/engine/gnc-lot.c
index dd0cec9dd..0f1541a2b 100644
--- a/libgnucash/engine/gnc-lot.c
+++ b/libgnucash/engine/gnc-lot.c
@@ -144,7 +144,6 @@ gnc_lot_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec*
{
GNCLot* lot;
GNCLotPrivate* priv;
- gchar *key;
g_return_if_fail(GNC_IS_LOT(object));
@@ -181,7 +180,6 @@ gnc_lot_set_property (GObject* object,
{
GNCLot* lot;
GNCLotPrivate* priv;
- gchar *key = NULL;
g_return_if_fail(GNC_IS_LOT(object));
diff --git a/libgnucash/engine/gnc-numeric.cpp b/libgnucash/engine/gnc-numeric.cpp
index 2568fd748..d0e716c29 100644
--- a/libgnucash/engine/gnc-numeric.cpp
+++ b/libgnucash/engine/gnc-numeric.cpp
@@ -656,8 +656,6 @@ gnc_numeric_positive_p(gnc_numeric a)
int
gnc_numeric_compare(gnc_numeric a, gnc_numeric b)
{
- gint64 aa, bb;
-
if (gnc_numeric_check(a) || gnc_numeric_check(b))
{
return 0;
@@ -803,7 +801,6 @@ gnc_numeric
gnc_numeric_sub(gnc_numeric a, gnc_numeric b,
gint64 denom, gint how)
{
- gnc_numeric nb;
if (gnc_numeric_check(a) || gnc_numeric_check(b))
{
return gnc_numeric_error(GNC_ERROR_ARG);
diff --git a/libgnucash/engine/gncCustomer.c b/libgnucash/engine/gncCustomer.c
index 46f96edbf..f089807c5 100644
--- a/libgnucash/engine/gncCustomer.c
+++ b/libgnucash/engine/gncCustomer.c
@@ -129,7 +129,6 @@ gnc_customer_get_property (GObject *object,
GParamSpec *pspec)
{
GncCustomer *cust;
- gchar *key;
g_return_if_fail(GNC_IS_CUSTOMER(object));
cust = GNC_CUSTOMER(object);
@@ -160,7 +159,6 @@ gnc_customer_set_property (GObject *object,
GParamSpec *pspec)
{
GncCustomer *cust;
- gchar *key;
g_return_if_fail(GNC_IS_CUSTOMER(object));
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 66a8f7fec..bf1dcde22 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -962,7 +962,7 @@ static gnc_numeric gncInvoiceGetNetAndTaxesInternal (GncInvoice *invoice, gboole
for (node = gncInvoiceGetEntries (invoice); node; node = node->next)
{
GncEntry *entry = node->data;
- gnc_numeric value, tax;
+ gnc_numeric value;
if (use_payment_type && gncEntryGetBillPayment (entry) != type)
continue;
@@ -1010,7 +1010,6 @@ static gnc_numeric gncInvoiceGetTotalInternal (GncInvoice *invoice, gboolean use
{
AccountValueList *taxes;
gnc_numeric total;
- int denom;
if (!invoice) return gnc_numeric_zero ();
@@ -1056,7 +1055,6 @@ gnc_numeric gncInvoiceGetTotalOf (GncInvoice *invoice, GncEntryPaymentType type)
AccountValueList *gncInvoiceGetTotalTaxList (GncInvoice *invoice)
{
- gnc_numeric unused;
AccountValueList *taxes;
if (!invoice) return NULL;
diff --git a/libgnucash/engine/gncJob.c b/libgnucash/engine/gncJob.c
index 93cd66b52..244cc9920 100644
--- a/libgnucash/engine/gncJob.c
+++ b/libgnucash/engine/gncJob.c
@@ -109,7 +109,6 @@ gnc_job_get_property (GObject *object,
GParamSpec *pspec)
{
GncJob *job;
- gchar *key;
g_return_if_fail(GNC_IS_JOB(object));
@@ -135,7 +134,6 @@ gnc_job_set_property (GObject *object,
GParamSpec *pspec)
{
GncJob *job;
- gchar *key;
g_return_if_fail(GNC_IS_JOB(object));
diff --git a/libgnucash/engine/gncVendor.c b/libgnucash/engine/gncVendor.c
index 62a42bf03..f4f90f517 100644
--- a/libgnucash/engine/gncVendor.c
+++ b/libgnucash/engine/gncVendor.c
@@ -139,7 +139,6 @@ gnc_vendor_get_property (GObject *object,
GParamSpec *pspec)
{
GncVendor *vendor;
- gchar *key;
g_return_if_fail(GNC_IS_VENDOR(object));
@@ -201,7 +200,6 @@ gnc_vendor_set_property (GObject *object,
GParamSpec *pspec)
{
GncVendor *vendor;
- gchar *key;
g_return_if_fail(GNC_IS_VENDOR(object));
diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp
index 9202422a9..961982e76 100644
--- a/libgnucash/engine/guid.cpp
+++ b/libgnucash/engine/guid.cpp
@@ -233,7 +233,6 @@ guid_hash_to_guint (gconstpointer ptr)
gnc::GUID const & temp {guid};
guint hash {0};
- unsigned retspot {0};
std::for_each (temp.begin (), temp.end (), [&hash] (unsigned char a) {
hash <<=4;
hash |= a;
diff --git a/libgnucash/engine/kvp-frame.cpp b/libgnucash/engine/kvp-frame.cpp
index 9066a8aad..b4c5aed50 100644
--- a/libgnucash/engine/kvp-frame.cpp
+++ b/libgnucash/engine/kvp-frame.cpp
@@ -39,8 +39,6 @@
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = "qof.kvp";
-static const char delim = '/';
-
KvpFrameImpl::KvpFrameImpl(const KvpFrameImpl & rhs) noexcept
{
std::for_each(rhs.m_valuemap.begin(), rhs.m_valuemap.end(),
diff --git a/libgnucash/engine/qofbook.cpp b/libgnucash/engine/qofbook.cpp
index f34c1d579..ea7a14f6d 100644
--- a/libgnucash/engine/qofbook.cpp
+++ b/libgnucash/engine/qofbook.cpp
@@ -158,7 +158,6 @@ qof_book_get_property (GObject* object,
GParamSpec* pspec)
{
QofBook *book;
- gchar *key;
g_return_if_fail (QOF_IS_BOOK (object));
book = QOF_BOOK (object);
@@ -199,7 +198,6 @@ qof_book_set_property (GObject *object,
GParamSpec *pspec)
{
QofBook *book;
- gchar *key;
g_return_if_fail (QOF_IS_BOOK (object));
book = QOF_BOOK (object);
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index 111e082c9..fec393de5 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -690,7 +690,6 @@ gboolean
qof_instance_get_dirty (QofInstance *inst)
{
QofInstancePrivate *priv;
- QofCollection *coll;
if (!inst)
{
@@ -705,7 +704,6 @@ void
qof_instance_set_dirty(QofInstance* inst)
{
QofInstancePrivate *priv;
- QofCollection *coll;
priv = GET_PRIVATE(inst);
priv->dirty = TRUE;
diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp
index b51027f37..a7f5b784d 100644
--- a/libgnucash/engine/qofquery.cpp
+++ b/libgnucash/engine/qofquery.cpp
@@ -507,7 +507,7 @@ compile_sort (QofQuerySort *sort, QofIdType obj)
static void compile_terms (QofQuery *q)
{
- GList *or_ptr, *and_ptr, *node;
+ GList *or_ptr, *and_ptr;
ENTER (" query=%p", q);
/* Find the specific functions for this Query. Note that the
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index 92a386489..cc490a035 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -69,8 +69,6 @@
#include "test-engine-strings.h"
#include <qofinstance-p.h>
-static gboolean glist_strings_only = FALSE;
-
static GHashTable *exclude_kvp_types = NULL;
static gint kvp_max_depth = 5;
static gint kvp_frame_max_elements = 10;
@@ -152,8 +150,6 @@ kvp_type_excluded (KvpValue::Type kvp_type)
return FALSE;
}
-static gboolean zero_nsec = FALSE;
-
/* ========================================================== */
static inline gboolean
@@ -1702,11 +1698,9 @@ get_random_query(void)
while (num_terms-- > 0)
{
gint pr_type;
- KvpValue *value;
time64 start;
time64 end;
GList *guids;
- GSList *path;
char *string;
GncGUID *guid;
diff --git a/libgnucash/engine/test/gtest-import-map.cpp b/libgnucash/engine/test/gtest-import-map.cpp
index 598fa7c6f..b91c28dda 100644
--- a/libgnucash/engine/test/gtest-import-map.cpp
+++ b/libgnucash/engine/test/gtest-import-map.cpp
@@ -288,8 +288,6 @@ TEST_F(ImapBayesTest, AddAccountBayes)
auto acct1_guid = guid_to_string (xaccAccountGetGUID(t_expense_account1));
auto acct2_guid = guid_to_string (xaccAccountGetGUID(t_expense_account2));
auto value = root->get_slot({std::string{IMAP_FRAME_BAYES} + "/foo/bar"});
- auto check_account = [this](KvpValue* v) {
- return (v->get<const char*>(), gnc_account_get_book(this->t_acc)); };
value = root->get_slot({std::string{IMAP_FRAME_BAYES} + "/" + foo + "/" + acct1_guid});
EXPECT_EQ(1, value->get<int64_t>());
value = root->get_slot({std::string{IMAP_FRAME_BAYES} + "/" + bar + "/" + acct1_guid});
diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c
index aa4587269..4a386b733 100644
--- a/libgnucash/engine/test/test-gnc-date.c
+++ b/libgnucash/engine/test/test-gnc-date.c
@@ -40,7 +40,6 @@
#endif
static const gchar *suitename = "/qof/gnc-date";
-static const time64 secs_per_year = INT64_C(3600) * (INT64_C(24) * INT64_C(365) + 6);
static const time64 max_secs = (INT64_C(3600) * (INT64_C(24) * INT64_C(365) + 6)) * (INT64_C(9999) - INT64_C(1970));
typedef struct
diff --git a/libgnucash/engine/test/test-gnc-guid.cpp b/libgnucash/engine/test/test-gnc-guid.cpp
index 10137f42e..f5fc31b39 100644
--- a/libgnucash/engine/test/test-gnc-guid.cpp
+++ b/libgnucash/engine/test/test-gnc-guid.cpp
@@ -36,8 +36,6 @@ TEST (GncGUID, creation)
{
auto guid = gnc::GUID::create_random ();
EXPECT_NE (guid, gnc::GUID::null_guid ());
- // There should be a default constructor.
- GncGUID other;
}
TEST (GncGUID, copy)
diff --git a/libgnucash/engine/test/test-qofinstance.cpp b/libgnucash/engine/test/test-qofinstance.cpp
index ee585e45a..a40aecc45 100644
--- a/libgnucash/engine/test/test-qofinstance.cpp
+++ b/libgnucash/engine/test/test-qofinstance.cpp
@@ -196,9 +196,6 @@ test_instance_new_destroy( void )
/* test var */
Time64 *time_priv;
const char *msg1 = "qof_instance_get_collection: assertion 'QOF_IS_INSTANCE(ptr)' failed";
- const char *msg2 = "qof_instance_get_editlevel: assertion 'QOF_IS_INSTANCE(ptr)' failed";
- const char *msg3 = "qof_instance_get_destroying: assertion 'QOF_IS_INSTANCE(ptr)' failed";
- const char *msg4 = "qof_instance_get_dirty_flag: assertion 'QOF_IS_INSTANCE(ptr)' failed";
const char *log_domain = "qof";
auto loglevel = static_cast<GLogLevelFlags>(G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL);
auto check = test_error_struct_new(log_domain, loglevel, msg1);
diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp
index 2223d8a70..b89b33582 100644
--- a/libgnucash/engine/test/utest-Account.cpp
+++ b/libgnucash/engine/test/utest-Account.cpp
@@ -440,7 +440,7 @@ gchar *gnc_account_name_violations_errmsg (const gchar *separator, GList* invali
static void
test_gnc_account_name_violations_errmsg ()
{
- GList *badnames = NULL, *nonames = NULL, *node = NULL;
+ GList *badnames = NULL, *nonames = NULL;
auto separator = ":";
/* FUT wants to free the strings, so we alloc them */
badnames = g_list_prepend (badnames, g_strdup ("Foo:bar"));
diff --git a/libgnucash/engine/test/utest-Budget.c b/libgnucash/engine/test/utest-Budget.c
index 5ea9204c7..cea7eb5f6 100644
--- a/libgnucash/engine/test/utest-Budget.c
+++ b/libgnucash/engine/test/utest-Budget.c
@@ -167,7 +167,6 @@ test_gnc_set_budget_account_period_value()
guint log_level = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
gchar *log_domain = "gnc.engine";
gchar *msg = "[gnc_budget_set_account_period_value()] Period 12 does not exist";
- guint hdlr;
TestErrorStruct check = { log_level, log_domain, msg, 0 };
GLogFunc oldlogger;
diff --git a/libgnucash/engine/test/utest-Invoice.c b/libgnucash/engine/test/utest-Invoice.c
index 7a4af807c..4d0c561e3 100644
--- a/libgnucash/engine/test/utest-Invoice.c
+++ b/libgnucash/engine/test/utest-Invoice.c
@@ -195,8 +195,6 @@ setup_with_invoice_and_payment (Fixture *fixture, gconstpointer pData)
static void
setup_with_invoice_and_CN (Fixture *fixture, gconstpointer pData)
{
- const InvoiceData *data = (InvoiceData*) pData;
-
time64 ts1 = gnc_time(NULL);
time64 ts2 = ts1;
const char *desc = "Test description";
diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp
index 059c483b7..c9aa37af6 100644
--- a/libgnucash/engine/test/utest-Split.cpp
+++ b/libgnucash/engine/test/utest-Split.cpp
@@ -561,7 +561,6 @@ test_xaccSplitCommitEdit (Fixture *fixture, gconstpointer pData)
gchar *msg2 = "[xaccSplitCommitEdit()] Account grabbed split prematurely.";
gchar *logdomain = "gnc.engine";
GLogLevelFlags loglevel = static_cast<GLogLevelFlags>(G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL);
- guint infolevel = G_LOG_LEVEL_INFO;
guint hdlr;
TestErrorStruct checkA = { loglevel, logdomain, msg1, 0 };
TestErrorStruct checkB = { loglevel, logdomain, msg2, 0 };
@@ -1104,7 +1103,6 @@ xaccSplitOrder (const Split *sa, const Split *sb)// C: 5 in 3
static void
test_xaccSplitOrder (Fixture *fixture, gconstpointer pData)
{
- const char *slot_path;
Split *split = fixture->split;
QofBook *book = xaccSplitGetBook (split);
Split *o_split = xaccMallocSplit (book);
diff --git a/libgnucash/engine/test/utest-Transaction.cpp b/libgnucash/engine/test/utest-Transaction.cpp
index 3a9412bbb..96640e542 100644
--- a/libgnucash/engine/test/utest-Transaction.cpp
+++ b/libgnucash/engine/test/utest-Transaction.cpp
@@ -286,7 +286,6 @@ void mark_trans (Transaction *trans)// Local: 3:0:0
static void
test_mark_trans (Fixture *fixture, gconstpointer pData)
{
- gboolean dirty_split = FALSE;
GList *splits = NULL;
for (splits = (fixture->txn)->splits; splits; splits = splits->next)
@@ -357,7 +356,7 @@ test_gnc_transaction_dispose ()
auto split = static_cast<Split*>(g_object_new (GNC_TYPE_SPLIT, "book", book, NULL));
auto s_ref = split;
gnc_commodity *curr = gnc_commodity_new (book, "Gnu Rand", "CURRENCY",
- "GNR", "", 240), *t_curr = NULL;
+ "GNR", "", 240);
gnc_commodity *c_ref = curr;
g_object_add_weak_pointer (G_OBJECT (split), (gpointer*) &s_ref);
g_object_add_weak_pointer (G_OBJECT (curr), (gpointer*) &c_ref);
@@ -464,7 +463,6 @@ test_xaccMallocTransaction (Fixture *fixture, gconstpointer pData)
#endif
auto msg = _func ": assertion 'book' failed";
#undef _func
- auto logdomain = "gnc.engine";
auto loglevel = static_cast<GLogLevelFlags>(G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL);
auto check = test_error_struct_new ("gnc.engine", loglevel, msg);
fixture->hdlrs = test_log_set_fatal_handler (fixture->hdlrs, check,
@@ -597,7 +595,6 @@ test_xaccTransClone (Fixture *fixture, gconstpointer pData)
Transaction *newtxn = NULL, *oldtxn = fixture->txn;
QofBook *old_book = qof_instance_get_book (QOF_INSTANCE (oldtxn));
GList *newnode, *oldnode;
- int foo, bar;
oldtxn->date_posted = posted;
oldtxn->date_entered = entered;
@@ -658,8 +655,6 @@ test_xaccTransCopyFromClipBoard (Fixture *fixture, gconstpointer pData)
Account *acc1 = xaccMallocAccount (book);
Transaction *to_txn = xaccMallocTransaction (book);
time64 now = gnc_time (nullptr);
- time64 never = 0;
- auto to_frame = to_txn->inst.kvp_data;
xaccAccountSetCommodity (acc1, fixture->comm);
xaccTransCopyFromClipBoard (txn, to_txn, fixture->acc1, acc1, FALSE);
@@ -1020,7 +1015,6 @@ test_xaccTransGetImbalance_trading (Fixture *fixture,
auto split2 = xaccMallocSplit (book);
Account *acc1 = xaccMallocAccount (book);
Account *acc2 = xaccMallocAccount (book);
- gnc_numeric value;
MonetaryList *mlist;
qof_book_begin_edit (book);
qof_instance_set (QOF_INSTANCE (book),
diff --git a/libgnucash/engine/test/utest-gnc-pricedb.c b/libgnucash/engine/test/utest-gnc-pricedb.c
index 2bd3b172d..043ea7783 100644
--- a/libgnucash/engine/test/utest-gnc-pricedb.c
+++ b/libgnucash/engine/test/utest-gnc-pricedb.c
@@ -582,7 +582,6 @@ static void
setup(PriceDBFixture *fixture, gconstpointer data)
{
QofBook *book = NULL;
- GNCPrice *price = NULL;
gnc_pricedb_register();
book = qof_book_new();
fixture->com = setup_commodities(book);
diff --git a/libgnucash/tax/gnc-locale-tax.c b/libgnucash/tax/gnc-locale-tax.c
index ced2dfeba..0bff95217 100644
--- a/libgnucash/tax/gnc-locale-tax.c
+++ b/libgnucash/tax/gnc-locale-tax.c
@@ -111,7 +111,6 @@ gnc_ui_account_get_tax_info_string (const Account *account)
if (get_form == SCM_UNDEFINED)
{
- const gchar *tax_module;
/* load the tax info */
gnc_locale_tax_init ();
commit 4e25bbfc43819fc456d12b1f3ede44c24f9ee1f8
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Sat Feb 4 14:23:36 2023 +0000
Mark some QofLogModules as potentially unused
- __attribute__((unused)) for C
- [[maybe_unused]] for cpp
diff --git a/gnucash/gnome/dialog-fincalc.c b/gnucash/gnome/dialog-fincalc.c
index db6c3a5cc..7db7578dc 100644
--- a/gnucash/gnome/dialog-fincalc.c
+++ b/gnucash/gnome/dialog-fincalc.c
@@ -93,7 +93,7 @@ static unsigned int periods[] =
};
/* This static indicates the debugging module that this .o belongs to. */
-static QofLogModule log_module = GNC_MOD_GUI;
+__attribute__((unused)) static QofLogModule log_module = GNC_MOD_GUI;
/** Prototypes **********************************************************/
diff --git a/gnucash/gnome/window-autoclear.c b/gnucash/gnome/window-autoclear.c
index 4c17cbad1..2f7f0e33d 100644
--- a/gnucash/gnome/window-autoclear.c
+++ b/gnucash/gnome/window-autoclear.c
@@ -37,7 +37,7 @@
#define WINDOW_AUTOCLEAR_CM_CLASS "window-autoclear"
-static QofLogModule log_module = GNC_MOD_GUI;
+__attribute__((unused)) static QofLogModule log_module = GNC_MOD_GUI;
/** STRUCTS *********************************************************/
struct _AutoClearWindow
diff --git a/gnucash/gnucash-cli.cpp b/gnucash/gnucash-cli.cpp
index e85f252ee..123ba504d 100644
--- a/gnucash/gnucash-cli.cpp
+++ b/gnucash/gnucash-cli.cpp
@@ -45,7 +45,7 @@
namespace bl = boost::locale;
/* This static indicates the debugging module that this .o belongs to. */
-static QofLogModule log_module = GNC_MOD_GUI;
+[[maybe_unused]] static QofLogModule log_module = GNC_MOD_GUI;
namespace Gnucash {
diff --git a/gnucash/import-export/aqb/dialog-ab-select-imexporter.c b/gnucash/import-export/aqb/dialog-ab-select-imexporter.c
index 73dbb10cd..8cbdebea6 100644
--- a/gnucash/import-export/aqb/dialog-ab-select-imexporter.c
+++ b/gnucash/import-export/aqb/dialog-ab-select-imexporter.c
@@ -32,7 +32,7 @@
#include "dialog-ab-select-imexporter.h"
#include <dialog-utils.h>
-static QofLogModule log_module = G_LOG_DOMAIN;
+__attribute__((unused)) static QofLogModule log_module = G_LOG_DOMAIN;
struct _GncABSelectImExDlg
{
diff --git a/libgnucash/backend/sql/gnc-budget-sql.cpp b/libgnucash/backend/sql/gnc-budget-sql.cpp
index 492eefb3d..c99025715 100644
--- a/libgnucash/backend/sql/gnc-budget-sql.cpp
+++ b/libgnucash/backend/sql/gnc-budget-sql.cpp
@@ -51,7 +51,7 @@
#define AMOUNTS_TABLE "budget_amounts"
#define AMOUNTS_TABLE_VERSION 1
-static QofLogModule log_module = G_LOG_DOMAIN;
+[[maybe_unused]] static QofLogModule log_module = G_LOG_DOMAIN;
#define BUDGET_MAX_NAME_LEN 2048
#define BUDGET_MAX_DESCRIPTION_LEN 2048
diff --git a/libgnucash/backend/sql/gnc-commodity-sql.cpp b/libgnucash/backend/sql/gnc-commodity-sql.cpp
index e3383dbe9..2792f09f8 100644
--- a/libgnucash/backend/sql/gnc-commodity-sql.cpp
+++ b/libgnucash/backend/sql/gnc-commodity-sql.cpp
@@ -44,7 +44,7 @@
#include "splint-defs.h"
#endif
-static QofLogModule log_module = G_LOG_DOMAIN;
+[[maybe_unused]] static QofLogModule log_module = G_LOG_DOMAIN;
static gpointer get_quote_source_name (gpointer pObject);
static void set_quote_source_name (gpointer pObject, gpointer pValue);
diff --git a/libgnucash/backend/sql/gnc-order-sql.cpp b/libgnucash/backend/sql/gnc-order-sql.cpp
index 3201bf983..f467bd78c 100644
--- a/libgnucash/backend/sql/gnc-order-sql.cpp
+++ b/libgnucash/backend/sql/gnc-order-sql.cpp
@@ -45,7 +45,7 @@
#define _GNC_MOD_NAME GNC_ID_ORDER
-static QofLogModule log_module = G_LOG_DOMAIN;
+[[maybe_unused]] static QofLogModule log_module = G_LOG_DOMAIN;
#define TABLE_NAME "orders"
#define TABLE_VERSION 1
diff --git a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
index 7d078e977..cc58b0f0a 100644
--- a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
@@ -46,7 +46,7 @@
#include "sixtp-dom-parsers.h"
-static const QofLogModule log_module = G_LOG_DOMAIN;
+[[maybe_unused]] static const QofLogModule log_module = G_LOG_DOMAIN;
const gchar* transaction_version_string = "2.0.0";
static void
Summary of changes:
bindings/guile/gnc-engine-guile.cpp | 2 --
bindings/guile/gnc-optiondb.i | 12 ---------
borrowed/jenny/jenny.c | 6 +----
gnucash/gnome-utils/account-quickfill.c | 1 -
gnucash/gnome-utils/dialog-doclink-utils.c | 1 -
gnucash/gnome-utils/dialog-dup-trans.c | 1 -
gnucash/gnome-utils/dialog-file-access.c | 1 -
gnucash/gnome-utils/dialog-options.cpp | 1 -
gnucash/gnome-utils/gnc-amount-edit.c | 1 -
gnucash/gnome-utils/gnc-autoclear.c | 2 --
gnucash/gnome-utils/gnc-cell-renderer-text-flag.c | 1 -
gnucash/gnome-utils/gnc-cell-view.c | 1 -
gnucash/gnome-utils/gnc-frequency.c | 11 --------
gnucash/gnome-utils/gnc-gtk-utils.c | 1 -
gnucash/gnome-utils/gnc-main-window.cpp | 10 --------
gnucash/gnome-utils/gnc-plugin-file-history.c | 1 -
gnucash/gnome-utils/gnc-query-view.c | 1 -
gnucash/gnome/assistant-hierarchy.cpp | 2 --
gnucash/gnome/dialog-doclink.c | 1 -
gnucash/gnome/dialog-fincalc.c | 7 ++++--
gnucash/gnome/dialog-new-user.c | 2 --
gnucash/gnome/dialog-payment.c | 1 -
gnucash/gnome/dialog-price-edit-db.cpp | 1 -
gnucash/gnome/dialog-report-column-view.cpp | 2 --
gnucash/gnome/gnc-plugin-basic-commands.c | 2 --
gnucash/gnome/gnc-plugin-business.c | 1 -
gnucash/gnome/gnc-plugin-page-account-tree.c | 2 --
gnucash/gnome/gnc-plugin-page-budget.c | 3 +--
gnucash/gnome/gnc-plugin-page-invoice.c | 12 +++------
gnucash/gnome/gnc-plugin-page-owner-tree.c | 22 ----------------
gnucash/gnome/gnc-plugin-page-register.c | 13 ----------
gnucash/gnome/gnc-plugin-page-report.cpp | 9 +++----
gnucash/gnome/gnc-plugin-page-sx-list.c | 4 ---
gnucash/gnome/gnc-split-reg.c | 3 ---
gnucash/gnome/window-autoclear.c | 2 +-
gnucash/gnome/window-reconcile.c | 2 +-
gnucash/gnucash-cli.cpp | 2 +-
gnucash/html/gnc-html-webkit2.c | 5 +---
gnucash/import-export/aqb/assistant-ab-initial.c | 3 +--
.../aqb/dialog-ab-select-imexporter.c | 2 +-
gnucash/import-export/aqb/dialog-ab-trans.c | 3 +--
gnucash/import-export/aqb/gnc-ab-getbalance.c | 1 -
gnucash/import-export/aqb/gnc-ab-gettrans.c | 1 -
gnucash/import-export/aqb/gnc-ab-transfer.c | 1 -
gnucash/import-export/aqb/gnc-ab-utils.c | 2 +-
gnucash/import-export/aqb/gnc-gwen-gui.c | 2 +-
gnucash/import-export/aqb/gnc-plugin-aqbanking.c | 1 -
.../import-export/csv-exp/assistant-csv-export.c | 1 -
.../csv-imp/assistant-csv-account-import.c | 1 -
gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp | 1 -
gnucash/import-export/import-main-matcher.c | 9 ++-----
gnucash/import-export/import-match-picker.c | 6 -----
gnucash/import-export/ofx/gnc-ofx-import.c | 5 ----
.../import-export/qif-imp/assistant-qif-import.c | 1 -
.../test/gtest-import-account-matcher.cpp | 2 --
.../import-export/test/gtest-import-backend.cpp | 1 -
.../register/ledger-core/split-register-copy-ops.c | 5 +---
.../register/ledger-core/split-register-model.c | 1 -
gnucash/register/ledger-core/split-register.c | 1 -
.../test/utest-split-register-copy-ops.c | 5 ++--
gnucash/register/register-gnome/combocell-gnome.c | 2 --
gnucash/register/register-gnome/gnucash-header.c | 1 -
.../register/register-gnome/gnucash-item-edit.c | 3 +--
gnucash/register/register-gnome/gnucash-register.c | 1 -
gnucash/register/register-gnome/gnucash-sheet.c | 4 ---
gnucash/register/register-gnome/gnucash-style.c | 1 -
libgnucash/app-utils/gnc-gsettings.cpp | 1 -
libgnucash/app-utils/gnc-sx-instance-model.c | 2 +-
libgnucash/app-utils/gnc-ui-balances.c | 2 --
libgnucash/app-utils/test/gtest-gnc-quotes.cpp | 2 --
libgnucash/backend/dbi/gnc-backend-dbi.cpp | 4 +--
libgnucash/backend/dbi/gnc-dbisqlconnection.cpp | 1 -
.../backend/dbi/test/test-backend-dbi-basic.cpp | 9 +++----
libgnucash/backend/sql/gnc-address-sql.cpp | 3 ---
libgnucash/backend/sql/gnc-budget-sql.cpp | 2 +-
libgnucash/backend/sql/gnc-commodity-sql.cpp | 2 +-
libgnucash/backend/sql/gnc-order-sql.cpp | 2 +-
libgnucash/backend/sql/gnc-recurrence-sql.cpp | 1 -
libgnucash/backend/sql/gnc-slots-sql.cpp | 2 --
libgnucash/backend/sql/gnc-sql-backend.cpp | 2 --
.../backend/sql/gnc-sql-column-table-entry.cpp | 3 ---
libgnucash/backend/sql/gnc-transaction-sql.cpp | 5 ----
libgnucash/backend/xml/gnc-transaction-xml-v2.cpp | 2 +-
libgnucash/backend/xml/io-gncxml-v1.cpp | 2 --
libgnucash/backend/xml/io-gncxml-v2.cpp | 4 ---
libgnucash/backend/xml/sixtp-dom-generators.cpp | 2 --
libgnucash/backend/xml/test/test-kvp-frames.cpp | 3 ---
libgnucash/core-utils/binreloc.c | 3 +--
libgnucash/core-utils/gnc-filepath-utils.cpp | 1 -
libgnucash/engine/Account.cpp | 3 ---
libgnucash/engine/Scrub.c | 1 -
libgnucash/engine/Split.c | 2 --
libgnucash/engine/TransLog.c | 1 -
libgnucash/engine/Transaction.c | 3 ---
libgnucash/engine/gnc-date.cpp | 3 ---
libgnucash/engine/gnc-datetime.cpp | 3 ---
libgnucash/engine/gnc-int128.cpp | 1 -
libgnucash/engine/gnc-lot.c | 2 --
libgnucash/engine/gnc-numeric.cpp | 3 ---
libgnucash/engine/gnc-option-impl.cpp | 1 -
libgnucash/engine/gnc-timezone.cpp | 4 +--
libgnucash/engine/gncCustomer.c | 2 --
libgnucash/engine/gncInvoice.c | 4 +--
libgnucash/engine/gncJob.c | 2 --
libgnucash/engine/gncVendor.c | 2 --
libgnucash/engine/guid.cpp | 3 +--
libgnucash/engine/kvp-frame.cpp | 2 --
libgnucash/engine/qofbook.cpp | 4 ---
libgnucash/engine/qofinstance.cpp | 2 --
libgnucash/engine/qofquery.cpp | 2 +-
libgnucash/engine/test-core/test-engine-stuff.cpp | 6 -----
libgnucash/engine/test/gtest-gnc-int128.cpp | 29 ++++++++++------------
libgnucash/engine/test/gtest-import-map.cpp | 3 ---
libgnucash/engine/test/gtest-qofevent.cpp | 1 -
libgnucash/engine/test/test-gnc-date.c | 1 -
libgnucash/engine/test/test-gnc-guid.cpp | 4 +--
libgnucash/engine/test/test-qofinstance.cpp | 3 ---
libgnucash/engine/test/test-qofsession.cpp | 2 +-
libgnucash/engine/test/utest-Account.cpp | 2 +-
libgnucash/engine/test/utest-Budget.c | 1 -
libgnucash/engine/test/utest-Invoice.c | 2 --
libgnucash/engine/test/utest-Split.cpp | 2 --
libgnucash/engine/test/utest-Transaction.cpp | 11 +-------
libgnucash/engine/test/utest-gnc-pricedb.c | 1 -
libgnucash/tax/gnc-locale-tax.c | 1 -
125 files changed, 63 insertions(+), 335 deletions(-)
More information about the gnucash-changes
mailing list