in update_line(), remove unneeded assert, and now-unused function

check_linenumbers()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3676 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-06-21 16:54:51 +00:00
parent d4401008a4
commit 5c878088a1
4 changed files with 6 additions and 22 deletions

View File

@ -383,6 +383,10 @@ CVS code -
This matches the manual page. (DLR) This matches the manual page. (DLR)
nperror() nperror()
- Simplify. (DLR) - Simplify. (DLR)
check_linenumbers()
- Removed, as it's no longer used, and since there's no way to
tell if its return value will be in int or ssize_t range.
(DLR)
- winio.c: - winio.c:
parse_kbinput() parse_kbinput()
- If we get NANO_CONTROL_8, properly handle it in all cases. - If we get NANO_CONTROL_8, properly handle it in all cases.
@ -416,6 +420,8 @@ CVS code -
well as single-line ones. This avoids a segfault when trying well as single-line ones. This avoids a segfault when trying
to color e.g. "start="$" end="$"". (DLR, found by Trevor to color e.g. "start="$" end="$"". (DLR, found by Trevor
Caira) Caira)
update_line()
- Remove unneeded assert. (DLR)
edit_redraw() edit_redraw()
- Fix problem where not all lines would be updated properly if - Fix problem where not all lines would be updated properly if
we'd scrolled off the screen and the mark was on. (DLR) we'd scrolled off the screen and the mark was on. (DLR)

View File

@ -704,9 +704,6 @@ void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up); **bot, size_t *bot_x, bool *right_side_up);
#endif #endif
size_t get_totsize(const filestruct *begin, const filestruct *end); size_t get_totsize(const filestruct *begin, const filestruct *end);
#ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr);
#endif
#ifdef DEBUG #ifdef DEBUG
void dump_filestruct(const filestruct *inptr); void dump_filestruct(const filestruct *inptr);
void dump_filestruct_reverse(void); void dump_filestruct_reverse(void);

View File

@ -581,22 +581,6 @@ size_t get_totsize(const filestruct *begin, const filestruct *end)
return totsize; return totsize;
} }
#ifndef NDEBUG
/* Return what the current line number should be, starting at edittop
* and ending at fileptr. */
int check_linenumbers(const filestruct *fileptr)
{
int check_line = 0;
const filestruct *filetmp;
for (filetmp = openfile->edittop; filetmp != fileptr;
filetmp = filetmp->next)
check_line++;
return check_line;
}
#endif /* !NDEBUG */
#ifdef DEBUG #ifdef DEBUG
/* Dump the filestruct inptr to stderr. */ /* Dump the filestruct inptr to stderr. */
void dump_filestruct(const filestruct *inptr) void dump_filestruct(const filestruct *inptr)

View File

@ -2635,9 +2635,6 @@ void update_line(const filestruct *fileptr, size_t index)
line = fileptr->lineno - openfile->edittop->lineno; line = fileptr->lineno - openfile->edittop->lineno;
/* We assume the line numbers are valid. Is that really true? */
assert(line < 0 || line == check_linenumbers(fileptr));
if (line < 0 || line >= editwinrows) if (line < 0 || line >= editwinrows)
return; return;