diff options
Diffstat (limited to 'position.c')
-rw-r--r-- | position.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/position.c b/position.c index a0e4e3a64417e..4f8e60f48c240 100644 --- a/position.c +++ b/position.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2015 Mark Nudelman + * Copyright (C) 1984-2016 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -36,7 +36,8 @@ extern int sc_width, sc_height; * the line after the bottom line on the screen */ public POSITION -position(int where) +position(where) + int where; { switch (where) { @@ -56,9 +57,10 @@ position(int where) * Add a new file position to the bottom of the position table. */ public void -add_forw_pos(POSITION pos) +add_forw_pos(pos) + POSITION pos; { - int i; + register int i; /* * Scroll the position table up. @@ -72,9 +74,10 @@ add_forw_pos(POSITION pos) * Add a new file position to the top of the position table. */ public void -add_back_pos(POSITION pos) +add_back_pos(pos) + POSITION pos; { - int i; + register int i; /* * Scroll the position table down. @@ -88,9 +91,9 @@ add_back_pos(POSITION pos) * Initialize the position table, done whenever we clear the screen. */ public void -pos_clear(void) +pos_clear() { - int i; + register int i; for (i = 0; i < sc_height; i++) table[i] = NULL_POSITION; @@ -100,7 +103,7 @@ pos_clear(void) * Allocate or reallocate the position table. */ public void -pos_init(void) +pos_init() { struct scrpos scrpos; @@ -129,9 +132,10 @@ pos_init(void) * Return the position table entry if found, -1 if not. */ public int -onscreen(POSITION pos) +onscreen(pos) + POSITION pos; { - int i; + register int i; if (pos < table[0]) return (-1); @@ -145,15 +149,17 @@ onscreen(POSITION pos) * See if the entire screen is empty. */ public int -empty_screen(void) +empty_screen() { return (empty_lines(0, sc_height-1)); } public int -empty_lines(int s, int e) +empty_lines(s, e) + int s; + int e; { - int i; + register int i; for (i = s; i <= e; i++) if (table[i] != NULL_POSITION && table[i] != 0) @@ -170,9 +176,10 @@ empty_lines(int s, int e) * the screen line to a number > 0. */ public void -get_scrpos(struct scrpos *scrpos) +get_scrpos(scrpos) + struct scrpos *scrpos; { - int i; + register int i; /* * Find the first line on the screen which has something on it, @@ -201,7 +208,8 @@ get_scrpos(struct scrpos *scrpos) * relative to the bottom of the screen. */ public int -adjsline(int sline) +adjsline(sline) + int sline; { /* * Negative screen line number means |