(key_pending) [!GTK]: Warning fix.

This commit is contained in:
Andrew V. Samoilov 2001-05-31 00:43:04 +00:00
parent cd8d6460bd
commit daa8e84176
2 changed files with 13 additions and 28 deletions

View File

@ -9,8 +9,9 @@
sprintf (s, "%s", ). sprintf (s, "%s", ).
(set_color) [MIDNIGHT]: Became a macro. (set_color) [MIDNIGHT]: Became a macro.
(render_edit_text) [!defined(MIDNIGHT) && !defined(GTK)]: Warning fix. (render_edit_text) [defined(MIDNIGHT) || defined(GTK)]: Warning fix.
(edit_render) [GTK]: Eliminate win variable. (edit_render) [GTK]: Eliminate win variable.
(key_pending) [!GTK]: Warning fix.
2001-05-30 Pavel Roskin <proski@gnu.org> 2001-05-30 Pavel Roskin <proski@gnu.org>

View File

@ -39,9 +39,6 @@ extern int column_highlighting;
static void status_string (WEdit * edit, char *s, int w, int fill, int font_width) static void status_string (WEdit * edit, char *s, int w, int fill, int font_width)
{ {
#ifdef MIDNIGHT
int i;
#endif
char byte_str[16]; char byte_str[16];
/* /*
@ -76,16 +73,6 @@ static void status_string (WEdit * edit, char *s, int w, int fill, int font_widt
edit->curs1, edit->curs1,
edit->last_byte, edit->last_byte,
byte_str); byte_str);
#ifdef MIDNIGHT
/*
* Make string exactly w chars wide
* Fill the remainder with the fill char
*/
i = strlen (s);
memset (s + i, fill, w - i);
s[w] = 0;
#endif
} }
#endif #endif
@ -107,17 +94,17 @@ void edit_status (WEdit * edit)
widget_move (edit, edit->have_frame, edit->have_frame); widget_move (edit, edit->have_frame, edit->have_frame);
i = w > 24 ? 18 : w - 6; i = w > 24 ? 18 : w - 6;
i = i < 13 ? 13 : i; i = i < 13 ? 13 : i;
sprintf (s, "%s", (char *) name_trunc (edit->filename ? edit->filename : "", i)); strcpy (s, (char *) name_trunc (edit->filename ? edit->filename : "", i));
i += strlen (s); i = strlen (s);
s[strlen (s)] = ' '; s[i] = ' ';
t = w - 20; t = w - 20;
if (t < 0) if (t < 0)
t = 0; t = 0;
status_string (edit, s + 20, t, ' ', 1); status_string (edit, s + 20, t, ' ', 1);
} else {
s[w] = 0;
} }
printw ("%.*s", w, s); s[w] = 0;
printw ("%-*s", w, s);
attrset (NORMAL_COLOR); attrset (NORMAL_COLOR);
free (s); free (s);
} }
@ -143,7 +130,7 @@ void edit_status (WEdit *edit)
if (w > 1) { if (w > 1) {
i = w > 24 ? 18 : w - 6; i = w > 24 ? 18 : w - 6;
i = i < 13 ? 13 : i; i = i < 13 ? 13 : i;
sprintf (s, "%s", (char *) name_trunc (edit->filename ? edit->filename : "", i)); strcpy (s, (char *) name_trunc (edit->filename ? edit->filename : "", i));
i = strlen (s); i = strlen (s);
s[i] = ' '; s[i] = ' ';
s[i + 1] = ' '; s[i + 1] = ' ';
@ -205,9 +192,9 @@ void edit_status (WEdit * edit)
CPopFont (); CPopFont ();
} }
#endif #endif /* GTK */
#endif #endif /* MIDNIGHT */
/* boolean */ /* boolean */
@ -339,10 +326,7 @@ void edit_set_cursor_color (unsigned long c)
#else #else
static void set_color (int font) #define set_color(font) attrset (font)
{
attrset (font);
}
#define edit_move(x,y) widget_move(edit, y, x); #define edit_move(x,y) widget_move(edit, y, x);
@ -489,10 +473,10 @@ int option_smooth_scrolling = 0;
static int key_pending (WEdit * edit) static int key_pending (WEdit * edit)
{ {
static int flush = 0, line = 0;
#ifdef GTK #ifdef GTK
/* ******* */ /* ******* */
#else #else
static int flush = 0, line = 0;
if (!edit) { if (!edit) {
flush = line = 0; flush = line = 0;
} else if (!(edit->force & REDRAW_COMPLETELY) && !EditExposeRedraw && !option_smooth_scrolling) { } else if (!(edit->force & REDRAW_COMPLETELY) && !EditExposeRedraw && !option_smooth_scrolling) {