From ed94e880540cf1cbc3903ec5ec1489e2b67ac0ca Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 1 Nov 2018 10:33:17 +0100 Subject: Fix some warnings from static analyser --- src/cell_explorer.c | 10 ++++++++-- src/multihistogram.c | 4 ++-- src/multihistogram.h | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cell_explorer.c b/src/cell_explorer.c index a48ab9b5..69dd7178 100644 --- a/src/cell_explorer.c +++ b/src/cell_explorer.c @@ -189,6 +189,12 @@ static void set_col(cairo_t *cr, CellWindow *w, int cat) static gboolean destroy_sig(GtkWidget *da, CellWindow *w) { + multihistogram_free(w->hist_a->h); + multihistogram_free(w->hist_b->h); + multihistogram_free(w->hist_c->h); + multihistogram_free(w->hist_al->h); + multihistogram_free(w->hist_be->h); + multihistogram_free(w->hist_ga->h); gtk_main_quit(); return FALSE; } @@ -666,7 +672,7 @@ static void scan_cells(CellWindow *w) for ( i=0; in_unique_indms; j++ ) { @@ -706,7 +712,7 @@ static void scan_cells(CellWindow *w) check_exclude(w->hist_be, be) || check_exclude(w->hist_ga, ga) ) { - cat = 1<= hi->n_bins ) j = hi->n_bins - 1; for ( i=0; i<32; i++ ) { - if ( cat & 1<bins[i][j]++; + if ( cat & (unsigned)1<bins[i][j]++; } } diff --git a/src/multihistogram.h b/src/multihistogram.h index e4c2ae89..0949d259 100644 --- a/src/multihistogram.h +++ b/src/multihistogram.h @@ -40,7 +40,8 @@ extern MultiHistogram *multihistogram_new(); extern void multihistogram_free(MultiHistogram *hi); extern void multihistogram_delete_all_values(MultiHistogram *hi); -extern void multihistogram_add_value(MultiHistogram *hi, double val, int cat); +extern void multihistogram_add_value(MultiHistogram *hi, double val, + unsigned int cat); extern void multihistogram_set_min(MultiHistogram *hi, double min); extern void multihistogram_set_max(MultiHistogram *hi, double max); -- cgit v1.2.3