summaryrefslogtreecommitdiff
path: root/system/macutils/fixwarnings.diff
blob: 5e7fb6e83042b9415a1218f61b889b6e8ea55ea1 (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
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
diff -Naur macutils.orig/binhex/binhex.c macutils/binhex/binhex.c
--- macutils.orig/binhex/binhex.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/binhex/binhex.c	2016-07-26 17:55:20.160706531 -0400
@@ -1,12 +1,16 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "../fileio/machdr.h"
 #include "../fileio/rdfile.h"
 #include "../util/patchlevel.h"
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcat();
-extern void exit();
+extern int rdfileopt(char c);
+extern int do_query();
+extern void give_rdfileopt();
+extern char *get_rdfileopt();
 extern void transname();
 extern void do_indent();
 extern void dofile();
diff -Naur macutils.orig/binhex/dofile.c macutils/binhex/dofile.c
--- macutils.orig/binhex/dofile.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/binhex/dofile.c	2016-07-26 17:42:21.590752572 -0400
@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include "../fileio/machdr.h"
 #include "../fileio/rdfile.h"
 
diff -Naur macutils.orig/comm/frommac.c macutils/comm/frommac.c
--- macutils.orig/comm/frommac.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/comm/frommac.c	2016-07-26 17:47:31.237734261 -0400
@@ -1,4 +1,7 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "comm.h"
 #include "../util/patchlevel.h"
 #include "../fileio/machdr.h"
@@ -8,7 +11,14 @@
 
 #define LOCALOPT	"lmxyzoTVH"
 
-extern void exit();
+extern void cleanup();
+extern unsigned long get4();
+extern void transname(char *name, char *namebuf, int n);
+extern void xm_from();
+extern void give_wrfileopt();
+extern int wrfileopt();
+extern char *get_wrfileopt();
+extern void set_wrfileopt();
 extern void setup_tty();
 extern void reset_tty();
 
@@ -32,7 +42,7 @@
     char fauth[5];
     char ftype[5];
 
-    set_wrfileopt(0);
+    set_wrfileopt(NULL);
     (void)strcat(options, get_wrfileopt());
     (void)strcat(options, LOCALOPT);
     errflg = 0;
diff -Naur macutils.orig/comm/tomac.c macutils/comm/tomac.c
--- macutils.orig/comm/tomac.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/comm/tomac.c	2016-07-26 17:55:25.982706186 -0400
@@ -1,14 +1,19 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "comm.h"
 #include "../fileio/machdr.h"
 #include "../fileio/rdfile.h"
 #include "../util/patchlevel.h"
 #include "globals.h"
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcat();
-extern void exit();
+extern int rdfileopt(char c);
+extern void give_rdfileopt();
+extern int do_query();
+extern char *get_rdfileopt();
+extern void xm_to();
 extern void transname();
 extern void do_indent();
 extern void dofile();
diff -Naur macutils.orig/comm/tty.c macutils/comm/tty.c
--- macutils.orig/comm/tty.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/comm/tty.c	2016-07-26 17:38:25.120766555 -0400
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <signal.h>
 #ifndef TERMIOS_H
 #include <sgtty.h>
@@ -101,7 +103,7 @@
     }
 }
 
