summaryrefslogtreecommitdiff
path: root/cad/magic/files/patch-aa
blob: 2162b6a082ac310a9b4978a5406d1bdab5cc1303 (plain) (blame)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
*** extflat/extflat.h.orig	Tue Jul 12 14:29:15 1994
--- extflat/extflat.h	Sat Dec 17 15:53:53 1994
***************
*** 23,29 ****
--- 23,31 ----
  int err0 = Need_to_include_magic_header;
  #endif	_MAGIC
  
+ #ifndef __FreeBSD__
  typedef unsigned char u_char;
+ #endif
  
  /*
   * Arguments to EFFlatBuild().
*** misc/CFLAGS.orig	Fri Jul 29 17:46:00 1994
--- misc/CFLAGS	Sat Dec 17 23:51:53 1994
***************
*** 1 ****
! -g
--- 1 ----
! -m486 -O2
*** misc/patchlevel.c.orig	Fri Jul 29 12:34:47 1994
--- misc/patchlevel.c	Sat Dec 17 23:43:48 1994
***************
*** 57,62 ****
--- 57,63 ----
      strcat(patchstr, "release-6.4");
      strcat(patchstr, ", linux1");
  
+     strcat(patchstr, ", FreeBSD1");
      /* NEW PATCH LINES GO RIGHT BEFORE THIS LINE */
      return patchstr;
  }
*** misc/paths.h.orig	Thu Jul  7 15:26:29 1994
--- misc/paths.h	Sat Dec 17 23:28:58 1994
***************
*** 53,59 ****
  #  define PAGERDIR "/usr/bin/pg"
  # endif
  #else
! # ifdef linux
  #  define PAGERDIR "/usr/bin/more"
  # else
  #  define PAGERDIR "/usr/ucb/more"
--- 53,59 ----
  #  define PAGERDIR "/usr/bin/pg"
  # endif
  #else
! # if linux || __FreeBSD__
  #  define PAGERDIR "/usr/bin/more"
  # else
  #  define PAGERDIR "/usr/ucb/more"
