summaryrefslogtreecommitdiff
blob: d33f004fe80f96ecf945ed459615bfee42030d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
--- a/get/getx11/XGetHClrs.c
+++ b/get/getx11/XGetHClrs.c
@@ -1,5 +1,4 @@
 #ifndef XLIBINT_H_NOT_AVAILABLE
-#include <X11/copyright.h>
 
 /* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
 /* Copyright    Massachusetts Institute of Technology    1986	*/
--- a/tools/mallocNd.c
+++ b/tools/mallocNd.c
@@ -67,7 +67,7 @@
 
 /* Imports */
 #include <stdio.h>
-extern char *malloc();
+#include <string.h>
 
 /* Forward declarations */
 char *BuildIndirectionTable();
--- a/tools/into.c
+++ b/tools/into.c
@@ -40,8 +40,8 @@
 static char buf[MAXPATHLEN+1];
 short forceflg;				/* overwrite an unwritable file? */
 
-extern int errno;
-extern char *sys_errlist[];
+#include <errno.h>
+#include <string.h>
 
 void
 main(argc, argv)
@@ -103,7 +103,7 @@
     if (ferror(outf))
     {
 	fprintf(stderr, "into: %s, \"%s\" not modified\n",
-	    sys_errlist[errno], argv[1]);
+	    strerror(errno), argv[1]);
 	unlink(buf);
 	exit(1);
     }
--- a/cnv/tex/dvirle2.c
+++ b/cnv/tex/dvirle2.c
@@ -55,7 +55,6 @@
 void DumpTopOfBand(), MoveDown(), WriteBuf(), WriteBlanks();
 
 char	*ProgName;
-extern int errno;
 extern char *optarg;
 extern int optind;
 
--- a/cnv/wasatchrle.c
+++ b/cnv/wasatchrle.c
@@ -32,7 +32,6 @@
 #include <errno.h>
 #include "rle.h"
 
-extern int errno;
 
 /* "short" in our world is 16 bits.  Beware of swyte-bopping. */
 
--- a/get/getx11/x11_stuff.c
+++ b/get/getx11/x11_stuff.c
@@ -155,7 +155,6 @@
 			IPC_CREAT|0777 );
 	    if ( img->shm_img.shmid < 0 )
 	    {
-		extern int errno;
 		if ( errno == ENOSPC )
 		{
 		    if ( !no_shared_space )
@@ -361,7 +360,6 @@ Boolean reallocate;
 	    XDestroyImage( image );
 	    if ( img->shm_pix.shmid < 0 )
 	    {
-		extern int errno;
 		if ( errno == ENOSPC )
 		{
 		    if ( !no_shared_space )
--- a/get/qcr/qcr.h
+++ b/get/qcr/qcr.h
@@ -6,8 +6,6 @@
 #define GREEN 1
 #define BLUE 2
 
-extern int errno;
-
 /* Command defs for QCR-Z Film Recorder */
 
 /* These are for 8 bit Look Up Tables */
--- a/get/gettaac.c
+++ b/get/gettaac.c
@@ -24,6 +24,7 @@
  * Send bug fixes and improvements to:  ksp@maxwell.nde.swri.edu
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <strings.h>
 #include <signal.h>
@@ -459,7 +460,6 @@ char    *template;
      char    nonUnique;
      char    twiddleUserCompletion;
 
-     extern  int         errno;
      struct  direct     *nameEntry;
      DIR                *dirChan;
      struct  passwd     *pwdEntry;
--- a/tools/clock/rleClock.c
+++ b/tools/clock/rleClock.c
@@ -598,7 +598,7 @@
     { TRUE,  "-tf", STRING, "Text area format string", 	          (char *)&FormatString }, 
     { FALSE, "-Xm", BOOL,   "Output the alpha channel on RGB",    (char *)&DebugAlpha },
     { FALSE, "-D",  BOOL,   "Turn on debugging",	          (char *)&Debug },
-    NULL
+    { FALSE, NULL }
 };
 
 void
--- a/tools/to8.c
+++ b/tools/to8.c
@@ -175,7 +175,7 @@
 	 * Give it a background color of black, since the real background
 	 * will be dithered anyway.
 	 */
-	if ( in_hdr.background != NULL )
+	if ( in_hdr.background != 0 )
 	{
 	    out_hdr.bg_color = (int *)malloc( sizeof( int ) );
 	    RLE_CHECK_ALLOC( cmd_name( argv ), out_hdr.bg_color, 0 );
--- a/cnv/rletoabA62/rletoabA62.c
+++ b/cnv/rletoabA62/rletoabA62.c
@@ -157,7 +157,7 @@
 	exit(1);
     }
     if (optind < argc) {
-	if ((file = open(argv[optind], 0)) == NULL) {
+	if ((file = open(argv[optind], 0)) == -1) {
 	    perror(argv[optind]);
 	    exit(1);
 	}