From cc81436f8193c57fafd5e79896b11964886a563f Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 5 Jun 2005 19:08:59 +0000 Subject: [PATCH] move check_linenumbers() down so that it's near the other debugging routines git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2592 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/proto.h | 6 +++--- src/winio.c | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/proto.h b/src/proto.h index 1d9ba95d..14eeadf1 100644 --- a/src/proto.h +++ b/src/proto.h @@ -668,9 +668,6 @@ void set_modified(void); void statusbar(const char *msg, ...); void bottombars(const shortcut *s); void onekey(const char *keystroke, const char *desc, size_t len); -#ifndef NDEBUG -int check_linenumbers(const filestruct *fileptr); -#endif size_t get_page_start(size_t column); void reset_cursor(void); void edit_add(const filestruct *fileptr, const char *converted, int @@ -693,6 +690,9 @@ size_t help_line_len(const char *ptr); void do_help(void); #endif void do_replace_highlight(bool highlight_flag, const char *word); +#ifndef NDEBUG +int check_linenumbers(const filestruct *fileptr); +#endif #ifdef DEBUG void dump_buffer(const filestruct *inptr); void dump_buffer_reverse(void); diff --git a/src/winio.c b/src/winio.c index eb706117..22128bd6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2969,19 +2969,6 @@ void onekey(const char *keystroke, const char *desc, size_t len) } } -/* And so start the display update routines. */ -#ifndef NDEBUG -int check_linenumbers(const filestruct *fileptr) -{ - int check_line = 0; - const filestruct *filetmp; - - for (filetmp = edittop; filetmp != fileptr; filetmp = filetmp->next) - check_line++; - return check_line; -} -#endif - /* nano scrolls horizontally within a line in chunks. This function * returns the column number of the first character displayed in the * window when the cursor is at the given column. Note that @@ -3979,6 +3966,21 @@ void do_replace_highlight(bool highlight_flag, const char *word) wattroff(edit, A_REVERSE); } +#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 = edittop; filetmp != fileptr; filetmp = filetmp->next) + check_line++; + + return check_line; +} +#endif + #ifdef DEBUG /* Dump the passed-in file structure to stderr. */ void dump_buffer(const filestruct *inptr)