Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Jun 29, 2009
1 parent 381f9b5 commit f29af75
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 524 deletions.
4 changes: 2 additions & 2 deletions Makefile.aut
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ srcdir = .

SRC = \
main.c screen.c brac.c ch.c charset.c cmdbuf.c \
command.c decode.c edit.c filename.c forwback.c \
command.c cvt.c decode.c edit.c filename.c forwback.c \
help.c ifile.c input.c jump.c line.c linenum.c \
lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
output.c position.c prompt.c search.c signal.c \
output.c pattern.c position.c prompt.c search.c signal.c \
tags.c ttyin.c version.c
DISTFILES_W = \
defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \
Expand Down
13 changes: 7 additions & 6 deletions Makefile.dsb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ EXT = .EXE
.c.obj:
$(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $<

OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
tags.obj ttyin.obj version.obj

all: less$(EXT) lesskey$(EXT)

Expand Down
7 changes: 4 additions & 3 deletions Makefile.dsg
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ manext = 1
.c.o:
${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O}

all: less lesskey lessecho
Expand Down
13 changes: 7 additions & 6 deletions Makefile.dsu
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\graphics.lib
.c.obj:
$(CC) -c -I. -I$(INCDIR) $(CPPFLAGS) $(CFLAGS) $<

OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
tags.obj ttyin.obj version.obj

all: less lesskey

Expand Down
7 changes: 4 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ SHELL = /bin/sh
.c.o:
${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} @REGEX_O@

all: less$(EXEEXT) lesskey$(EXEEXT) lessecho$(EXEEXT)
Expand Down
7 changes: 4 additions & 3 deletions Makefile.o2e
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ O = obj
.c.${O}:
${CC} -c ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}

all: less.exe lesskey.exe scrsize.exe
Expand Down
7 changes: 4 additions & 3 deletions Makefile.o9c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ O = r
.c.${O}:
${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}

all: less lessecho lesskey
Expand Down
7 changes: 4 additions & 3 deletions Makefile.o9g
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ O = r
.c.${O}:
${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}

all: less lesskey
Expand Down
7 changes: 4 additions & 3 deletions Makefile.o9u
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ O = r
.c.${O}:
${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} regexp.${O}

all: less lesskey
Expand Down
13 changes: 7 additions & 6 deletions Makefile.wnb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ LIBS = ${LIBDIR}\import32.lib ${LIBDIR}\cw32.lib
.c.obj:
${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj regexp.obj
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
tags.obj ttyin.obj version.obj regexp.obj

all: less lesskey lessecho

Expand Down
13 changes: 7 additions & 6 deletions Makefile.wnm
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ LIBS = user32.lib
.c.obj:
$(CC) $(CFLAGS) $<

OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
position.obj prompt.obj search.obj signal.obj tags.obj \
ttyin.obj version.obj regexp.obj
OBJ = \
main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \
command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \
help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \
lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \
output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \
tags.obj ttyin.obj version.obj regexp.obj

all: less.exe lesskey.exe

Expand Down
4 changes: 2 additions & 2 deletions charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ prchar(c)

c &= 0377;
if ((c < 128 || !utf_mode) && !control_char(c))
SNPRINTF1(buf, sizeof(buf), "%c", c);
SNPRINTF1(buf, sizeof(buf), "%c", (int) c);
else if (c == ESC)
strcpy(buf, "ESC");
#if IS_EBCDIC_HOST
Expand All @@ -442,7 +442,7 @@ prchar(c)
"..V....D....TU.Z"[c]);
#else
else if (c < 128 && !control_char(c ^ 0100))
SNPRINTF1(buf, sizeof(buf), "^%c", c ^ 0100);
SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100));
#endif
else
SNPRINTF1(buf, sizeof(buf), binfmt, c);
Expand Down
6 changes: 6 additions & 0 deletions less.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ struct textlist

#define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@"

/* Flags for cvt_text */
#define CVT_TO_LC 01 /* Convert upper-case to lower-case */
#define CVT_BS 02 /* Do backspace processing */
#define CVT_CRLF 04 /* Remove CR after LF */
#define CVT_ANSI 010 /* Remove ANSI escape sequences */

#include "funcs.h"

/* Functions not included in funcs.h */
Expand Down
2 changes: 0 additions & 2 deletions line.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,6 @@ pdone(endline, forw)
int endline;
int forw;
{
int nl;

(void) pflushmbc();

if (pendc && (pendc != '\r' || !endline))
Expand Down
Loading

0 comments on commit f29af75

Please sign in to comment.