Skip to content

Commit

Permalink
[-Wunused-but-set-variable] (clang) - remove
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcohen committed Feb 16, 2023
1 parent dda1bb8 commit f63dddc
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 26 deletions.
2 changes: 0 additions & 2 deletions borrowed/jenny/jenny.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,6 @@ build_tuples( state *s, ub2 d, ub2 f)
feature offset[MAX_N]; /* n-1-tuples */
feature tuple[MAX_N]; /* n-tuples that include (d,f) */
sb4 i, j, n;
ub8 count = 0;
tu_iter ctx;

if (s->tc[d][f] > 0 || s->n[d][f] == s->n_final) {
Expand Down Expand Up @@ -1242,7 +1241,6 @@ build_tuples( state *s, ub2 d, ub2 f)
printf("jenny: could not insert tuple\n");
return;
}
++count;

/* next tuple */
make_next_tuple:
Expand Down
2 changes: 0 additions & 2 deletions gnucash/gnome-utils/gnc-query-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ gnc_query_view_fill (GNCQueryView *qview)
for (item = entries; item; item = item->next)
{
GList *node;
gint row = 0;
const QofParam *gup;
QofParam *qp = NULL;

Expand Down Expand Up @@ -868,7 +867,6 @@ gnc_query_view_fill (GNCQueryView *qview)
}
i++;
}
row++;
/* and set a watcher on this item */
gup = priv->get_guid;
guid = (const GncGUID*)((gup->param_getfcn)(item->data, gup));
Expand Down
17 changes: 0 additions & 17 deletions gnucash/gnome-utils/gnc-tree-view-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,24 +1221,12 @@ gnc_tree_view_account_get_view_info (GncTreeViewAccount *account_view,
/*
* Set the account view info data in use by the specified tree to
* match the callers request.
*
* DRH - COMPATIBILITY WARNING
*
* This function does not do anything with the 'include_type' field.
* Should there be a automatic filter for backward compatibility
* that uses these flags, or should all uses of this be converted to
* a GtkTreeModelFilter?
*
* CAS - For now, I'll try the automatic filter approach by making
* this function use GtkTreeModelFilter.
*/
void
gnc_tree_view_account_set_view_info (GncTreeViewAccount *account_view,
AccountViewInfo *avi)
{
GncTreeViewAccountPrivate *priv;
gint i;
guint sel_bits = 0;

ENTER("%p", account_view);
g_return_if_fail(GNC_IS_TREE_VIEW_ACCOUNT(account_view));
Expand All @@ -1247,11 +1235,6 @@ gnc_tree_view_account_set_view_info (GncTreeViewAccount *account_view,
priv = GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(account_view);
priv->avi = *avi;

for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
{
sel_bits |= avi->include_type[i] ? (1 << i) : 0;
}

gnc_tree_view_account_set_filter(
account_view, gnc_tree_view_account_filter_by_view_info,
&priv->avi, NULL);
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/business-gnome-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ gnc_default_invoice_report_combo (const char* guid_scm_function)

if (scm_is_list (rpt_guids))
{
for (int i = 0; !scm_is_null (rpt_guids); i++)
while (!scm_is_null (rpt_guids))
{
gchar *guid_str = scm_to_utf8_string (SCM_CAR(rpt_guids));
gchar *name = gnc_scm_to_utf8_string (scm_call_2(template_menu_name,
Expand Down
3 changes: 1 addition & 2 deletions gnucash/gnome/dialog-custom-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
SCM get_rpt_guids = scm_c_eval_string("gnc:custom-report-template-guids");
SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
SCM rpt_guids;
int i;
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL (store);

Expand All @@ -170,7 +169,7 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
{
/* for all the report guids in the list, store them, with a reference,
in the gtkliststore */
for (i = 0; !scm_is_null(rpt_guids); i++)
while ( !scm_is_null(rpt_guids) )
{
GncGUID *guid = guid_malloc ();
gchar *guid_str = scm_to_utf8_string (SCM_CAR(rpt_guids));
Expand Down
2 changes: 0 additions & 2 deletions gnucash/import-export/log-replay/gnc-log-replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ static void process_trans_record( FILE *log_file)
const char * record_end_str = "===== END";
int first_record = TRUE;
int record_ended = FALSE;
int split_num = 0;
split_record record;
Transaction * trans = NULL;
Split * split = NULL;
Expand All @@ -380,7 +379,6 @@ static void process_trans_record( FILE *log_file)
if (read_retval != NULL &&
strncmp(record_end_str, read_buf, strlen(record_end_str)) != 0) /* If we are not at the end of the record */
{
split_num++;
/*DEBUG("process_trans_record(): Line read: %s%s",read_buf ,"\n");*/

record = interpret_split_record(g_strchomp(read_buf));
Expand Down

0 comments on commit f63dddc

Please sign in to comment.