From: Eric S. Raymond Date: Fri, 22 Oct 2010 08:43:29 +0000 (-0400) Subject: Fix some archaisms. X-Git-Tag: 1.9~1 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=5d30166cbf3be1f72dc56d33e691ea910227e208;p=vh.git Fix some archaisms. --- diff --git a/browse.c b/browse.c index ca05c2d..2413a8a 100644 --- a/browse.c +++ b/browse.c @@ -20,6 +20,7 @@ terms. *****************************************************************************/ /*LINTLIBRARY*/ +#include #include #include #include diff --git a/vh.c b/vh.c index 82ceb83..a50a3b3 100644 --- a/vh.c +++ b/vh.c @@ -30,6 +30,7 @@ BUGS #include #include #include +#include typedef int bool; #define FALSE 0 @@ -64,9 +65,6 @@ extern void srand48(); */ #endif /* isxdigit */ -extern char *malloc(); -extern long atol(); - extern int LINES, COLS; /* initialize screen size into these */ #ifdef UNIX @@ -1451,7 +1449,7 @@ char *argv[]; *p = 0; if (strlcmp(ln, prevln) != 0) (void) fprintf(outf, "%s%c%ld\r\n", - ln + HDOFF(ln), SEPARATOR, pos); + ln + HDOFF(ln), SEPARATOR, (long int)pos); (void) strcpy(prevln, ln); } pos = ftell(inf); @@ -1465,7 +1463,7 @@ char *argv[]; inf = fopen(target, "rb"); if (inf == NULL) { - fprintf(stderr, NOINPUT); + fputs(NOINPUT, stderr); exit(1); } @@ -1484,7 +1482,7 @@ char *argv[]; outf = fopen(target, "wb"); if (outf == NULL) { - (void) fprintf(stderr, NOOUTPUT); + (void) fputs(NOOUTPUT, stderr); exit(1); } #ifndef AOS diff --git a/vh.h b/vh.h index 23dee1c..7a5d36f 100644 --- a/vh.h +++ b/vh.h @@ -65,9 +65,6 @@ typedef struct fileinfo } FILEINFO; -/* this function must be defined for vh.c to compile */ -extern void gettext(); /* fetch text from terminal screen */ - /* entry points of vh.c */ extern void chkindex(); /* check for pathologies in file */ extern void mkindex(); /* generate index for file */