Code clean up, remove unused variables

This commit is contained in:
Robert Fewell 2017-07-23 11:45:55 +01:00 committed by John Ralls
parent e7d35b8309
commit 69e927a3a9
20 changed files with 3 additions and 46 deletions

View File

@ -154,7 +154,6 @@ gfec_eval_string(const char *str, gfec_error_handler error_handler)
SCM SCM
gfec_eval_file(const char *file, gfec_error_handler error_handler) gfec_eval_file(const char *file, gfec_error_handler error_handler)
{ {
char *err_msg = NULL;
gchar *contents = NULL; gchar *contents = NULL;
GError *save_error = NULL; GError *save_error = NULL;
SCM result; SCM result;

View File

@ -60,11 +60,9 @@ static time64 gnc_accounting_period_end_time64 (GncAccountingPeriod which,
static time64 static time64
lookup_start_date_option(GDate *fy_end) lookup_start_date_option(GDate *fy_end)
{ {
gchar *choice;
time64 time; time64 time;
int which; int which;
if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS)) if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS))
time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE); time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE);
else else

View File

@ -620,7 +620,6 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
xmlChar *newURL; xmlChar *newURL;
gchar *tmpdir = g_build_filename (g_get_home_dir (), ".gnc-migration-tmp", NULL); gchar *tmpdir = g_build_filename (g_get_home_dir (), ".gnc-migration-tmp", NULL);
int i;
const char *lastsegment = URL; const char *lastsegment = URL;
const char *iter = URL; const char *iter = URL;
@ -700,7 +699,7 @@ void gnc_gsettings_migrate_from_gconf (void)
gchar *pkgdatadir, *stylesheet, *input, *output, *command; gchar *pkgdatadir, *stylesheet, *input, *output, *command;
gchar *gconf_root, *gconf_apps, *gconf_gnucash; gchar *gconf_root, *gconf_apps, *gconf_gnucash;
gchar *base_dir, *iter; gchar *base_dir, *iter;
SCM migr_script, result; SCM migr_script;
xsltStylesheetPtr stylesheetptr = NULL; xsltStylesheetPtr stylesheetptr = NULL;
xmlDocPtr inputxml, transformedxml; xmlDocPtr inputxml, transformedxml;
FILE *outfile; FILE *outfile;

View File

