Code cleanup and fixed compiler warning.

This commit is contained in:
Lukas Fleischer 2011-01-11 22:31:40 +00:00
parent c8af480f52
commit 521511aa93
2 changed files with 31 additions and 27 deletions

View File

@ -1,3 +1,7 @@
2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de>
* src/help.c: Code cleanup and fixed compiler warning.
2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de> 2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de>
* src/calcurse.h * src/calcurse.h

View File

@ -1,4 +1,4 @@
/* $calcurse: help.c,v 1.44 2010/03/21 10:17:03 culot Exp $ */ /* $calcurse: help.c,v 1.45 2011/01/11 22:31:40 fleischer Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -743,17 +743,17 @@ help_screen (void)
{ {
erase_window_part (hwin.win.p, 1, hwin.pad.y, col - 2, erase_window_part (hwin.win.p, 1, hwin.pad.y, col - 2,
hwin.win.h - 2); hwin.win.h - 2);
switch (ch)
{ if ((int) ch == KEY_RESIZE) {
case KEY_RESIZE:
wins_get_config (); wins_get_config ();
help_wins_reset (&hwin); help_wins_reset (&hwin);
hwin.first_visible_line = 0; hwin.first_visible_line = 0;
hwin.total_lines = help_write_pad (&hwin.pad, hscr[oldpage].title, hwin.total_lines = help_write_pad (&hwin.pad, hscr[oldpage].title,
hscr[oldpage].text, ch); hscr[oldpage].text, ch);
need_resize = 1; need_resize = 1;
break; }
else {
switch (ch) {
case KEY_GENERIC_SCROLL_DOWN: case KEY_GENERIC_SCROLL_DOWN:
wins_scrollwin_down (&hwin, 1); wins_scrollwin_down (&hwin, 1);
break; break;
@ -764,15 +764,15 @@ help_screen (void)
default: default:
page = wanted_page (ch); page = wanted_page (ch);
if (page != NOPAGE) if (page != NOPAGE) {
{
hwin.first_visible_line = 0; hwin.first_visible_line = 0;
hwin.total_lines = help_write_pad (&hwin.pad, hscr[page].title, hwin.total_lines = help_write_pad (&hwin.pad, hscr[page].title,
hscr[page].text, ch); hscr[page].text, ch);
oldpage = page; oldpage = page;
} }
break;
} }
}
wins_scrollwin_display (&hwin); wins_scrollwin_display (&hwin);
ch = keys_getch (win[STA].p); ch = keys_getch (win[STA].p);
} }