AmendHub

Download:

jcs

/

subtext

/

amendments

/

372

console: Minor fixes suggested by cppcheck


jcs made amendment 372 about 1 year ago
--- console.c Wed Mar 1 22:48:21 2023 +++ console.c Tue Mar 7 22:38:02 2023 @@ -143,7 +143,7 @@ console_idle(struct focusable *focusable, EventRecord struct console *console = (struct console *)focusable->cookie; struct session *session = console->session; GrafPtr old_port; - short n, cursor, iac = 0; + short n, cursor; if (session->obuflen == 0) return; @@ -154,7 +154,7 @@ console_idle(struct focusable *focusable, EventRecord /* uncursor */ cursor = (console->cursor_line * console->ncolumns) + console->cursor_column; - if (cursor >= sizeof(console->attrs)) + if (cursor >= sizeof(console->attrs) - 1) panic("console_idle: cursor out of bounds!"); console->attrs[cursor] &= ~ATTR_CURSOR; console->attrs[cursor] |= ATTR_DIRTY; @@ -516,7 +516,8 @@ console_erase_chars(struct console *console, short sta eraser.right = eraser.left + (end_col * FONT_WIDTH); else eraser.right = eraser.left + (console->ncolumns * FONT_WIDTH); - FillRect(&eraser, console->cur_attr & ATTR_REVERSE ? black : white); + FillRect(&eraser, + (console->cur_attr & ATTR_REVERSE) ? black : white); } }