@ -70,7 +70,7 @@ static void
gnc_state_set_base (const QofSession *session) gnc_state_set_base (const QofSession *session)
{ {
gchar *basename, *original = NULL, *filename, *file_guid; gchar *basename, *original = NULL, *filename, *file_guid;
gchar *sf_extension = NULL, *newstyle_filename = NULL; gchar *sf_extension = NULL;
const gchar *uri; const gchar *uri;
gchar guid_string[GUID_ENCODING_LENGTH+1]; gchar guid_string[GUID_ENCODING_LENGTH+1];
QofBook *book; QofBook *book;
@ -200,10 +200,6 @@ gnc_state_set_base (const QofSession *session)
GKeyFile *gnc_state_load (const QofSession *session) GKeyFile *gnc_state_load (const QofSession *session)
{ {
GKeyFile *keyfile = NULL;
GError *error = NULL;
/* Drop possible previous state_file first */ /* Drop possible previous state_file first */
if (state_file) if (state_file)
{ {
@ -221,7 +217,6 @@ GKeyFile *gnc_state_load (const QofSession *session)
TRUE, TRUE, NULL); TRUE, TRUE, NULL);
return gnc_state_get_current (); return gnc_state_get_current ();
} }
void gnc_state_save (const QofSession *session) void gnc_state_save (const QofSession *session)

View File

@ -1584,7 +1584,6 @@ xaccSPrintAmount (char * bufp, gnc_numeric val, GNCPrintAmountInfo info)
char sign_posn; char sign_posn;
gboolean print_sign = TRUE; gboolean print_sign = TRUE;
gboolean is_shares = FALSE;
gboolean print_absolute = FALSE; gboolean print_absolute = FALSE;
if (!bufp) if (!bufp)

View File

@ -1726,7 +1726,6 @@ gnc_commit_option(GNCOption *option)
char *section, *name; char *section, *name;
const gchar *message; const gchar *message;
const gchar *format = _("There is a problem with option %s:%s.\n%s"); const gchar *format = _("There is a problem with option %s:%s.\n%s");
char * str;
/* Second element is error message */ /* Second element is error message */
oops = SCM_CADR(result); oops = SCM_CADR(result);
@ -2619,8 +2618,6 @@ gnc_option_db_set_string_option(GNCOptionDB *odb,
char * char *
gnc_option_date_option_get_subtype(GNCOption *option) gnc_option_date_option_get_subtype(GNCOption *option)
{ {
SCM value;
initialize_getters(); initialize_getters();
return gnc_scm_call_1_symbol_to_string(getters.date_option_subtype, option->guile_option); return gnc_scm_call_1_symbol_to_string(getters.date_option_subtype, option->guile_option);
@ -2636,8 +2633,6 @@ gnc_option_date_option_get_subtype(GNCOption *option)
char * char *
gnc_date_option_value_get_type (SCM option_value) gnc_date_option_value_get_type (SCM option_value)
{ {
SCM value;
initialize_getters(); initialize_getters();
return gnc_scm_call_1_symbol_to_string (getters.date_option_value_type, option_value); return gnc_scm_call_1_symbol_to_string (getters.date_option_value_type, option_value);
@ -2687,8 +2682,6 @@ gnc_date_option_value_get_relative (SCM option_value)
char * char *
gnc_plot_size_option_value_get_type (SCM option_value) gnc_plot_size_option_value_get_type (SCM option_value)
{ {
SCM value;
initialize_getters(); initialize_getters();
return gnc_scm_call_1_symbol_to_string (getters.plot_size_option_value_type, option_value); return gnc_scm_call_1_symbol_to_string (getters.plot_size_option_value_type, option_value);

View File

@ -613,7 +613,6 @@ inner_main (void *closure, int argc, char **argv)
{ {
SCM main_mod; SCM main_mod;
char* fn; char* fn;
GError *error = NULL;
scm_c_eval_string("(debug-set! stack 200000)"); scm_c_eval_string("(debug-set! stack 200000)");

View File

@ -842,7 +842,6 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
GNCPrice *convprice; GNCPrice *convprice;
gnc_commodity *account_currency = (gnc_commodity*)key; gnc_commodity *account_currency = (gnc_commodity*)key;
gnc_numeric *amount = (gnc_numeric*)value; gnc_numeric *amount = (gnc_numeric*)value;
Timespec pricedate;
XferDialog *xfer; XferDialog *xfer;
gnc_numeric exch_rate; gnc_numeric exch_rate;
@ -2246,7 +2245,6 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
{ {
GncInvoice *invoice; GncInvoice *invoice;
GtkBuilder *builder; GtkBuilder *builder;
GtkWidget *id_label;
GtkWidget *dialog, *hbox; GtkWidget *dialog, *hbox;
GncEntryLedger *entry_ledger = NULL; GncEntryLedger *entry_ledger = NULL;
GncOwnerType owner_type; GncOwnerType owner_type;
@ -2595,7 +2593,6 @@ gnc_invoice_window_new_invoice (InvoiceDialogType dialog_type, QofBook *bookp,
if (dialog_type == DUP_INVOICE) if (dialog_type == DUP_INVOICE)
{ {
GtkWidget *invoice_radio = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_invoice_type"));
GtkWidget *cn_radio = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_creditnote_type")); GtkWidget *cn_radio = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_creditnote_type"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(cn_radio), gncInvoiceGetIsCreditNote (invoice)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(cn_radio), gncInvoiceGetIsCreditNote (invoice));
@ -3288,7 +3285,6 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance, GncWhichDueTy
DialogQueryView *dialog; DialogQueryView *dialog;
gint len; gint len;
Timespec ts; Timespec ts;
QofQueryCompare comparetype;
static GList *param_list = NULL; static GList *param_list = NULL;
static GNCDisplayViewButton vendorbuttons[] = static GNCDisplayViewButton vendorbuttons[] =
{ {

View File

@ -192,10 +192,8 @@ static gboolean
gnc_payment_window_check_payment (PaymentWindow *pw) gnc_payment_window_check_payment (PaymentWindow *pw)
{ {
const char *conflict_msg = NULL; const char *conflict_msg = NULL;
Account *post, *acc;
gnc_numeric amount_deb, amount_cred; gnc_numeric amount_deb, amount_cred;
gboolean enable_xfer_acct = TRUE; gboolean enable_xfer_acct = TRUE;
GtkTreeSelection *selection;
if (!pw) if (!pw)
return FALSE; return FALSE;

View File

@ -923,7 +923,6 @@ gnc_entry_ledger_get_color_internal (VirtualLocation virt_loc,
const guint32 *color_table, const guint32 *color_table,
gboolean foreground) gboolean foreground)
{ {
const char *cursor_name;
VirtualCell *vcell; VirtualCell *vcell;
gboolean is_current; gboolean is_current;
guint32 colorbase = 0; /* By default return background colors */ guint32 colorbase = 0; /* By default return background colors */

View File

@ -269,7 +269,6 @@ gnc_path_find_localized_html_file (const gchar *file_name)
gchar *loc_file_name = NULL; gchar *loc_file_name = NULL;
gchar *full_path = NULL; gchar *full_path = NULL;
const gchar * const *lang; const gchar * const *lang;
int i;
if (!file_name || *file_name == '\0') if (!file_name || *file_name == '\0')
return NULL; return NULL;

View File

@ -305,7 +305,6 @@ gnc_account_get_property (GObject *object,
Account *account; Account *account;
AccountPrivate *priv; AccountPrivate *priv;
const gchar *key; const gchar *key;
GValue *temp;
g_return_if_fail(GNC_IS_ACCOUNT(object)); g_return_if_fail(GNC_IS_ACCOUNT(object));
@ -5540,7 +5539,6 @@ gnc_account_imap_add_account_bayes (GncImportMatchMap *imap,
for (current_token = g_list_first(tokens); current_token; for (current_token = g_list_first(tokens); current_token;
current_token = current_token->next) current_token = current_token->next)
{ {
GValue value = G_VALUE_INIT;
/* Jump to next iteration if the pointer is not valid or if the /* Jump to next iteration if the pointer is not valid or if the
string is empty. In HBCI import we almost always get an empty string is empty. In HBCI import we almost always get an empty
string, which doesn't work in the kvp loopkup later. So we string, which doesn't work in the kvp loopkup later. So we

View File

@ -1339,7 +1339,6 @@ void
xaccAccountScrubKvp (Account *account) xaccAccountScrubKvp (Account *account)
{ {
GValue v = G_VALUE_INIT; GValue v = G_VALUE_INIT;
const gchar *str;
gchar *str2; gchar *str2;
if (!account) return; if (!account) return;

View File

@ -51,7 +51,6 @@ static void
gncScrubInvoiceState (GNCLot *lot) gncScrubInvoiceState (GNCLot *lot)
{ {
SplitList *ls_iter = NULL; SplitList *ls_iter = NULL;
Transaction *txn = NULL; // ll_txn = "Lot Link Transaction"
GncInvoice *invoice = NULL; GncInvoice *invoice = NULL;
GncInvoice *lot_invoice = gncInvoiceGetInvoiceFromLot (lot); GncInvoice *lot_invoice = gncInvoiceGetInvoiceFromLot (lot);

View File

@ -1568,9 +1568,6 @@ xaccSplitOrderDateOnly (const Split *sa, const Split *sb)
static gboolean static gboolean
get_corr_account_split(const Split *sa, const Split **retval) get_corr_account_split(const Split *sa, const Split **retval)
{ {
const Split *current_split;
*retval = NULL; *retval = NULL;
g_return_val_if_fail(sa, FALSE); g_return_val_if_fail(sa, FALSE);

View File

@ -314,7 +314,6 @@ gnc_transaction_get_property(GObject* object,
{ {
Transaction* tx; Transaction* tx;
gchar *key; gchar *key;
GValue *temp;
g_return_if_fail(GNC_IS_TRANSACTION(object)); g_return_if_fail(GNC_IS_TRANSACTION(object));
@ -2676,7 +2675,7 @@ xaccTransGetVoidTime(const Transaction *tr)
{ {
GValue v = G_VALUE_INIT; GValue v = G_VALUE_INIT;
const char *s = NULL; const char *s = NULL;
Timespec void_time = {0, 0}, *ts; Timespec void_time = {0, 0};
g_return_val_if_fail(tr, void_time); g_return_val_if_fail(tr, void_time);
qof_instance_get_kvp (QOF_INSTANCE (tr), void_time_str, &v); qof_instance_get_kvp (QOF_INSTANCE (tr), void_time_str, &v);

View File

@ -658,7 +658,6 @@ gnc_query_scm2path (SCM path_scm)
while (!scm_is_null (path_scm)) while (!scm_is_null (path_scm))
{ {
SCM key_scm = SCM_CAR (path_scm); SCM key_scm = SCM_CAR (path_scm);
char *str;
char *key; char *key;
if (!scm_is_string (key_scm)) if (!scm_is_string (key_scm))

View File

@ -1080,7 +1080,6 @@ gnc_commodity_get_fraction(const gnc_commodity * cm)
static gboolean static gboolean
gnc_commodity_get_auto_quote_control_flag(const gnc_commodity *cm) gnc_commodity_get_auto_quote_control_flag(const gnc_commodity *cm)
{ {
const char *str;
GValue v = G_VALUE_INIT; GValue v = G_VALUE_INIT;
if (!cm) return FALSE; if (!cm) return FALSE;
@ -1144,7 +1143,6 @@ gnc_commodity_get_quote_tz(const gnc_commodity *cm)
const char* const char*
gnc_commodity_get_user_symbol(const gnc_commodity *cm) gnc_commodity_get_user_symbol(const gnc_commodity *cm)
{ {
const char *str;
GValue v = G_VALUE_INIT; GValue v = G_VALUE_INIT;
if (!cm) return NULL; if (!cm) return NULL;
qof_instance_get_kvp (QOF_INSTANCE(cm), "user_symbol", &v); qof_instance_get_kvp (QOF_INSTANCE(cm), "user_symbol", &v);
@ -1159,7 +1157,6 @@ gnc_commodity_get_user_symbol(const gnc_commodity *cm)
const char* const char*
gnc_commodity_get_default_symbol(const gnc_commodity *cm) gnc_commodity_get_default_symbol(const gnc_commodity *cm)
{ {
const char *str;
if (!cm) return NULL; if (!cm) return NULL;
return GET_PRIVATE(cm)->default_symbol; return GET_PRIVATE(cm)->default_symbol;
} }

View File

@ -139,7 +139,6 @@ gnc_lot_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec*
GNCLot* lot; GNCLot* lot;
LotPrivate* priv; LotPrivate* priv;
gchar *key; gchar *key;
GValue *temp;
g_return_if_fail(GNC_IS_LOT(object)); g_return_if_fail(GNC_IS_LOT(object));

View File

@ -1539,7 +1539,6 @@ gnc_pricedb_lookup_latest(GNCPriceDB *db,
{ {
GList *price_list; GList *price_list;
GNCPrice *result; GNCPrice *result;
GHashTable *currency_hash;
if (!db || !commodity || !currency) return NULL; if (!db || !commodity || !currency) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, commodity, currency); ENTER ("db=%p commodity=%p currency=%p", db, commodity, currency);
@ -2029,7 +2028,6 @@ gnc_pricedb_lookup_at_time(GNCPriceDB *db,
{ {
GList *price_list; GList *price_list;
GList *item = NULL; GList *item = NULL;
GHashTable *currency_hash;
if (!db || !c || !currency) return NULL; if (!db || !c || !currency) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency); ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
@ -2064,7 +2062,6 @@ lookup_nearest_in_time(GNCPriceDB *db,
GNCPrice *next_price = NULL; GNCPrice *next_price = NULL;
GNCPrice *result = NULL; GNCPrice *result = NULL;
GList *item = NULL; GList *item = NULL;
GHashTable *currency_hash;
if (!db || !c || !currency) return NULL; if (!db || !c || !currency) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency); ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
@ -2185,7 +2182,6 @@ gnc_pricedb_lookup_latest_before (GNCPriceDB *db,
/* GNCPrice *next_price = NULL; /* GNCPrice *next_price = NULL;
GNCPrice *result = NULL;*/ GNCPrice *result = NULL;*/
GList *item = NULL; GList *item = NULL;
GHashTable *currency_hash;
Timespec price_time; Timespec price_time;
if (!db || !c || !currency) return NULL; if (!db || !c || !currency) return NULL;