summaryrefslogtreecommitdiff
blob: 105f7c41f6a790cd707919e13280d06164af2847 (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
--- get/getx11/XGetHClrs.c
+++ 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	*/
--- tools/mallocNd.c
+++ tools/mallocNd.c
@@ -67,7 +67,7 @@
 
 /* Imports */
 #include <stdio.h>
-extern char *malloc();
+#include <string.h>
 
 /* Forward declarations */
 char *BuildIndirectionTable();
--- tools/into.c
+++ 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);
     }
--- cnv/tex/dvirle2.c
+++ cnv/tex/dvirle2.c
@@ -55,7 +55,6 @@
 void DumpTopOfBand(), MoveDown(), WriteBuf(), WriteBlanks();
 
 char	*ProgName;
-extern int errno;
 extern char *optarg;
 extern int optind;
 
--- cnv/wasatchrle.c
+++ 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. */
 
--- get/getx11/x11_stuff.c
+++ 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 )
--- get/qcr/qcr.h
+++ 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 */
--- get/gettaac.c
+++ 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;
--- tools/clock/rleClock.c
+++ 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
--- tools/to8.c
+++ 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 );
--- cnv/rletoabA62/rletoabA62.c
+++ 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);
 	}