mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Fix const/unconst casts.
Signed-off-by: Andreas Mohr <and@gmx.li> Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
e61db70c58
commit
b71f66dbbd
@ -85,11 +85,11 @@ static char *kill_buffer = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static size_t
|
||||
get_history_length (const GList * history)
|
||||
get_history_length (GList * history)
|
||||
{
|
||||
size_t len = 0;
|
||||
|
||||
for (; history != NULL; history = (const GList *) g_list_previous (history))
|
||||
for (; history != NULL; history = g_list_previous (history))
|
||||
len++;
|
||||
|
||||
return len;
|
||||
|
@ -718,7 +718,7 @@ menubar_get_menu_by_x_coord (const WMenuBar * menubar, int x)
|
||||
static gboolean
|
||||
menubar_mouse_on_menu (const WMenuBar * menubar, int y, int x)
|
||||
{
|
||||
Widget *w = WIDGET (menubar);
|
||||
const Widget *w = CONST_WIDGET (menubar);
|
||||
menu_t *menu;
|
||||
int left_x, right_x, bottom_y;
|
||||
|
||||
|
@ -3834,7 +3834,7 @@ panel_mouse_is_on_item (const WPanel * panel, int y, int x)
|
||||
{
|
||||
int width, lines;
|
||||
|
||||
width = (WIDGET (panel)->cols - 2) / panel->list_cols;
|
||||
width = (CONST_WIDGET (panel)->cols - 2) / panel->list_cols;
|
||||
lines = panel_lines (panel);
|
||||
y += lines * (x / width);
|
||||
}
|
||||
|
@ -390,6 +390,7 @@ sftpfs_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2, GError **
|
||||
sftpfs_super_t *super = NULL;
|
||||
const vfs_path_element_t *path_element1;
|
||||
const vfs_path_element_t *path_element2 = NULL;
|
||||
const char *ctmp_path;
|
||||
char *tmp_path;
|
||||
unsigned int tmp_path_len;
|
||||
int res;
|
||||
@ -397,8 +398,8 @@ sftpfs_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2, GError **
|
||||
if (!sftpfs_op_init (&super, &path_element2, vpath2, mcerror))
|
||||
return -1;
|
||||
|
||||
tmp_path = (char *) sftpfs_fix_filename (path_element2->path, &tmp_path_len);
|
||||
tmp_path = g_strndup (tmp_path, tmp_path_len);
|
||||
ctmp_path = sftpfs_fix_filename (path_element2->path, &tmp_path_len);
|
||||
tmp_path = g_strndup (ctmp_path, tmp_path_len);
|
||||
|
||||
path_element1 = vfs_path_get_by_index (vpath1, -1);
|
||||
|
||||
@ -591,6 +592,7 @@ sftpfs_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2, GError ** m
|
||||
sftpfs_super_t *super = NULL;
|
||||
const vfs_path_element_t *path_element1;
|
||||
const vfs_path_element_t *path_element2 = NULL;
|
||||
const char *ctmp_path;
|
||||
char *tmp_path;
|
||||
unsigned int tmp_path_len;
|
||||
int res;
|
||||
@ -598,8 +600,8 @@ sftpfs_rename (const vfs_path_t * vpath1, const vfs_path_t * vpath2, GError ** m
|
||||
if (!sftpfs_op_init (&super, &path_element2, vpath2, mcerror))
|
||||
return -1;
|
||||
|
||||
tmp_path = (char *) sftpfs_fix_filename (path_element2->path, &tmp_path_len);
|
||||
tmp_path = g_strndup (tmp_path, tmp_path_len);
|
||||
ctmp_path = sftpfs_fix_filename (path_element2->path, &tmp_path_len);
|
||||
tmp_path = g_strndup (ctmp_path, tmp_path_len);
|
||||
|
||||
path_element1 = vfs_path_get_by_index (vpath1, -1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user