]> thyrsus.com Git - vh.git/commitdiff
Fix some archaisms.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 22 Oct 2010 08:43:29 +0000 (04:43 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 22 Oct 2010 08:43:29 +0000 (04:43 -0400)
browse.c
vh.c
vh.h

index ca05c2dbbf70f10f133459b4ff9835f9b48ebf9f..2413a8aa3eeef87213b8d4739522d3a35ea38775 100644 (file)
--- a/browse.c
+++ b/browse.c
@@ -20,6 +20,7 @@ terms.
 
 *****************************************************************************/
 /*LINTLIBRARY*/
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <signal.h>
diff --git a/vh.c b/vh.c
index 82ceb83794cdc063fcea184e68bcb1c83aaaf570..a50a3b3a430ee4b264ddbb57b242de29890ff628 100644 (file)
--- a/vh.c
+++ b/vh.c
@@ -30,6 +30,7 @@ BUGS
 #include <ctype.h>
 #include <assert.h>
 #include <time.h>
+#include <stdlib.h>
 
 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 23dee1c3245a07f631b75a3fa3046f818a72f1ab..7a5d36f31d17d0bcbaf38bb13e5cf7f8fac2a6c1 100644 (file)
--- 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 */