From 6005a63cad56f81aebd8ea5a98b106e8ba2daaa4 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 20 Feb 2016 14:18:26 +0000 Subject: [PATCH] src/filemanager/panel.c: cleanup -Wcast-qual warning. Signed-off-by: Andreas Mohr Signed-off-by: Andrew Borodin --- src/filemanager/boxes.c | 6 +++--- src/filemanager/panel.c | 13 +++++++------ src/filemanager/panel.h | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c index 46bbd276b..d5c46ca5b 100644 --- a/src/filemanager/boxes.c +++ b/src/filemanager/boxes.c @@ -805,7 +805,7 @@ panel_listing_box (WPanel * panel, int num, char **userp, char **minip, int *use const panel_field_t * sort_box (dir_sort_options_t * op, const panel_field_t * sort_field) { - const char **sort_orders_names; + char **sort_orders_names; gsize i; gsize sort_names_num = 0; int sort_idx = 0; @@ -824,7 +824,7 @@ sort_box (dir_sort_options_t * op, const panel_field_t * sort_field) quick_widget_t quick_widgets[] = { /* *INDENT-OFF* */ QUICK_START_COLUMNS, - QUICK_RADIO (sort_names_num, sort_orders_names, &sort_idx, NULL), + QUICK_RADIO (sort_names_num, (const char **) sort_orders_names, &sort_idx, NULL), QUICK_NEXT_COLUMN, QUICK_CHECKBOX (N_("Executable &first"), &op->exec_first, NULL), QUICK_CHECKBOX (N_("Cas&e sensitive"), &op->case_sensitive, NULL), @@ -848,7 +848,7 @@ sort_box (dir_sort_options_t * op, const panel_field_t * sort_field) result = sort_field; } - g_strfreev ((gchar **) sort_orders_names); + g_strfreev (sort_orders_names); return result; } diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 3cc52065e..f3775a52c 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -1068,7 +1068,8 @@ display_total_marked_size (const WPanel * panel, int y, int x, gboolean size_onl { const Widget *w = CONST_WIDGET (panel); - char buffer[BUF_SMALL], b_bytes[BUF_SMALL], *buf; + char buffer[BUF_SMALL], b_bytes[BUF_SMALL]; + const char *buf; int cols; if (panel->marked <= 0) @@ -1090,7 +1091,7 @@ display_total_marked_size (const WPanel * panel, int y, int x, gboolean size_onl b_bytes, panel->marked); /* don't forget spaces around buffer content */ - buf = (char *) str_trunc (buf, cols - 4); + buf = str_trunc (buf, cols - 4); if (x < 0) /* center in panel */ @@ -4852,7 +4853,7 @@ panel_get_num_of_sortable_fields (void) /* --------------------------------------------------------------------------------------------- */ -const char ** +char ** panel_get_sortable_fields (gsize * array_size) { char **ret; @@ -4873,7 +4874,7 @@ panel_get_sortable_fields (gsize * array_size) if (panel_fields[i].is_user_choice) ret[lc_index++] = g_strdup (_(panel_fields[i].title_hotkey)); - return (const char **) ret; + return ret; } /* --------------------------------------------------------------------------------------------- */ @@ -4940,7 +4941,7 @@ panel_get_num_of_user_possible_fields (void) /* --------------------------------------------------------------------------------------------- */ -const char ** +char ** panel_get_user_possible_fields (gsize * array_size) { char **ret; @@ -4961,7 +4962,7 @@ panel_get_user_possible_fields (gsize * array_size) if (panel_fields[i].use_in_user_format) ret[lc_index++] = g_strdup (_(panel_fields[i].title_hotkey)); - return (const char **) ret; + return ret; } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/panel.h b/src/filemanager/panel.h index 4f3cd0d19..d3f792ec2 100644 --- a/src/filemanager/panel.h +++ b/src/filemanager/panel.h @@ -180,12 +180,12 @@ void do_file_mark (WPanel * panel, int idx, int val); gboolean do_panel_cd (WPanel * panel, const vfs_path_t * new_dir_vpath, enum cd_enum cd_type); gsize panel_get_num_of_sortable_fields (void); -const char **panel_get_sortable_fields (gsize *); +char **panel_get_sortable_fields (gsize *); const panel_field_t *panel_get_field_by_id (const char *); const panel_field_t *panel_get_field_by_title (const char *); const panel_field_t *panel_get_field_by_title_hotkey (const char *); gsize panel_get_num_of_user_possible_fields (void); -const char **panel_get_user_possible_fields (gsize *); +char **panel_get_user_possible_fields (gsize *); void panel_set_cwd (WPanel * panel, const vfs_path_t * vpath); void panel_set_lwd (WPanel * panel, const vfs_path_t * vpath);