*** plot/plotPixels.c.orig	Fri Jul 29 15:05:41 1994
--- plot/plotPixels.c	Sat Dec 17 16:03:24 1994
***************
*** 1336,1342 ****
--- 1336,1344 ----
      FILE *file;			/* File stream on which to dump it. */
  {
      int i;
+ #ifndef __FreeBSD__
      extern char *sys_errlist[];
+ #endif
      extern int errno;
      int r,g,b;
  
*** plot/plotRutils.c.orig	Mon Jul 11 11:10:50 1994
--- plot/plotRutils.c	Sat Dec 17 16:06:21 1994
***************
*** 394,400 ****
--- 394,402 ----
      FILE *file;			/* File in which to dump it. */
  {
      int count;
+ #ifndef __FreeBSD__
      extern char *sys_errlist[];
+ #endif
      extern int errno;
  
      count = write(fileno(file), (char *) raster->ras_bits,
*** plow/PlowMain.c.orig	Fri Jul 29 17:08:25 1994
--- plow/PlowMain.c	Sat Dec 17 15:44:56 1994
***************
*** 22,27 ****
--- 22,28 ----
  static char rcsid[]="$Header: /a/ncvs/ports/cad/magic/patches/patch-aa,v 1.2 1995/01/22 15:59:54 ats Exp $";
  #endif  not lint
  
+ #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/resource.h>
  #include <stdio.h>
*** prleak/prleak.c.orig	Thu Sep 13 13:27:43 1990
--- prleak/prleak.c	Sat Dec 17 15:50:19 1994
***************
*** 51,59 ****
  static char	 allName[] = "/tmp/prlaaXXXXX";
  
  long ftell();
  long getw();
  FILE *uopen();
! int cleanup();
  
  int aflag = 0;	/* -a: print all calls to malloc/free */
  int dflag = 0;	/* -d: print duplicate frees */
--- 51,61 ----
  static char	 allName[] = "/tmp/prlaaXXXXX";
  
  long ftell();
+ #ifndef __FreeBSD__
  long getw();
+ #endif
  FILE *uopen();
! void cleanup();
  
  int aflag = 0;	/* -a: print all calls to malloc/free */
  int dflag = 0;	/* -d: print duplicate frees */
***************
*** 280,286 ****
      {
  	if (ap = (struct active *) HashGetValue(he))
  	{
! 	    putw(he->h_key.h_ptr, fd);
  	    putw(ap->a_size, fd);
  	    putw(ap->a_seek, fd);
  	    FREE((char *) ap);
--- 282,288 ----
      {
  	if (ap = (struct active *) HashGetValue(he))
  	{
! 	    putw((int)he->h_key.h_ptr, fd);
  	    putw(ap->a_size, fd);
  	    putw(ap->a_seek, fd);
  	    FREE((char *) ap);
***************
*** 615,621 ****
      return (ret);
  }
  
! cleanup()
  {
      unlink(dupName);
      unlink(leakName);
--- 617,623 ----
      return (ret);
  }
  
! void cleanup()
  {
      unlink(dupName);
      unlink(leakName);
*** utils/getrect.c.orig	Mon Jul 18 14:12:35 1994
--- utils/getrect.c	Sat Dec 17 17:34:16 1994
***************
*** 64,75 ****
--- 64,83 ----
  #define	FILE_SET_PTR(fin, cp) ((fin)->_IO_read_ptr = (cp))
  
  #else
+ #ifdef __FreeBSD__
+ #define	FILE_CNT(fin)	((fin)->_r)
+ #define	FILE_PTR(fin)	((char *) (fin)->_p)
+ #define FILE_DEC_CNT(fin, n)	((fin)->_r -= (n))
+ #define	FILE_SET_PTR(fin, cp) ((fin)->_p = (cp))
+ 
+ #else
  #define	FILE_CNT(fin)	((fin)->_cnt)	
  #define	FILE_PTR(fin)	((char *) fin->_ptr)
  #define FILE_DEC_CNT(fin, n)	((fin)->_cnt -= (n))
  #define	FILE_SET_PTR(fin, cp) ((fin)->_ptr = (cp))
  
  #endif
+ #endif
  
  bool
  GetRect(fin, skip, rect)
***************
*** 115,121 ****
      rect->r_ytop = isNegative ? -n : n;
  
      /* Adjust the stdio pointers to reflect the characters read */
!     FILE_DEC_CNT(fin, cp - (char *) fin->_ptr);
      FILE_SET_PTR(fin, (STDIOCHAR *) cp);
  
      /* Make sure we skip to end of line or EOF */
--- 123,129 ----
      rect->r_ytop = isNegative ? -n : n;
  
      /* Adjust the stdio pointers to reflect the characters read */
!     FILE_DEC_CNT(fin, cp - FILE_PTR(fin));
      FILE_SET_PTR(fin, (STDIOCHAR *) cp);
  
      /* Make sure we skip to end of line or EOF */
***************
*** 125,131 ****
  
      /* Adjust the stdio pointers to reflect the characters read */
  fastbad:
!     FILE_DEC_CNT(fin, cp - (char *) fin->_ptr);
      FILE_SET_PTR(fin, (STDIOCHAR *) cp);
      goto bad;
  
--- 133,139 ----
  
      /* Adjust the stdio pointers to reflect the characters read */
  fastbad:
!     FILE_DEC_CNT(fin, cp - FILE_PTR(fin));
      FILE_SET_PTR(fin, (STDIOCHAR *) cp);
      goto bad;
  
*** utils/malloc.c.orig	Thu Aug 25 14:22:18 1994
--- utils/malloc.c	Sat Dec 17 16:08:04 1994
***************
*** 643,649 ****
--- 643,651 ----
      int cursize;
      extern etext;
      extern int errno;
+ #ifndef __FreeBSD__
      extern char *sys_errlist[];
+ #endif
  
      /*
       * Hmmmm.  Somebody's not giving us enough memory.
*** utils/port.c.orig	Thu Aug 18 13:14:30 1994
--- utils/port.c	Sat Dec 17 17:38:57 1994
***************
*** 19,24 ****
--- 19,25 ----
  static char rcsid[] = "$Header: /a/ncvs/ports/cad/magic/patches/patch-aa,v 1.2 1995/01/22 15:59:54 ats Exp $";
  #endif  not lint
  
+ #include <stdlib.h>
  #include <stdio.h>
  #include <math.h>
  #include "magic.h"
*** windows/windCmdAM.c.orig	Fri Jul 29 16:57:18 1994
--- windows/windCmdAM.c	Sat Dec 17 16:12:01 1994
***************
*** 281,287 ****
  {
  #define NUM_FD	20	/* max number of open files per process */
      extern int errno, sys_nerr;
! #ifndef	ALPHA
      extern char *sys_errlist[];
  #endif
      int fd;
--- 281,287 ----
  {
  #define NUM_FD	20	/* max number of open files per process */
      extern int errno, sys_nerr;
! #if !ALPHA && !__FreeBSD__
      extern char *sys_errlist[];
  #endif
      int fd;
*** garouter/Makefile.orig	Thu Aug  4 13:16:59 1994
--- garouter/Makefile	Sat Dec 17 16:50:47 1994
***************
*** 22,31 ****
  
  LINTFLAGS= ${IFLAGS} -u
  LINTLIBS= 
! #LINTLIBS= ${LIB}/lint/database.ln \
! 	${LIB}/lint/gcr.ln ${LIB}/lint/grouter.ln \
! 	${LIB}/lint/signals.ln ${LIB}/lint/textio.ln \
! 	${LIB}/lint/tiles.ln ${LIB}/lint/utils.ln
  .SUFFIXES: .po
  
  ${MODULE}.o: ${OBJS}
--- 22,28 ----
  
  LINTFLAGS= ${IFLAGS} -u
  LINTLIBS= 
! #LINTLIBS= ${LIB}/lint/database.ln ${LIB}/lint/gcr.ln ${LIB}/lint/grouter.ln ${LIB}/lint/signals.ln ${LIB}/lint/textio.ln ${LIB}/lint/tiles.ln ${LIB}/lint/utils.ln
  .SUFFIXES: .po
  
  ${MODULE}.o: ${OBJS}
*** fsleeper/fsleeper.c.orig	Thu Jul  7 15:47:35 1994
--- fsleeper/fsleeper.c	Sat Dec 17 16:35:09 1994
***************
*** 44,49 ****
--- 44,58 ----
  #endif
  #endif
  
+ #ifdef __FreeBSD__
+ #ifndef gtty
+ #define gtty(fd, buf) ioctl(fd, TIOCGETP, buf)
+ #endif
+ #ifndef stty
+ #define stty(fd, buf) ioctl(fd, TIOCSETP, buf)
+ #endif
+ #endif
+ 
  main(argc, argv)
      char *argv[];
  {
*** misc/magic.h.orig	Tue Aug  2 15:18:15 1994
--- misc/magic.h	Sat Dec 17 15:31:52 1994
***************
*** 217,222 ****
--- 217,226 ----
  #define	IS_LITTLE_ENDIAN	/* Digital Alpha AXP */
  #endif
  
+ #ifdef  i386
+ #define IS_LITTLE_ENDIAN	/* i386 CPU */
+ #endif
+ 
  /* Well, how'd we do? */
  
  #if	!defined(IS_BIG_ENDIAN) && !defined(IS_LITTLE_ENDIAN)
***************
*** 298,304 ****
  #ifdef	SYSV
      extern int sprintf();
  #else
! #ifndef ALPHA
      extern char* sprintf();
  #endif
  #endif
--- 302,308 ----
  #ifdef	SYSV
      extern int sprintf();
  #else
! #if !ALPHA && !__FreeBSD__
      extern char* sprintf();
  #endif
  #endif
*** graphics/Makefile.ORIG	Mon Sep 19 23:41:05 1994
--- graphics/Makefile	Sun Jan 22 14:44:19 1995
***************
*** 10,16 ****
  LIB=	${MAGICDIR}/lib
  SYSLIB=	${CADDIR}/lib/magic/sys
  BIN=	${CADDIR}/bin
! IFLAGS=	-I. -I${H} -I/usr/openwin/include
  #
  # Configuration for flags and libraries
  #
--- 10,16 ----
  LIB=	${MAGICDIR}/lib
  SYSLIB=	${CADDIR}/lib/magic/sys
  BIN=	${CADDIR}/bin
! IFLAGS=	-I. -I${H} -I/usr/X11R6/include
  #
  # Configuration for flags and libraries
  #
*** Makefile.orig	Tue Sep 20 22:55:57 1994
--- Makefile	Sun Jan 29 18:57:47 1995
***************
*** 41,46 ****
--- 41,48 ----
  CADDIR		= `:findcad`
  CADDIR_SUB	= `../:findcad`
  
+ all: everything
+ 
  everything: ${MODULES} .config
  	/bin/csh :makeall installhdrs ${MODULES}
  	/bin/csh :makeall install ${MODULES}
***************
*** 146,149 ****
  	echo ${MODULES}
  
  forceit:
! 	
--- 148,151 ----
  	echo ${MODULES}
  
  forceit:
!