mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
* Code cleanup: Added const qualifier for variables and
function declarations where possible. No functional changes.
This commit is contained in:
parent
d6d457ba9a
commit
5697bd2a92
@ -96,7 +96,7 @@ typedef struct {
|
||||
/* Query replace dialog */
|
||||
|
||||
Dlg_head *replace_dlg;
|
||||
char *replace_filename;
|
||||
const char *replace_filename;
|
||||
int replace_result;
|
||||
struct stat *s_stat, *d_stat;
|
||||
} FileOpContextUI;
|
||||
@ -171,8 +171,8 @@ file_op_context_create_ui (FileOpContext *ctx, int with_eta)
|
||||
int x_size;
|
||||
int minus;
|
||||
int eta_offset;
|
||||
char *sixty;
|
||||
char *fifteen;
|
||||
const char *sixty;
|
||||
const char *fifteen;
|
||||
|
||||
g_return_if_fail (ctx != NULL);
|
||||
g_return_if_fail (ctx->ui == NULL);
|
||||
@ -506,7 +506,7 @@ file_progress_show_deleting (FileOpContext *ctx, const char *s)
|
||||
* alex
|
||||
*/
|
||||
static struct {
|
||||
char *text;
|
||||
const char *text;
|
||||
int ypos, xpos;
|
||||
int value; /* 0 for labels */
|
||||
} rd_widgets[] = {
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "global.h"
|
||||
|
||||
static char *
|
||||
get_absolute_name (char *file)
|
||||
get_absolute_name (const char *file)
|
||||
{
|
||||
char dir[MC_MAXPATHLEN];
|
||||
|
||||
@ -70,9 +70,10 @@ my_mkdir_rec (char *s, mode_t mode)
|
||||
}
|
||||
|
||||
int
|
||||
my_mkdir (char *s, mode_t mode)
|
||||
my_mkdir (const char *s, mode_t mode)
|
||||
{
|
||||
int result;
|
||||
char *my_s;
|
||||
|
||||
result = mc_mkdir (s, mode);
|
||||
if (result) {
|
||||
@ -82,21 +83,22 @@ my_mkdir (char *s, mode_t mode)
|
||||
g_free (p);
|
||||
}
|
||||
if (result == 0) {
|
||||
s = get_absolute_name (s);
|
||||
my_s = get_absolute_name (s);
|
||||
|
||||
#ifdef FIXME
|
||||
tree_add_entry (tree, s);
|
||||
tree_add_entry (tree, my_s);
|
||||
#endif
|
||||
|
||||
g_free (s);
|
||||
g_free (my_s);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
my_rmdir (char *s)
|
||||
my_rmdir (const char *s)
|
||||
{
|
||||
int result;
|
||||
char *my_s;
|
||||
#ifdef FIXME
|
||||
WTree *tree = 0;
|
||||
#endif
|
||||
@ -104,13 +106,13 @@ my_rmdir (char *s)
|
||||
/* FIXME: Should receive a Wtree! */
|
||||
result = mc_rmdir (s);
|
||||
if (result == 0) {
|
||||
s = get_absolute_name (s);
|
||||
my_s = get_absolute_name (s);
|
||||
|
||||
#ifdef FIXME
|
||||
tree_remove_entry (tree, s);
|
||||
tree_remove_entry (tree, my_s);
|
||||
#endif
|
||||
|
||||
g_free (s);
|
||||
g_free (my_s);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ FileOpContext *file_op_context_new (FileOperation op);
|
||||
void file_op_context_destroy (FileOpContext *ctx);
|
||||
|
||||
|
||||
extern char *op_names [3];
|
||||
extern const char *op_names [3];
|
||||
|
||||
typedef enum {
|
||||
FILE_CONT,
|
||||
|
@ -173,15 +173,15 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
||||
{
|
||||
int return_value;
|
||||
char *temp_dir;
|
||||
static char *case_label = N_("case &Sensitive");
|
||||
static const char *case_label = N_("case &Sensitive");
|
||||
|
||||
static char *in_contents = NULL;
|
||||
static char *in_start_dir = NULL;
|
||||
static char *in_start_name = NULL;
|
||||
|
||||
static char *labs[] =
|
||||
static const char *labs[] =
|
||||
{ N_("Start at:"), N_("Filename:"), N_("Content: ") };
|
||||
static char *buts[] = { N_("&OK"), N_("&Tree"), N_("&Cancel") };
|
||||
static const char *buts[] = { N_("&OK"), N_("&Tree"), N_("&Cancel") };
|
||||
static int ilen = 30, istart = 14;
|
||||
static int b0 = 3, b1 = 16, b2 = 36;
|
||||
|
||||
@ -611,7 +611,7 @@ do_search (struct Dlg_head *h)
|
||||
count++;
|
||||
if (!(count & 31)){
|
||||
/* For nice updating */
|
||||
char *rotating_dash = "|/-\\";
|
||||
const char *rotating_dash = "|/-\\";
|
||||
|
||||
if (verbose){
|
||||
pos = (pos + 1) % 4;
|
||||
|
Loading…
Reference in New Issue
Block a user