-tgetrec(buf, count, timeout)
+int tgetrec(buf, count, timeout)
 char *buf;
 int count, timeout;
 {
diff -Naur macutils.orig/comm/xm_from.c macutils/comm/xm_from.c
--- macutils.orig/comm/xm_from.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/comm/xm_from.c	2016-07-26 17:47:36.283733962 -0400
@@ -7,6 +7,14 @@
 #include "globals.h"
 #include "protocol.h"
 
+extern void cleanup();
+extern unsigned long get4();
+extern void transname(char *name, char *namebuf, int n);
+extern void xm_from();
+extern void give_wrfileopt();
+extern int wrfileopt();
+extern char *get_wrfileopt();
+extern void set_wrfileopt();
 extern int tgetc();
 extern int tgetrec();
 extern void tputc();
diff -Naur macutils.orig/comm/xm_to.c macutils/comm/xm_to.c
--- macutils.orig/comm/xm_to.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/comm/xm_to.c	2016-07-26 17:48:50.800729556 -0400
@@ -6,6 +6,7 @@
 #include "globals.h"
 #include "protocol.h"
 
+extern void cleanup();
 extern int tgetc();
 extern void tputc();
 extern void tputrec();
diff -Naur macutils.orig/crc/makecrc.c macutils/crc/makecrc.c
--- macutils.orig/crc/makecrc.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/crc/makecrc.c	2016-07-26 16:51:07.862934338 -0400
@@ -37,7 +37,7 @@
 
 static void initcrctab();
 
-main()
+int main(int argc, char **argv)
 {
     initcrctab("ccitt", 0x1021, 0xffff, 0, 16);
     initcrctab("kermit", 0x8408, 0, 1, 16);
diff -Naur macutils.orig/fileio/rdfile.c macutils/fileio/rdfile.c
--- macutils.orig/fileio/rdfile.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/fileio/rdfile.c	2016-07-26 17:54:58.750707797 -0400
@@ -1,3 +1,8 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <strings.h>
+
 #include <stdio.h>
 #ifdef TYPES_H
 #include <sys/types.h>
@@ -42,13 +47,6 @@
 #define RSRC_FORMAT	2
 #define UNIX_FORMAT	3
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcpy();
-extern char *strncpy();
-extern char *strcat();
-extern void exit();
-
 static void check_files();
 static void read_file();
 static void enter_dir();
@@ -937,8 +935,7 @@
     return ISFILE;
 }
 
-int rdfileopt(c)
-char c;
+int rdfileopt(char c)
 {
 extern char *optarg;
 char name[32];
diff -Naur macutils.orig/fileio/rdfileopt.h macutils/fileio/rdfileopt.h
--- macutils.orig/fileio/rdfileopt.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/fileio/rdfileopt.h	2016-07-26 17:55:10.056707128 -0400
@@ -1,4 +1,4 @@
-extern int rdfileopt();
+extern int rdfileopt(char c);
 extern void give_rdfileopt();
 extern void set_norecurse();
 extern char *get_rdfileopt();
diff -Naur macutils.orig/fileio/wrfile.c macutils/fileio/wrfile.c
--- macutils.orig/fileio/wrfile.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/fileio/wrfile.c	2016-07-26 16:51:07.834934340 -0400
@@ -1,3 +1,8 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <strings.h>
+
 #ifdef TYPES_H
 #include <sys/types.h>
 #endif /* TYPES_H */
@@ -35,13 +40,6 @@
 #define MACI 9
 #endif /* SCAN */
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcpy();
-extern char *strncpy();
-extern char *strcat();
-extern void exit();
-
 #ifdef UNDEF /* Do not declare sprintf; not portable (but lint will complain) */
 char *sprintf();
 #endif /* UNDEF */
@@ -802,12 +800,12 @@
 #endif /* APPLESHARE */
 }
 
-void set_wrfileopt(restricted)
+void set_wrfileopt(int restricted)
 {
     mode_restricted = restricted;
 }
 
-void set_s_wrfileopt(restricted)
+void set_s_wrfileopt(int restricted)
 {
     mode_s_restricted = restricted;
 }
diff -Naur macutils.orig/hexbin/dl.c macutils/hexbin/dl.c
--- macutils.orig/hexbin/dl.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/dl.c	2016-07-26 16:52:49.438928331 -0400
@@ -121,7 +121,7 @@
 static int nextc()
 {
     while(*icp == 0) {
-	if(readline() == 0) {
+	if(readlin() == 0) {
 	    return EOF;
 	}
 	icp = &line[0];
diff -Naur macutils.orig/hexbin/globals.h macutils/hexbin/globals.h
--- macutils.orig/hexbin/globals.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/globals.h	2016-07-26 17:00:38.894900570 -0400
@@ -13,7 +13,7 @@
 extern char info[];
 extern char trname[];
 
-typedef struct macheader {
+struct macheader {
 	char m_name[128];
 	char m_type[4];
 	char m_author[4];
diff -Naur macutils.orig/hexbin/hecx.c macutils/hexbin/hecx.c
--- macutils.orig/hexbin/hecx.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/hecx.c	2016-07-26 16:52:54.543928029 -0400
@@ -104,7 +104,7 @@
 
     set_put(0);
     set_put(1);
-    while(!found_crc && readline()) {
+    while(!found_crc && readlin()) {
 	if(line[0] == 0) {
 	    continue;
 	}
@@ -155,7 +155,7 @@
 {
     register long nbytes = 0L;
 
-    while(readline()) {
+    while(readlin()) {
 	if(line[0] == 0) {
 	    continue;
 	}
diff -Naur macutils.orig/hexbin/hexbin.c macutils/hexbin/hexbin.c
--- macutils.orig/hexbin/hexbin.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/hexbin.c	2016-07-26 17:27:05.668806735 -0400
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
 #ifdef TYPES_H
 #include <sys/types.h>
 #endif /* TYPES_H */
@@ -294,7 +296,7 @@
     /*	or for "begin " */
     /*	dl format starts with a line containing only the symbols '@' to 'O',
 	or '|'. */
-    while(readline()) {
+    while(readlin()) {
 	llen = strlen(line);
 #ifdef HQX
 	if((strncmp(line, "(This file", 10) == 0) ||
@@ -329,7 +331,7 @@
 	    (void)fprintf(stderr, "Skip:%s\n", line);
 	}
     }
-    while(readline()) {
+    while(readlin()) {
 	switch (line[0]) {
 #ifdef HQX
 	case ':':
diff -Naur macutils.orig/hexbin/hqx.c macutils/hexbin/hqx.c
--- macutils.orig/hexbin/hqx.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/hqx.c	2016-07-26 17:36:56.467771798 -0400
@@ -16,7 +16,7 @@
 static int getq();
 static long get2q();
 static long get4q();
-static getqbuf();
+static void getqbuf(char *buf, int n);
 
 static char *g_macname;
 
@@ -150,7 +150,7 @@
 		*out = 0;
 		(void)fprintf(stderr, "Skip:%s\n", line);
 	    }
-	    if(readline()) {
+	    if(readlin()) {
 		continue;
 	    } else {
 		break;
@@ -214,7 +214,7 @@
 	    }
 	} while(++in < out);
 	if(!stop) {
-	    if(!readline()) {
+	    if(!readlin()) {
 		break;
 	    }
 	}
@@ -380,9 +380,7 @@
 }
 
 /* getqbuf(); q format -- read n characters from input into buf */
-static getqbuf(buf, n)
-    char *buf;
-    int n;
+static void getqbuf(char *buf, int n)
 {
     int i;
 
diff -Naur macutils.orig/hexbin/mu.c macutils/hexbin/mu.c
--- macutils.orig/hexbin/mu.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/mu.c	2016-07-26 16:53:11.549927024 -0400
@@ -53,7 +53,7 @@
     set_put(1);
     do_mu_fork();
     mh.m_datalen = data_size;
-    if(!readline()) {
+    if(!readlin()) {
 	(void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	do_error("hexbin: Premature EOF");
@@ -71,7 +71,7 @@
 	set_put(0);
 	do_mu_fork();
 	mh.m_rsrclen = rsrc_size;
-	if(!readline()) {
+	if(!readlin()) {
 	    (void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	    do_error("hexbin: Premature EOF");
@@ -95,7 +95,7 @@
 #endif /* SCAN */
 	exit(1);
     }
-    if(!readline()) {
+    if(!readlin()) {
 	(void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	do_error("hexbin: Premature EOF");
@@ -103,7 +103,7 @@
 	exit(1);
     }
     (void)mu_convert(line, info + I_TYPEOFF);
-    if(!readline()) {
+    if(!readlin()) {
 	(void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	do_error("hexbin: Premature EOF");
@@ -117,7 +117,7 @@
 #endif /* SCAN */
 	exit(1);
     }
-    if(!readline()) {
+    if(!readlin()) {
 	(void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	do_error("hexbin: Premature EOF");
@@ -147,7 +147,7 @@
 {
     long newbytes;
 
-    while(readline()) {
+    while(readlin()) {
 	if(line[0] == 0) {
 	    continue;
 	}
@@ -155,7 +155,7 @@
 	if(newbytes != 0) {
 	    continue;
 	}
-	if(!readline()) {
+	if(!readlin()) {
 	    (void)fprintf(stderr, "Premature EOF\n");
 #ifdef SCAN
 	    do_error("hexbin: Premature EOF");
diff -Naur macutils.orig/hexbin/printhdr.c macutils/hexbin/printhdr.c
--- macutils.orig/hexbin/printhdr.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/printhdr.c	2016-07-26 17:30:03.293796231 -0400
@@ -33,7 +33,7 @@
 }
 
 /* print out header information in human-readable format */
-void print_header2(skip)
+void print_header2(int skip)
 {
     if(listmode) {
 	if(skip) {
diff -Naur macutils.orig/hexbin/readline.c macutils/hexbin/readline.c
--- macutils.orig/hexbin/readline.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/readline.c	2016-07-26 16:54:59.245920655 -0400
@@ -6,7 +6,7 @@
 /* Read a line.  Allow termination by CR or LF or both.  Also allow for
    a non-terminated line at end-of-file.  Returns 1 if a line is read,
    0 otherwise. */
-int readline()
+int readlin(void)
 {
     int ptr = 0, c;
 
diff -Naur macutils.orig/hexbin/readline.h macutils/hexbin/readline.h
--- macutils.orig/hexbin/readline.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/hexbin/readline.h	2016-07-26 16:55:06.138920247 -0400
@@ -1,2 +1,3 @@
 extern char line[];
+int readlin(void);
 
diff -Naur macutils.orig/macunpack/arc.h macutils/macunpack/arc.h
--- macutils.orig/macunpack/arc.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/arc.h	2016-07-26 16:57:30.503911710 -0400
@@ -18,7 +18,7 @@
 #define	SIZE2		84	/* Not present if KIND == 1 */
 #define	HEADERBYTES	88
 
-typedef struct fileHdr { /* 84 or 88 bytes */
+struct fileHdr { /* 84 or 88 bytes */
 	char		magic1;
 	char		kind;
 	char		fname[31];
diff -Naur macutils.orig/macunpack/bin.c macutils/macunpack/bin.c
--- macutils.orig/macunpack/bin.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/bin.c	2016-07-26 16:51:07.844934339 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef BIN
 #include "globals.h"
diff -Naur macutils.orig/macunpack/cpt.c macutils/macunpack/cpt.c
--- macutils.orig/macunpack/cpt.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/cpt.c	2016-07-26 17:26:35.886808496 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef DD
 #ifndef CPT
@@ -21,9 +25,7 @@
 #define ESC1SEEN	1
 #define ESC2SEEN	2
 
-extern char *malloc();
-extern char *realloc();
-extern int free();
+extern int gethuffbyte(node *l_nodelist);
 
 static void cpt_uncompact();
 static unsigned char *cpt_data;
diff -Naur macutils.orig/macunpack/cpt.h macutils/macunpack/cpt.h
--- macutils.orig/macunpack/cpt.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/cpt.h	2016-07-26 16:57:44.985910854 -0400
@@ -31,7 +31,7 @@
 
 typedef long	OSType;
 
-typedef struct cptHdr {			/* 8 bytes */
+struct cptHdr {			/* 8 bytes */
 	unsigned char	signature;	/* = 1 -- for verification */
 	unsigned char	volume;		/* for multi-file archives */
 	unsigned short	xmagic;		/* verification multi-file consistency*/
@@ -42,7 +42,7 @@
 	unsigned char	commentsize;	/* number of bytes comment that follow*/
 };
 
-typedef struct fileHdr {		/* 78 bytes */
+struct fileHdr {		/* 78 bytes */
 	unsigned char	fName[32];	/* a STR32 */
 	unsigned char	folder;		/* set to 1 if a folder */
 	unsigned short	foldersize;	/* number of entries in folder */
diff -Naur macutils.orig/macunpack/dd.c macutils/macunpack/dd.c
--- macutils.orig/macunpack/dd.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/dd.c	2016-07-26 17:00:22.699901527 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef DD
 #include "globals.h"
@@ -9,10 +13,6 @@
 #include "../util/masks.h"
 #include "../util/util.h"
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcpy();
-extern char *strncpy();
 extern void cpt_wrfile1();
 extern void core_compress();
 extern void de_compress();
@@ -45,7 +45,7 @@
 #endif /* UNTESTED */
 static void dd_cpt_compat();
 
-typedef struct methodinfo {
+struct methodinfo {
 	char *name;
 	int number;
 };
diff -Naur macutils.orig/macunpack/dd.h macutils/macunpack/dd.h
--- macutils.orig/macunpack/dd.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/dd.h	2016-07-26 16:58:00.644909928 -0400
@@ -52,7 +52,7 @@
 
 typedef long OSType;
 
-typedef struct fileHdr {		/* 124 bytes */
+struct fileHdr {		/* 124 bytes */
 	unsigned char	magic[4];	/* "DDAR" */
 	unsigned char	fill1[4];	/* ??? */
 	unsigned char	fName[64];	/* a STR63 */
@@ -73,7 +73,7 @@
 	unsigned short	hdrcrc;		/* true crc */
 };
 
-typedef struct fileCHdr {		/* 84 bytes */
+struct fileCHdr {		/* 84 bytes */
 	unsigned char	magic[4];	/* "\253\315\000\124" */
 	unsigned long	dataLength;	/* lengths */
 	unsigned long	dataCLength;
diff -Naur macutils.orig/macunpack/de_huffman.c macutils/macunpack/de_huffman.c
--- macutils.orig/macunpack/de_huffman.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/de_huffman.c	2016-07-26 17:26:18.568809520 -0400
@@ -21,6 +21,7 @@
 #include "huffman.h"
 #include "../util/util.h"
 
+int gethuffbyte(node *l_nodelist);
 int (*get_bit)();
 int bytesread;
 /* 515 because StuffIt Classic needs more than the needed 511 */
@@ -121,8 +122,7 @@
     bit = 0;
 }
 
-int gethuffbyte(l_nodelist)
-node *l_nodelist;
+int gethuffbyte(node *l_nodelist)
 {
     register node *np;
 
diff -Naur macutils.orig/macunpack/dia.c macutils/macunpack/dia.c
--- macutils.orig/macunpack/dia.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/dia.c	2016-07-26 16:51:07.858934338 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef DIA
 #include "globals.h"
@@ -9,9 +13,6 @@
 #include "../fileio/kind.h"
 #include "../util/util.h"
 
-extern char *malloc();
-extern char *realloc();
-
 static unsigned char *dia_archive;
 static int dia_archive_size;
 static int dia_max_archive_size;
diff -Naur macutils.orig/macunpack/dir.c macutils/macunpack/dir.c
--- macutils.orig/macunpack/dir.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/dir.c	2016-07-26 16:51:07.837934339 -0400
@@ -1,12 +1,13 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "globals.h"
 #include "../fileio/machdr.h"
 #include "../fileio/wrfile.h"
 #include "../util/util.h"
 #include "../util/masks.h"
 
-extern char *malloc();
-extern char *realloc();
-
 static char *dir_stack;
 static int dir_ptr = -64;
 static int dir_max;
diff -Naur macutils.orig/macunpack/jdw.h macutils/macunpack/jdw.h
--- macutils.orig/macunpack/jdw.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/jdw.h	2016-07-26 16:58:11.849909265 -0400
@@ -8,7 +8,7 @@
 #define	J_MTIME		34
 #define	J_FLENGTH	38
 
-typedef struct fileHdr {
+struct fileHdr {
 	char		magic[6];
 	unsigned long	type;
 	unsigned long	auth;
diff -Naur macutils.orig/macunpack/lzc.c macutils/macunpack/lzc.c
--- macutils.orig/macunpack/lzc.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/lzc.c	2016-07-26 16:51:07.850934339 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef LZC
 #include "globals.h"
diff -Naur macutils.orig/macunpack/lzc.h macutils/macunpack/lzc.h
--- macutils.orig/macunpack/lzc.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/lzc.h	2016-07-26 16:58:14.539909106 -0400
@@ -12,7 +12,7 @@
 #define C_AUTHOFF	36
 #define C_FLAGOFF	40
 
-typedef struct fileHdr {
+struct fileHdr {
 	unsigned long	magic1;
 	unsigned long	dataLength;
 	unsigned long	dataCLength;
diff -Naur macutils.orig/macunpack/lzh.c macutils/macunpack/lzh.c
--- macutils.orig/macunpack/lzh.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/lzh.c	2016-07-26 17:00:03.358902671 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef LZH
 #include "globals.h"
@@ -17,13 +21,11 @@
 #define LZSMASK		4095
 #define LZBUFFSIZE	8192	/* Max of above buffsizes */
 
-extern char *malloc();
-extern char *realloc();
 extern void de_lzah();
 extern unsigned char (*lzah_getbyte)();
 extern void de_lzh();
 
-typedef struct methodinfo {
+struct methodinfo {
 	char *name;
 	int number;
 };
diff -Naur macutils.orig/macunpack/lzh.h macutils/macunpack/lzh.h
--- macutils.orig/macunpack/lzh.h	2016-07-26 15:54:52.088133966 -0400
+++ macutils/macunpack/lzh.h	2016-07-26 16:58:19.748908798 -0400
@@ -30,7 +30,7 @@
 #define L_EEXTENDSZ	0
 #define L_EEXTEND	1
 
-typedef struct fileHdr { /* 58 bytes */
+struct fileHdr { /* 58 bytes */
 	unsigned char	hsize;
 	unsigned char	hcrc;
 	char		method[5];
diff -Naur macutils.orig/macunpack/macbinary.c macutils/macunpack/macbinary.c
--- macutils.orig/macunpack/macbinary.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/macbinary.c	2016-07-26 16:51:07.852934339 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #include "globals.h"
 #include "../fileio/machdr.h"
diff -Naur macutils.orig/macunpack/macunpack.c macutils/macunpack/macunpack.c
--- macutils.orig/macunpack/macunpack.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/macunpack.c	2016-07-26 16:51:07.860934338 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #include "globals.h"
 #include "../util/patchlevel.h"
diff -Naur macutils.orig/macunpack/pit.c macutils/macunpack/pit.c
--- macutils.orig/macunpack/pit.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/pit.c	2016-07-26 17:25:03.450813963 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef PIT
 #include "../fileio/wrfile.h"
@@ -11,6 +15,7 @@
 #include "../util/util.h"
 #include "huffman.h"
 
+extern int getihuffbyte();
 extern void read_tree();
 extern void de_huffman();
 extern void set_huffman();
diff -Naur macutils.orig/macunpack/sit.c macutils/macunpack/sit.c
--- macutils.orig/macunpack/sit.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/sit.c	2016-07-26 16:59:50.894903408 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef SIT
 #include "globals.h"
@@ -19,7 +23,7 @@
 extern void de_lzah();
 extern unsigned char (*lzah_getbyte)();
 
-typedef struct methodinfo {
+struct methodinfo {
 	char *name;
 	int number;
 };
diff -Naur macutils.orig/macunpack/sit.h macutils/macunpack/sit.h
--- macutils.orig/macunpack/sit.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/sit.h	2016-07-26 16:58:35.482907868 -0400
@@ -24,7 +24,7 @@
 
 typedef long OSType;
 
-typedef struct sitHdr {			/* 22 bytes */
+struct sitHdr {			/* 22 bytes */
 	OSType	signature;		/* = 'SIT!' -- for verification */
 	unsigned short	numFiles;	/* number of files in archive */
 	unsigned long	arcLength;	/* length of entire archive incl.
@@ -34,7 +34,7 @@
 	char reserved[7];
 };
 
-typedef struct fileHdr {		/* 112 bytes */
+struct fileHdr {		/* 112 bytes */
 	unsigned char	compRMethod;	/* rsrc fork compression method */
 	unsigned char	compDMethod;	/* data fork compression method */
 	unsigned char	fName[64];	/* a STR63 */
diff -Naur macutils.orig/macunpack/stf.c macutils/macunpack/stf.c
--- macutils.orig/macunpack/stf.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/stf.c	2016-07-26 16:51:07.846934339 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef STF
 #include "stf.h"
diff -Naur macutils.orig/macunpack/stf.h macutils/macunpack/stf.h
--- macutils.orig/macunpack/stf.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/stf.h	2016-07-26 16:58:39.630907622 -0400
@@ -5,7 +5,7 @@
 #define	S_RSRCLNGTH	3	/* + NAMELENGTH */
 #define	S_DATALNGTH	7	/* + NAMELENGTH */
 
-typedef struct fileHdr {
+struct fileHdr {
 	char		magic[3];
 	char		flength;
 	char		fname[32];	/* actually flength */
diff -Naur macutils.orig/macunpack/zma.c macutils/macunpack/zma.c
--- macutils.orig/macunpack/zma.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/zma.c	2016-07-26 16:51:07.849934339 -0400
@@ -1,3 +1,7 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "macunpack.h"
 #ifdef ZMA
 #include "globals.h"
@@ -9,8 +13,6 @@
 #include "../util/masks.h"
 #include "../util/util.h"
 
-extern char *malloc();
-extern char *realloc();
 extern void de_lzh();
 
 /* We do allow for possible backpointing, so we allocate the archive in core */
diff -Naur macutils.orig/macunpack/zma.h macutils/macunpack/zma.h
--- macutils.orig/macunpack/zma.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/macunpack/zma.h	2016-07-26 16:58:44.491907335 -0400
@@ -20,7 +20,7 @@
 #define	Z_RCRC		44	/* Resource crc */
 #define	Z_FNAME		46	/* File name length and name */
 
-typedef struct fileHdr {		/* 78 bytes */
+struct fileHdr {		/* 78 bytes */
 	char		deleted;	/* Not in original, split off from: */
 	char		what;		/* What kind?  Negative if deleted */
 	unsigned char	hlen ;		/* Header length */
diff -Naur macutils.orig/mixed/dir.c macutils/mixed/dir.c
--- macutils.orig/mixed/dir.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/mixed/dir.c	2016-07-26 17:30:42.603793907 -0400
@@ -1,12 +1,11 @@
+#include <stdlib.h>
+
 #include "globals.h"
 #include "../fileio/machdr.h"
 #include "../fileio/wrfile.h"
 #include "../util/util.h"
 #include "../util/masks.h"
 
-extern char *malloc();
-extern char *realloc();
-
 static char *dir_stack;
 static int dir_ptr = -64;
 static int dir_max;
diff -Naur macutils.orig/mixed/macsave.c macutils/mixed/macsave.c
--- macutils.orig/mixed/macsave.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/mixed/macsave.c	2016-07-26 17:29:26.534798405 -0400
@@ -1,3 +1,6 @@
+#include <unistd.h>
+#include <stdlib.h>
+
 #include "globals.h"
 #include "../util/patchlevel.h"
 #include "../fileio/wrfile.h"
diff -Naur macutils.orig/mixed/macstream.c macutils/mixed/macstream.c
--- macutils.orig/mixed/macstream.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/mixed/macstream.c	2016-07-26 17:56:05.677703839 -0400
@@ -1,13 +1,13 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "../fileio/machdr.h"
 #include "../fileio/rdfile.h"
 #include "../fileio/rdfileopt.h"
 #include "../util/patchlevel.h"
 
-extern char *malloc();
-extern char *realloc();
-extern char *strcat();
-extern void exit();
+extern int do_query();
 extern void transname();
 extern void do_indent();
 
diff -Naur macutils.orig/util/backtrans.c macutils/util/backtrans.c
--- macutils.orig/util/backtrans.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/util/backtrans.c	2016-07-26 16:51:07.782934343 -0400
@@ -54,8 +54,7 @@
 	0277, 0235, 0234, 0236, 0237,  '_',  '_', 0330};
 #endif /* LATIN1 */
 
-void backtrans(macname, name)
-char *macname, *name;
+void backtrans(char *macname, char *name)
 {
     char *in, *out;
     int c, count = 0;
diff -Naur macutils.orig/util/util.c macutils/util/util.c
--- macutils.orig/util/util.c	1993-10-02 16:16:00.000000000 -0400
+++ macutils/util/util.c	2016-07-26 16:51:07.782934343 -0400
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <unistd.h>
 #include "../fileio/fileglob.h"
 #include "masks.h"
 #include "util.h"
diff -Naur macutils.orig/util/util.h macutils/util/util.h
--- macutils.orig/util/util.h	1993-10-02 16:16:00.000000000 -0400
+++ macutils/util/util.h	2016-07-26 16:51:07.782934343 -0400
@@ -20,4 +20,5 @@
 extern real_time set_time();
 extern unsigned long tomactime();
 extern real_time frommactime();
+extern void backtrans(char *macname, char *name);