summaryrefslogtreecommitdiff
blob: 9b821ca35850a1332338af867217fea565aebb43 (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
Subject: [PATCH] fix build for clang 16

clang 16 does not allow implicit int in function declarations

Bug: https://bugs.gentoo.org/880797
Upstream PR: https://github.com/lkundrak/dev86/pull/26

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
---
 ld/catimage.c | 32 +++++++++++++++++++-------------
 ld/objchop.c  | 16 ++++++++--------
 2 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/ld/catimage.c b/ld/catimage.c
index 1f5e160..47161b9 100644
--- a/ld/catimage.c
+++ b/ld/catimage.c
@@ -24,6 +24,7 @@
 #ifdef __STDC__
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #endif
 #include "x86_aout.h"
 
@@ -39,9 +40,14 @@ FILE * ofd;
 FILE * ifd = 0;
 struct exec header;
 
-main(argc, argv)
-int argc;
-char ** argv;
+void open_obj(char * fname);
+void copy_segment(long out_offset,long in_offset,long length);
+void patch_bin(long file_off, int value);
+void read_symtable(void);
+void fatal(char * str);
+
+int
+main(int argc, char ** argv)
 {
    long image_offset, text_off;
    int  image_id;
@@ -100,8 +106,8 @@ char ** argv;
    exit(0);
 }
 
-open_obj(fname)
-char * fname;
+void
+open_obj(char * fname)
 {
    input_file = fname;
 
@@ -117,8 +123,8 @@ char * fname;
       fatal("Input file has bad magic number");
 }
 
-copy_segment(out_offset, in_offset, length)
-long out_offset, in_offset, length;
+void
+copy_segment(long out_offset,long in_offset,long length)
 {
    char buffer[1024];
    int ssize;
@@ -143,9 +149,8 @@ long out_offset, in_offset, length;
    }
 }
 
-patch_bin(file_off, value)
-long file_off;
-int value;
+void
+patch_bin(long file_off, int value)
 {
    char wbuf[4];
    if( file_off > 0 )
@@ -163,7 +168,8 @@ int value;
    }
 }
 
-read_symtable()
+void
+read_symtable(void)
 {
    struct nlist item;
    int nitems;
@@ -234,8 +240,8 @@ read_symtable()
    }
 }
 
-fatal(str)
-char * str;
+void
+fatal(char * str)
 {
    fprintf(stderr, "catimage:%s: %s\n", input_file, str);
    exit(2);
diff --git a/ld/objchop.c b/ld/objchop.c
index c7631c1..495df75 100644
--- a/ld/objchop.c
+++ b/ld/objchop.c
@@ -16,12 +16,13 @@ main()
 
 #else
 
+void fatal(char* str);
+void write_file(char *fname, long bsize);
+
 FILE * ifd;
 struct exec header;
 
-main(argc, argv)
-int argc;
-char ** argv;
+int main(int argc, char** argv)
 {
    FILE * ofd;
    if( argc != 5 ) fatal("Usage: objchop a.out text.bin data.bin sizes.asm");
@@ -56,9 +57,8 @@ char ** argv;
    exit(0);
 }
 
-write_file(fname, bsize)
-char * fname;
-long bsize;
+void
+write_file(char *fname, long bsize)
 {
    char buffer[1024];
    int ssize;
@@ -81,8 +81,8 @@ long bsize;
    fclose(ofd);
 }
 
-fatal(str)
-char * str;
+void
+fatal(char* str)
 {
    fprintf(stderr, "objchop: %s\n", str);
    exit(2);
-- 
2.41.0