mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* boxes.c (display_unit): Added const qualifier.
* file.c (check_hardlinks): Likewise. * find.c (find_do_view_edit): Likewise. (find_file): Likewise. * global.h (home_dir): Likewise. * main.c (get_parent_dir_name): Likewise. (init_xterm_support): Likewise. (OS_Setup): Likewise. * menu.c (create_menu): Likewise. * mountlist.c (xatoi): Likewise. (read_filesystem_list): Likewise. * poptconfig.c (poptReadDefaultConfig): Likewise. * popthelp.c (showHelpIntro): Likewise. * rxvt.c (look_for_rxvt_extensions): Likewise. * slint.c (has_colors): Likewise. * subshell.c (check_sid): Likewise. * user.c (check_format_var): Likewise. * widget.c (radio_callback): Likewise.
This commit is contained in:
parent
f02ccb81a0
commit
8b1e87523a
@ -2,7 +2,23 @@
|
||||
|
||||
* view.c (display): Recognize "+\bo" as a list item in nroff mode.
|
||||
Display "_\b_" correctly in both colors.
|
||||
|
||||
* view.c (hex_search): Added const qualifier.
|
||||
* boxes.c (display_unit): Likewise.
|
||||
* file.c (check_hardlinks): Likewise.
|
||||
* find.c (find_do_view_edit): Likewise. (find_file): Likewise.
|
||||
* global.h (home_dir): Likewise.
|
||||
* main.c (get_parent_dir_name): Likewise. (init_xterm_support):
|
||||
Likewise. (OS_Setup): Likewise.
|
||||
* menu.c (create_menu): Likewise.
|
||||
* mountlist.c (xatoi): Likewise. (read_filesystem_list): Likewise.
|
||||
* poptconfig.c (poptReadDefaultConfig): Likewise.
|
||||
* popthelp.c (showHelpIntro): Likewise.
|
||||
* rxvt.c (look_for_rxvt_extensions): Likewise.
|
||||
* slint.c (has_colors): Likewise.
|
||||
* subshell.c (check_sid): Likewise.
|
||||
* user.c (check_format_var): Likewise.
|
||||
* widget.c (radio_callback): Likewise.
|
||||
|
||||
2004-09-25 Pavel Shirshov <pavelsh@mail.ru>
|
||||
|
||||
|
@ -145,7 +145,7 @@ display_init (int radio_sel, char *init_text, int _check_status,
|
||||
|
||||
if (!i18n_displays_flag) {
|
||||
int i, l, maxlen = 0;
|
||||
char *cp;
|
||||
const char *cp;
|
||||
|
||||
display_title = _(display_title);
|
||||
for (i = 0; i < LIST_TYPES; i++) {
|
||||
|
@ -296,7 +296,7 @@ check_hardlinks (const char *src_name, const char *dst_name, struct stat *pstat)
|
||||
ino_t ino = pstat->st_ino;
|
||||
dev_t dev = pstat->st_dev;
|
||||
struct stat link_stat;
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
if (vfs_file_class_flags (src_name) & VFSF_NOLINKS)
|
||||
return 0;
|
||||
@ -321,12 +321,13 @@ check_hardlinks (const char *src_name, const char *dst_name, struct stat *pstat)
|
||||
lp = (struct link *) g_malloc (sizeof (struct link) + strlen (src_name)
|
||||
+ strlen (dst_name) + 1);
|
||||
if (lp) {
|
||||
char *lpdstname;
|
||||
lp->vfs = my_vfs;
|
||||
lp->ino = ino;
|
||||
lp->dev = dev;
|
||||
strcpy (lp->name, src_name);
|
||||
p = strchr (lp->name, 0) + 1;
|
||||
strcpy (p, dst_name);
|
||||
lpdstname = lp->name + strlen(lp->name) + 1;
|
||||
strcpy (lpdstname, dst_name);
|
||||
lp->next = linklist;
|
||||
linklist = lp;
|
||||
}
|
||||
|
@ -709,7 +709,8 @@ init_find_vars (void)
|
||||
static void
|
||||
find_do_view_edit (int unparsed_view, int edit, char *dir, char *file)
|
||||
{
|
||||
char *fullname, *filename;
|
||||
char *fullname;
|
||||
const char *filename;
|
||||
int line;
|
||||
|
||||
if (content_pattern){
|
||||
@ -944,7 +945,7 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,
|
||||
|
||||
for (i = 0; entry && i < find_list->count;
|
||||
entry = entry->next, i++) {
|
||||
char *filename;
|
||||
const char *filename;
|
||||
|
||||
if (!entry->text || !entry->data)
|
||||
continue;
|
||||
|
@ -157,7 +157,7 @@ struct timeval {
|
||||
#include "vfsdummy.h"
|
||||
#endif
|
||||
|
||||
extern char *home_dir;
|
||||
extern const char *home_dir;
|
||||
|
||||
#ifdef min
|
||||
#undef min
|
||||
|
12
src/main.c
12
src/main.c
@ -230,7 +230,7 @@ Dlg_head *midnight_dlg;
|
||||
int update_prompt = 0;
|
||||
|
||||
/* The home directory */
|
||||
char *home_dir = NULL;
|
||||
const char *home_dir = NULL;
|
||||
|
||||
/* The value of the other directory, only used when loading the setup */
|
||||
char *other_dir = NULL;
|
||||
@ -544,10 +544,10 @@ directory_history_add (struct WPanel *panel, const char *dir)
|
||||
*
|
||||
* You do _NOT_ want to add any vfs aware code here. <pavel@ucw.cz>
|
||||
*/
|
||||
static char *
|
||||
static const char *
|
||||
get_parent_dir_name (const char *cwd, const char *lwd)
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
if (strlen (lwd) > strlen (cwd))
|
||||
if ((p = strrchr (lwd, PATH_SEP)) && !strncmp (cwd, lwd, p - lwd)) {
|
||||
return (p + 1);
|
||||
@ -1333,7 +1333,7 @@ setup_pre (void)
|
||||
static void
|
||||
init_xterm_support (void)
|
||||
{
|
||||
char *termvalue;
|
||||
const char *termvalue;
|
||||
#ifdef HAVE_SLANG
|
||||
char *term_entry;
|
||||
#endif
|
||||
@ -1346,7 +1346,7 @@ init_xterm_support (void)
|
||||
|
||||
/* Check mouse capabilities */
|
||||
#ifdef HAVE_SLANG
|
||||
term_entry = SLtt_tigetent (termvalue);
|
||||
term_entry = SLtt_tigetent (const_cast(char *, termvalue));
|
||||
xmouse_seq = SLtt_tigetstr ("Km", &term_entry);
|
||||
#else
|
||||
xmouse_seq = tigetstr ("kmous");
|
||||
@ -1763,7 +1763,7 @@ do_nc (void)
|
||||
static void
|
||||
OS_Setup (void)
|
||||
{
|
||||
char *mc_libdir;
|
||||
const char *mc_libdir;
|
||||
shell = getenv ("SHELL");
|
||||
if (!shell || !*shell) {
|
||||
struct passwd *pwd;
|
||||
|
@ -49,7 +49,7 @@ Menu *
|
||||
create_menu (const char *name, menu_entry *entries, int count, const char *help_node)
|
||||
{
|
||||
Menu *menu;
|
||||
char *cp;
|
||||
const char *cp;
|
||||
|
||||
menu = (Menu *) g_malloc (sizeof (*menu));
|
||||
menu->count = count;
|
||||
|
@ -150,7 +150,7 @@ static struct mount_entry *mount_list = NULL;
|
||||
No prefix (like '0x') or suffix (like 'h') is expected to be
|
||||
part of CP. */
|
||||
|
||||
static int xatoi (char *cp)
|
||||
static int xatoi (const char *cp)
|
||||
{
|
||||
int val;
|
||||
|
||||
@ -242,7 +242,7 @@ read_filesystem_list (int need_fs_type, int all_fs)
|
||||
{
|
||||
struct mntent *mnt;
|
||||
FILE *fp;
|
||||
char *devopt;
|
||||
const char *devopt;
|
||||
|
||||
fp = setmntent (MOUNTED, "r");
|
||||
if (fp == NULL)
|
||||
|
@ -126,7 +126,8 @@ int poptReadConfigFile(poptContext con, const char * fn) {
|
||||
}
|
||||
|
||||
int poptReadDefaultConfig(poptContext con, int useEnv) {
|
||||
char * fn, * home;
|
||||
char *fn;
|
||||
const char* home;
|
||||
int rc;
|
||||
|
||||
if (!con->appName) return 0;
|
||||
|
@ -174,7 +174,7 @@ static void singleTableHelp(FILE * f, const struct poptOption * table,
|
||||
|
||||
static int showHelpIntro(poptContext con, FILE * f) {
|
||||
int len = 6;
|
||||
char * fn;
|
||||
const char * fn;
|
||||
|
||||
fprintf(f, _("Usage:"));
|
||||
if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) {
|
||||
|
@ -33,7 +33,7 @@ static int rxvt_extensions = 0;
|
||||
int look_for_rxvt_extensions (void)
|
||||
{
|
||||
static int been_called = 0;
|
||||
char *e;
|
||||
const char *e;
|
||||
if (!been_called) {
|
||||
rxvt_extensions = 0;
|
||||
e = getenv ("RXVT_EXT");
|
||||
|
@ -359,7 +359,7 @@ vline (int character, int len)
|
||||
|
||||
int has_colors (void)
|
||||
{
|
||||
char *terminal = getenv ("TERM");
|
||||
const char *terminal = getenv ("TERM");
|
||||
char *cts = color_terminal_string, *s;
|
||||
size_t i;
|
||||
|
||||
|
@ -298,7 +298,7 @@ static int
|
||||
check_sid (void)
|
||||
{
|
||||
pid_t my_sid, old_sid;
|
||||
char *sid_str;
|
||||
const char *sid_str;
|
||||
int r;
|
||||
|
||||
sid_str = getenv ("MC_SID");
|
||||
|
@ -116,7 +116,7 @@ int check_format_var (const char *p, char **v)
|
||||
{
|
||||
const char *q = p;
|
||||
char *var_name;
|
||||
char *value;
|
||||
const char *value;
|
||||
const char *dots = 0;
|
||||
|
||||
*v = 0;
|
||||
|
11
src/widget.c
11
src/widget.c
@ -259,7 +259,7 @@ radio_callback (WRadio *r, int msg, int parm)
|
||||
case WIDGET_HOTKEY:
|
||||
{
|
||||
int i, lp = tolower (parm);
|
||||
char *cp;
|
||||
const char *cp;
|
||||
|
||||
for (i = 0; i < r->count; i++) {
|
||||
cp = strchr (r->texts[i], '&');
|
||||
@ -506,7 +506,7 @@ label_callback (WLabel *l, int msg, int parm)
|
||||
|
||||
case WIDGET_DRAW:
|
||||
{
|
||||
char *p = l->text, *q, c = 0;
|
||||
const char *p = l->text, *q;
|
||||
int y = 0;
|
||||
|
||||
if (!l->text)
|
||||
@ -520,18 +520,13 @@ label_callback (WLabel *l, int msg, int parm)
|
||||
int xlen;
|
||||
|
||||
q = strchr (p, '\n');
|
||||
if (q) {
|
||||
c = *q;
|
||||
*q = 0;
|
||||
}
|
||||
widget_move (&l->widget, y, 0);
|
||||
printw ("%s", p);
|
||||
printw ("%.*s", q - p, p);
|
||||
xlen = l->widget.cols - strlen (p);
|
||||
if (xlen > 0)
|
||||
printw ("%*s", xlen, " ");
|
||||
if (!q)
|
||||
break;
|
||||
*q = c;
|
||||
p = q + 1;
|
||||
y++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user