diff --git a/lib/tty/color-internal.h b/lib/tty/color-internal.h index 5a32a2aa4..a7fc6d210 100644 --- a/lib/tty/color-internal.h +++ b/lib/tty/color-internal.h @@ -24,7 +24,7 @@ typedef struct mc_color_pair_struct { const char *cbg; int ifg; int ibg; - int pair_index; + size_t pair_index; gboolean is_temp; } tty_color_pair_t; diff --git a/lib/tty/color.c b/lib/tty/color.c index 87fce3039..1f2f9f88c 100644 --- a/lib/tty/color.c +++ b/lib/tty/color.c @@ -85,7 +85,7 @@ tty_color_free_condition_cb (gpointer key, gpointer value, gpointer user_data) tty_color_pair_t *mc_color_pair; (void) key; - is_temp_color = (gboolean) user_data; + is_temp_color = user_data == NULL; mc_color_pair = (tty_color_pair_t *) value; return (mc_color_pair->is_temp == is_temp_color); } @@ -96,7 +96,7 @@ static void tty_color_free_all (gboolean is_temp_color) { g_hash_table_foreach_remove (mc_tty_color__hashtable, tty_color_free_condition_cb, - (gpointer) is_temp_color); + (is_temp_color)? (gpointer) 1 : NULL); } /* --------------------------------------------------------------------------------------------- */ @@ -104,11 +104,11 @@ tty_color_free_all (gboolean is_temp_color) static gboolean tty_color_get_next_cpn_cb (gpointer key, gpointer value, gpointer user_data) { - int cp; + size_t cp; tty_color_pair_t *mc_color_pair; (void) key; - cp = (int) user_data; + cp = (size_t) user_data; mc_color_pair = (tty_color_pair_t *) value; if (cp == mc_color_pair->pair_index) @@ -122,8 +122,8 @@ tty_color_get_next_cpn_cb (gpointer key, gpointer value, gpointer user_data) static int tty_color_get_next__color_pair_number () { - int cp_count = g_hash_table_size (mc_tty_color__hashtable); - int cp = 0; + size_t cp_count = g_hash_table_size (mc_tty_color__hashtable); + size_t cp = 0; for (cp = 0; cp < cp_count; cp++) { if (g_hash_table_find (mc_tty_color__hashtable, tty_color_get_next_cpn_cb, (gpointer) cp) == diff --git a/lib/util.c b/lib/util.c index 42e8a0418..73fe599ec 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1446,7 +1446,7 @@ save_file_position (const char *filename, long line, long column, off_t offset) /* put the new record */ if (line != 1 || column != 0) { - if (fprintf (f, "%s %ld;%ld;%llu\n", filename, line, column, offset) < 0) + if (fprintf (f, "%s %ld;%ld;%llu\n", filename, line, column, (unsigned long long) offset) < 0) goto write_position_error; }