diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2016-01-12 17:48:05 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2016-01-12 17:48:05 +0000 |
commit | 63d0fb8cc733c803759c2988104efa96778d311e (patch) | |
tree | c15c845daf564a701453d11c9161f00041bb83fc /usr.bin | |
parent | 521f9e34766ca527fa339268f6a33b603dca4d50 (diff) |
Remove LINUNUM, a needless alias for off_t. Also, remove a redundant
condition.
ok nicm@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/less/cmdbuf.c | 4 | ||||
-rw-r--r-- | usr.bin/less/command.c | 2 | ||||
-rw-r--r-- | usr.bin/less/funcs.h | 14 | ||||
-rw-r--r-- | usr.bin/less/jump.c | 2 | ||||
-rw-r--r-- | usr.bin/less/less.h | 5 | ||||
-rw-r--r-- | usr.bin/less/line.c | 2 | ||||
-rw-r--r-- | usr.bin/less/linenum.c | 18 | ||||
-rw-r--r-- | usr.bin/less/output.c | 4 | ||||
-rw-r--r-- | usr.bin/less/prompt.c | 6 | ||||
-rw-r--r-- | usr.bin/less/search.c | 2 | ||||
-rw-r--r-- | usr.bin/less/tags.c | 8 |
11 files changed, 33 insertions, 34 deletions
diff --git a/usr.bin/less/cmdbuf.c b/usr.bin/less/cmdbuf.c index 33ce27031e8..638db93375e 100644 --- a/usr.bin/less/cmdbuf.c +++ b/usr.bin/less/cmdbuf.c @@ -1147,11 +1147,11 @@ retry: /* * Return the number currently in the command buffer. */ -LINENUM +off_t cmd_int(long *frac) { char *p; - LINENUM n = 0; + off_t n = 0; int err; for (p = cmdbuf; *p >= '0' && *p <= '9'; p++) diff --git a/usr.bin/less/command.c b/usr.bin/less/command.c index 5d5589a69f1..e6326ad1fb5 100644 --- a/usr.bin/less/command.c +++ b/usr.bin/less/command.c @@ -52,7 +52,7 @@ extern int forw_prompt; static int mca; /* The multicharacter command (action) */ static int search_type; /* The previous type of search */ -static LINENUM number; /* The number typed by the user */ +static off_t number; /* The number typed by the user */ static long fraction; /* The fractional part of the number */ static struct loption *curropt; static int opt_lower; diff --git a/usr.bin/less/funcs.h b/usr.bin/less/funcs.h index bec47fd6448..c80b92ded58 100644 --- a/usr.bin/less/funcs.h +++ b/usr.bin/less/funcs.h @@ -78,7 +78,7 @@ extern void set_mlist(void *, int); extern void cmd_addhist(struct mlist *, const char *); extern void cmd_accept(void); extern int cmd_char(int); -extern LINENUM cmd_int(long *); +extern off_t cmd_int(long *); extern char *get_cmdbuf(void); extern char *cmd_lastpattern(void); extern void init_cmdhist(void); @@ -161,7 +161,7 @@ extern off_t forw_line(off_t); extern off_t back_line(off_t); extern void set_attnpos(off_t); extern void jump_forw(void); -extern void jump_back(LINENUM); +extern void jump_back(off_t); extern void repaint(void); extern void jump_percent(int, long); extern void jump_line_loc(off_t, int); @@ -169,7 +169,7 @@ extern void jump_loc(off_t, int); extern void init_line(void); extern int is_ascii_char(LWCHAR); extern void prewind(void); -extern void plinenum(LINENUM); +extern void plinenum(off_t); extern void pshift_all(void); extern int is_ansi_end(LWCHAR); extern int is_ansi_middle(LWCHAR); @@ -182,10 +182,10 @@ extern void null_line(void); extern off_t forw_raw_line(off_t, char **, int *); extern off_t back_raw_line(off_t, char **, int *); extern void clr_linenum(void); -extern void add_lnum(LINENUM, off_t); -extern LINENUM find_linenum(off_t); -extern off_t find_pos(LINENUM); -extern LINENUM currline(int); +extern void add_lnum(off_t, off_t); +extern off_t find_linenum(off_t); +extern off_t find_pos(off_t); +extern off_t currline(int); extern void lsystem(const char *, const char *); extern int pipe_mark(int, char *); extern void init_mark(void); diff --git a/usr.bin/less/jump.c b/usr.bin/less/jump.c index c6873c8ecbf..b700d319a83 100644 --- a/usr.bin/less/jump.c +++ b/usr.bin/less/jump.c @@ -63,7 +63,7 @@ jump_forw(void) * Jump to line n in the file. */ void -jump_back(LINENUM linenum) +jump_back(off_t linenum) { off_t pos; PARG parg; diff --git a/usr.bin/less/less.h b/usr.bin/less/less.h index 1bf2b56a340..1f8d9a1b32f 100644 --- a/usr.bin/less/less.h +++ b/usr.bin/less/less.h @@ -72,7 +72,6 @@ * Special types and constants. */ typedef unsigned long LWCHAR; -typedef off_t LINENUM; #define MIN_LINENUM_WIDTH 7 /* Min printing width of a line number */ #define MAX_UTF_CHAR_LEN 6 /* Max bytes in one UTF-8 char */ @@ -98,7 +97,7 @@ struct scrpos { typedef union parg { char *p_string; int p_int; - LINENUM p_linenum; + off_t p_linenum; } PARG; struct textlist { @@ -207,5 +206,5 @@ struct textlist { /* Functions not included in funcs.h */ void postoa(off_t, char *, size_t); -void linenumtoa(LINENUM, char *, size_t); +void linenumtoa(off_t, char *, size_t); void inttoa(int, char *, size_t); diff --git a/usr.bin/less/line.c b/usr.bin/less/line.c index e2104edd8ad..65796b3568a 100644 --- a/usr.bin/less/line.c +++ b/usr.bin/less/line.c @@ -142,7 +142,7 @@ prewind(void) void plinenum(off_t pos) { - LINENUM linenum = 0; + off_t linenum = 0; int i; if (linenums == OPT_ONPLUS) { diff --git a/usr.bin/less/linenum.c b/usr.bin/less/linenum.c index 7d6c8140f11..8fb4389ff22 100644 --- a/usr.bin/less/linenum.c +++ b/usr.bin/less/linenum.c @@ -44,7 +44,7 @@ struct linenum_info { struct linenum_info *prev; /* Line to previous in the list */ off_t pos; /* File position */ off_t gap; /* Gap between prev and next */ - LINENUM line; /* Line number */ + off_t line; /* Line number */ }; /* * "gap" needs some explanation: the gap of any particular line number @@ -120,7 +120,7 @@ calcgap(struct linenum_info *p) * FIRST character in the specified line. */ void -add_lnum(LINENUM linenum, off_t pos) +add_lnum(off_t linenum, off_t pos) { struct linenum_info *p; struct linenum_info *new; @@ -202,7 +202,7 @@ static time_t startime; static void longish(void) { - if (loopcount >= 0 && ++loopcount > 100) { + if (++loopcount > 100) { loopcount = 0; if (time(NULL) >= startime + LONGTIME) { ierror("Calculating line numbers", NULL); @@ -231,11 +231,11 @@ abort_long(void) * Find the line number associated with a given position. * Return 0 if we can't figure it out. */ -LINENUM +off_t find_linenum(off_t pos) { struct linenum_info *p; - LINENUM linenum; + off_t linenum; off_t cpos; if (!linenums) @@ -340,11 +340,11 @@ find_linenum(off_t pos) * Return -1 if we can't figure it out. */ off_t -find_pos(LINENUM linenum) +find_pos(off_t linenum) { struct linenum_info *p; off_t cpos; - LINENUM clinenum; + off_t clinenum; if (linenum <= 1) /* @@ -411,12 +411,12 @@ find_pos(LINENUM linenum) * The argument "where" tells which line is to be considered * the "current" line (e.g. TOP, BOTTOM, MIDDLE, etc). */ -LINENUM +off_t currline(int where) { off_t pos; off_t len; - LINENUM linenum; + off_t linenum; pos = position(where); len = ch_length(); diff --git a/usr.bin/less/output.c b/usr.bin/less/output.c index 5a683b8fdbf..d2e22900276 100644 --- a/usr.bin/less/output.c +++ b/usr.bin/less/output.c @@ -149,7 +149,7 @@ funcname(type num, char *buf, size_t len) \ } TYPE_TO_A_FUNC(postoa, off_t) -TYPE_TO_A_FUNC(linenumtoa, LINENUM) +TYPE_TO_A_FUNC(linenumtoa, off_t) TYPE_TO_A_FUNC(inttoa, int) /* @@ -169,7 +169,7 @@ iprint_int(int num) * Output a line number in a given radix. */ static int -iprint_linenum(LINENUM num) +iprint_linenum(off_t num) { char buf[INT_STRLEN_BOUND(num)]; diff --git a/usr.bin/less/prompt.c b/usr.bin/less/prompt.c index b7b1ffc4288..6204d75c7c1 100644 --- a/usr.bin/less/prompt.c +++ b/usr.bin/less/prompt.c @@ -128,7 +128,7 @@ ap_pos(off_t pos) * Append a line number to the end of the message. */ static void -ap_linenum(LINENUM linenum) +ap_linenum(off_t linenum) { char buf[INT_STRLEN_BOUND(linenum) + 2]; @@ -234,8 +234,8 @@ protochar(int c, int where) off_t pos; off_t len; int n; - LINENUM linenum; - LINENUM last_linenum; + off_t linenum; + off_t last_linenum; IFILE h; #undef PAGE_NUM diff --git a/usr.bin/less/search.c b/usr.bin/less/search.c index 1c1814fd5bd..e9aa840f176 100644 --- a/usr.bin/less/search.c +++ b/usr.bin/less/search.c @@ -658,7 +658,7 @@ search_range(off_t pos, off_t endpos, int search_type, int matches, char *line; char *cline; int line_len; - LINENUM linenum; + off_t linenum; char *sp, *ep; int line_match; int cvt_ops; diff --git a/usr.bin/less/tags.c b/usr.bin/less/tags.c index a6e5ba52dab..6879140048c 100644 --- a/usr.bin/less/tags.c +++ b/usr.bin/less/tags.c @@ -46,7 +46,7 @@ static struct taglist taglist = { TAG_END, TAG_END }; struct tag { struct tag *next, *prev; /* List links */ char *tag_file; /* Source file containing the tag */ - LINENUM tag_linenum; /* Appropriate line number in source file */ + off_t tag_linenum; /* Appropriate line number in source file */ char *tag_pattern; /* Pattern used to find the tag */ int tag_endline; /* True if the pattern includes '$' */ }; @@ -87,7 +87,7 @@ cleantags(void) * Create a new tag entry. */ static struct tag * -maketagent(char *file, LINENUM linenum, char *pattern, int endline) +maketagent(char *file, off_t linenum, char *pattern, int endline) { struct tag *tp; @@ -194,7 +194,7 @@ findctag(char *tag) char *p; FILE *f; int taglen; - LINENUM taglinenum; + off_t taglinenum; char *tagfile; char *tagpattern; int tagendline; @@ -317,7 +317,7 @@ static off_t ctagsearch(void) { off_t pos, linepos; - LINENUM linenum; + off_t linenum; int len; char *line; |