* *.c: Removed unused parameters for static functions. Marked
unused parameters for global functions. Removed redundant comments.
Этот коммит содержится в:
родитель
9004ac497f
Коммит
2a281ad18d
@ -1,6 +1,9 @@
|
|||||||
2005-02-07 Roland Illig <roland.illig@gmx.de>
|
2005-02-07 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
* *.c: Removed trailing whitespace.
|
* *.c: Removed trailing whitespace.
|
||||||
|
* *.c: Removed unused parameters for static functions. Marked
|
||||||
|
unused parameters for global functions. Removed redundant
|
||||||
|
comments.
|
||||||
|
|
||||||
2005-02-07 Roland Illig <roland.illig@gmx.de>
|
2005-02-07 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
static inline struct _book_mark *double_marks (WEdit * edit, struct _book_mark *p)
|
static inline struct _book_mark *double_marks (WEdit * edit, struct _book_mark *p)
|
||||||
{
|
{
|
||||||
|
(void) edit;
|
||||||
|
|
||||||
if (p->next)
|
if (p->next)
|
||||||
while (p->next->line == p->line)
|
while (p->next->line == p->line)
|
||||||
p = p->next;
|
p = p->next;
|
||||||
|
@ -624,17 +624,13 @@ edit_delete_macro (WEdit * edit, int k)
|
|||||||
return 0;
|
return 0;
|
||||||
g = fopen (catstrs (home_dir, TEMP_FILE, (char *) NULL), "w");
|
g = fopen (catstrs (home_dir, TEMP_FILE, (char *) NULL), "w");
|
||||||
if (!g) {
|
if (!g) {
|
||||||
/* This heads the delete macro error dialog box */
|
|
||||||
edit_error_dialog (_(" Delete macro "),
|
edit_error_dialog (_(" Delete macro "),
|
||||||
/* 'Open' = load temp file */
|
|
||||||
get_sys_error (_(" Cannot open temp file ")));
|
get_sys_error (_(" Cannot open temp file ")));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
f = edit_open_macro_file ("r");
|
f = edit_open_macro_file ("r");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
/* This heads the delete macro error dialog box */
|
|
||||||
edit_error_dialog (_(" Delete macro "),
|
edit_error_dialog (_(" Delete macro "),
|
||||||
/* 'Open' = load temp file */
|
|
||||||
get_sys_error (_(" Cannot open macro file ")));
|
get_sys_error (_(" Cannot open macro file ")));
|
||||||
fclose (g);
|
fclose (g);
|
||||||
return 1;
|
return 1;
|
||||||
@ -657,7 +653,6 @@ edit_delete_macro (WEdit * edit, int k)
|
|||||||
fclose (f);
|
fclose (f);
|
||||||
fclose (g);
|
fclose (g);
|
||||||
if (rename (catstrs (home_dir, TEMP_FILE, (char *) NULL), catstrs (home_dir, MACRO_FILE, (char *) NULL)) == -1) {
|
if (rename (catstrs (home_dir, TEMP_FILE, (char *) NULL), catstrs (home_dir, MACRO_FILE, (char *) NULL)) == -1) {
|
||||||
/* This heads the delete macro error dialog box */
|
|
||||||
edit_error_dialog (_(" Delete macro "),
|
edit_error_dialog (_(" Delete macro "),
|
||||||
get_sys_error (_(" Cannot overwrite macro file ")));
|
get_sys_error (_(" Cannot overwrite macro file ")));
|
||||||
return 1;
|
return 1;
|
||||||
@ -674,10 +669,8 @@ int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n)
|
|||||||
int s, i;
|
int s, i;
|
||||||
|
|
||||||
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
||||||
/* This heads the 'Macro' dialog box */
|
|
||||||
s = edit_raw_key_query (_(" Save macro "),
|
s = edit_raw_key_query (_(" Save macro "),
|
||||||
/* Input line for a single key press follows the ':' */
|
_(" Press the macro's new hotkey: "), 1);
|
||||||
_(" Press the macro's new hotkey: "), 1);
|
|
||||||
edit->force |= REDRAW_COMPLETELY;
|
edit->force |= REDRAW_COMPLETELY;
|
||||||
if (s) {
|
if (s) {
|
||||||
if (edit_delete_macro (edit, s))
|
if (edit_delete_macro (edit, s))
|
||||||
@ -695,7 +688,6 @@ int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
/* This heads the 'Save Macro' dialog box */
|
|
||||||
edit_error_dialog (_(" Save macro "), get_sys_error (_(" Cannot open macro file ")));
|
edit_error_dialog (_(" Save macro "), get_sys_error (_(" Cannot open macro file ")));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -751,7 +743,6 @@ int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k)
|
|||||||
fclose (f);
|
fclose (f);
|
||||||
return found;
|
return found;
|
||||||
} else
|
} else
|
||||||
/* This heads the 'Load Macro' dialog box */
|
|
||||||
edit_error_dialog (_(" Load macro "),
|
edit_error_dialog (_(" Load macro "),
|
||||||
get_sys_error (_(" Cannot open macro file ")));
|
get_sys_error (_(" Cannot open macro file ")));
|
||||||
return 0;
|
return 0;
|
||||||
@ -766,7 +757,6 @@ int edit_save_confirm_cmd (WEdit * edit)
|
|||||||
|
|
||||||
if (edit_confirm_save) {
|
if (edit_confirm_save) {
|
||||||
f = catstrs (_(" Confirm save file? : "), edit->filename, " ", (char *) NULL);
|
f = catstrs (_(" Confirm save file? : "), edit->filename, " ", (char *) NULL);
|
||||||
/* Buttons to 'Confirm save file' query */
|
|
||||||
if (edit_query_dialog2 (_(" Save file "), f, _("&Save"), _("&Cancel")))
|
if (edit_query_dialog2 (_(" Save file "), f, _("&Save"), _("&Cancel")))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1743,7 +1733,6 @@ err:
|
|||||||
|
|
||||||
static void regexp_error (WEdit *edit)
|
static void regexp_error (WEdit *edit)
|
||||||
{
|
{
|
||||||
/* "Error: Syntax error in regular expression, or scanf expression contained too many %'s */
|
|
||||||
edit_error_dialog (_("Error"), _(" Invalid regular expression, or scanf expression with too many conversions "));
|
edit_error_dialog (_("Error"), _(" Invalid regular expression, or scanf expression with too many conversions "));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,15 +50,16 @@ struct lock_s {
|
|||||||
|
|
||||||
/* Build user@host.domain.pid string (need to be freed) */
|
/* Build user@host.domain.pid string (need to be freed) */
|
||||||
static char *
|
static char *
|
||||||
lock_build_name (const char *fname)
|
lock_build_name (void)
|
||||||
{
|
{
|
||||||
char host[BUF_SIZE];
|
char host[BUF_SIZE];
|
||||||
const char *user;
|
const char *user;
|
||||||
|
|
||||||
if (!
|
user = getpwuid (getuid ())->pw_name;
|
||||||
((user = getpwuid (getuid ())->pw_name) || (user = getenv ("USER"))
|
if (!user) user = getenv ("USER");
|
||||||
|| (user = getenv ("USERNAME")) || (user = getenv ("LOGNAME"))))
|
if (!user) user = getenv ("USERNAME");
|
||||||
user = "";
|
if (!user) user = getenv ("LOGNAME");
|
||||||
|
if (!user) user = "";
|
||||||
|
|
||||||
/* TODO: Use FQDN, no clean interface, so requires lot of code */
|
/* TODO: Use FQDN, no clean interface, so requires lot of code */
|
||||||
if (gethostname (host, BUF_SIZE - 1) == -1)
|
if (gethostname (host, BUF_SIZE - 1) == -1)
|
||||||
@ -167,7 +168,7 @@ edit_lock_file (const char *fname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create lock symlink */
|
/* Create lock symlink */
|
||||||
newlock = lock_build_name (fname);
|
newlock = lock_build_name ();
|
||||||
if (symlink (newlock, lockfname) == -1) {
|
if (symlink (newlock, lockfname) == -1) {
|
||||||
g_free (lockfname);
|
g_free (lockfname);
|
||||||
g_free (newlock);
|
g_free (newlock);
|
||||||
|
@ -93,6 +93,8 @@ mc_defines_destroy (gpointer key, gpointer value, gpointer data)
|
|||||||
{
|
{
|
||||||
char **values = value;
|
char **values = value;
|
||||||
|
|
||||||
|
(void) data;
|
||||||
|
|
||||||
g_free (key);
|
g_free (key);
|
||||||
while (*values)
|
while (*values)
|
||||||
g_free (*values++);
|
g_free (*values++);
|
||||||
|
@ -181,8 +181,8 @@ static int line_pixel_length (unsigned char *t, long b, int l)
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the start of a word */
|
static int
|
||||||
static int next_word_start (unsigned char *t, int q, int size)
|
next_word_start (unsigned char *t, int q)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = q;; i++) {
|
for (i = q;; i++) {
|
||||||
@ -203,11 +203,12 @@ static int next_word_start (unsigned char *t, int q, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* find the start of a word */
|
/* find the start of a word */
|
||||||
static int word_start (unsigned char *t, int q, int size)
|
static int
|
||||||
|
word_start (unsigned char *t, int q)
|
||||||
{
|
{
|
||||||
int i = q;
|
int i = q;
|
||||||
if (t[q] == ' ' || t[q] == '\t')
|
if (t[q] == ' ' || t[q] == '\t')
|
||||||
return next_word_start (t, q, size);
|
return next_word_start (t, q);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int c;
|
int c;
|
||||||
if (!i)
|
if (!i)
|
||||||
@ -236,9 +237,9 @@ static void format_this (unsigned char *t, int size, int indent)
|
|||||||
break;
|
break;
|
||||||
if (t[q] == '\n')
|
if (t[q] == '\n')
|
||||||
break;
|
break;
|
||||||
p = word_start (t, q, size);
|
p = word_start (t, q);
|
||||||
if (p == -1)
|
if (p == -1)
|
||||||
q = next_word_start (t, q, size); /* Return the end of the word if the beginning
|
q = next_word_start (t, q); /* Return the end of the word if the beginning
|
||||||
of the word is at the beginning of a line
|
of the word is at the beginning of a line
|
||||||
(i.e. a very long word) */
|
(i.e. a very long word) */
|
||||||
else
|
else
|
||||||
@ -258,7 +259,8 @@ static void replace_at (WEdit * edit, long q, int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* replaces a block of text */
|
/* replaces a block of text */
|
||||||
static void put_paragraph (WEdit * edit, unsigned char *t, long p, long q, int indent, int size)
|
static void
|
||||||
|
put_paragraph (WEdit * edit, unsigned char *t, long p, int indent, int size)
|
||||||
{
|
{
|
||||||
long cursor;
|
long cursor;
|
||||||
int i, c = 0;
|
int i, c = 0;
|
||||||
@ -342,7 +344,7 @@ format_paragraph (WEdit *edit, int force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
format_this (t, q - p, indent);
|
format_this (t, q - p, indent);
|
||||||
put_paragraph (edit, t, p, q, indent, size);
|
put_paragraph (edit, t, p, indent, size);
|
||||||
g_free (t);
|
g_free (t);
|
||||||
|
|
||||||
/* Scroll left as much as possible to show the formatted paragraph */
|
/* Scroll left as much as possible to show the formatted paragraph */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user