1
1

* Code cleanup: Added const qualifier for variables and

function declarations where possible. No functional changes.
Этот коммит содержится в:
Roland Illig 2004-08-29 22:51:02 +00:00
родитель d6d457ba9a
Коммит 5697bd2a92
4 изменённых файлов: 20 добавлений и 18 удалений

Просмотреть файл

@ -96,7 +96,7 @@ typedef struct {
/* Query replace dialog */ /* Query replace dialog */
Dlg_head *replace_dlg; Dlg_head *replace_dlg;
char *replace_filename; const char *replace_filename;
int replace_result; int replace_result;
struct stat *s_stat, *d_stat; struct stat *s_stat, *d_stat;
} FileOpContextUI; } FileOpContextUI;
@ -171,8 +171,8 @@ file_op_context_create_ui (FileOpContext *ctx, int with_eta)
int x_size; int x_size;
int minus; int minus;
int eta_offset; int eta_offset;
char *sixty; const char *sixty;
char *fifteen; const char *fifteen;
g_return_if_fail (ctx != NULL); g_return_if_fail (ctx != NULL);
g_return_if_fail (ctx->ui == NULL); g_return_if_fail (ctx->ui == NULL);
@ -506,7 +506,7 @@ file_progress_show_deleting (FileOpContext *ctx, const char *s)
* alex * alex
*/ */
static struct { static struct {
char *text; const char *text;
int ypos, xpos; int ypos, xpos;
int value; /* 0 for labels */ int value; /* 0 for labels */
} rd_widgets[] = { } rd_widgets[] = {

Просмотреть файл

@ -28,7 +28,7 @@
#include "global.h" #include "global.h"
static char * static char *
get_absolute_name (char *file) get_absolute_name (const char *file)
{ {
char dir[MC_MAXPATHLEN]; char dir[MC_MAXPATHLEN];
@ -70,9 +70,10 @@ my_mkdir_rec (char *s, mode_t mode)
} }
int int
my_mkdir (char *s, mode_t mode) my_mkdir (const char *s, mode_t mode)
{ {
int result; int result;
char *my_s;
result = mc_mkdir (s, mode); result = mc_mkdir (s, mode);
if (result) { if (result) {
@ -82,21 +83,22 @@ my_mkdir (char *s, mode_t mode)
g_free (p); g_free (p);
} }
if (result == 0) { if (result == 0) {
s = get_absolute_name (s); my_s = get_absolute_name (s);
#ifdef FIXME #ifdef FIXME
tree_add_entry (tree, s); tree_add_entry (tree, my_s);
#endif #endif
g_free (s); g_free (my_s);
} }
return result; return result;
} }
int int
my_rmdir (char *s) my_rmdir (const char *s)
{ {
int result; int result;
char *my_s;
#ifdef FIXME #ifdef FIXME
WTree *tree = 0; WTree *tree = 0;
#endif #endif
@ -104,13 +106,13 @@ my_rmdir (char *s)
/* FIXME: Should receive a Wtree! */ /* FIXME: Should receive a Wtree! */
result = mc_rmdir (s); result = mc_rmdir (s);
if (result == 0) { if (result == 0) {
s = get_absolute_name (s); my_s = get_absolute_name (s);
#ifdef FIXME #ifdef FIXME
tree_remove_entry (tree, s); tree_remove_entry (tree, my_s);
#endif #endif
g_free (s); g_free (my_s);
} }
return result; return result;
} }

Просмотреть файл

@ -115,7 +115,7 @@ FileOpContext *file_op_context_new (FileOperation op);
void file_op_context_destroy (FileOpContext *ctx); void file_op_context_destroy (FileOpContext *ctx);
extern char *op_names [3]; extern const char *op_names [3];
typedef enum { typedef enum {
FILE_CONT, FILE_CONT,

Просмотреть файл

@ -173,15 +173,15 @@ find_parameters (char **start_dir, char **pattern, char **content)
{ {
int return_value; int return_value;
char *temp_dir; 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_contents = NULL;
static char *in_start_dir = NULL; static char *in_start_dir = NULL;
static char *in_start_name = NULL; static char *in_start_name = NULL;
static char *labs[] = static const char *labs[] =
{ N_("Start at:"), N_("Filename:"), N_("Content: ") }; { 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 ilen = 30, istart = 14;
static int b0 = 3, b1 = 16, b2 = 36; static int b0 = 3, b1 = 16, b2 = 36;
@ -611,7 +611,7 @@ do_search (struct Dlg_head *h)
count++; count++;
if (!(count & 31)){ if (!(count & 31)){
/* For nice updating */ /* For nice updating */
char *rotating_dash = "|/-\\"; const char *rotating_dash = "|/-\\";
if (verbose){ if (verbose){
pos = (pos + 1) % 4; pos = (pos + 1) % 4;