From eb505b5706b642fdd65ce61bb449ae07bdb26e8b Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 20 Feb 2016 17:27:20 +0000
Subject: [PATCH] filemanager/file.c: cleanup -Wcast-qual warning
file.c:241:16: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
fnsource = (char *) x_basename (s);
^
file.c: In function 'is_in_linklist':
/usr/include/glib-2.0/glib/gslist.h:139:52: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL)
^
file.c:296:29: note: in expansion of macro 'g_slist_next'
for (; lp != NULL; lp = g_slist_next (lp))
^
file.c: In function 'panel_operate_generate_prompt':
file.c:1426:10: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
sp = (char *) (src_stat != NULL ? one_format : many_format);
^
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/filemanager/file.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/filemanager/file.c b/src/filemanager/file.c
index d124ef4..fb9103c 100644
a
|
b
|
static char * |
228 | 228 | transform_source (file_op_context_t * ctx, const vfs_path_t * source_vpath) |
229 | 229 | { |
230 | 230 | char *s, *q; |
231 | | char *fnsource; |
| 231 | const char *fnsource; |
232 | 232 | |
233 | 233 | s = g_strdup (vfs_path_as_str (source_vpath)); |
234 | 234 | |
… |
… |
transform_source (file_op_context_t * ctx, const vfs_path_t * source_vpath) |
238 | 238 | if (*q == '\n') |
239 | 239 | *q = ' '; |
240 | 240 | |
241 | | fnsource = (char *) x_basename (s); |
| 241 | fnsource = x_basename (s); |
242 | 242 | |
243 | 243 | if (mc_search_run (ctx->search_handle, fnsource, 0, strlen (fnsource), NULL)) |
244 | 244 | { |
… |
… |
free_linklist (GSList * lp) |
285 | 285 | /* --------------------------------------------------------------------------------------------- */ |
286 | 286 | |
287 | 287 | static gboolean |
288 | | is_in_linklist (const GSList * lp, const vfs_path_t * vpath, const struct stat *sb) |
| 288 | is_in_linklist (GSList * lp, const vfs_path_t * vpath, const struct stat *sb) |
289 | 289 | { |
290 | 290 | const struct vfs_class *class; |
291 | 291 | ino_t ino = sb->st_ino; |
… |
… |
panel_operate_generate_prompt (const WPanel * panel, FileOperation operation, |
1423 | 1423 | * "Delete %d files/directories?" |
1424 | 1424 | */ |
1425 | 1425 | |
1426 | | sp = (char *) (src_stat != NULL ? one_format : many_format); |
| 1426 | cp = (src_stat != NULL ? one_format : many_format); |
1427 | 1427 | |
1428 | 1428 | /* 1. Substitute %o */ |
1429 | | format_string = str_replace_all (sp, "%o", op_names1[(int) operation]); |
| 1429 | format_string = str_replace_all (cp, "%o", op_names1[(int) operation]); |
1430 | 1430 | |
1431 | 1431 | /* 2. Substitute %n */ |
1432 | 1432 | cp = operation == OP_DELETE ? "\n" : " "; |