summaryrefslogtreecommitdiff
blob: 1f693e311a90ab09a1f9bbbd69a1afc6a8efb58a (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
diff -urN work.orig/convert/eyuvtojpeg.c work/convert/eyuvtojpeg.c
--- work.orig/convert/eyuvtojpeg.c	1995-04-14 23:16:52.000000000 +0200
+++ work/convert/eyuvtojpeg.c	2004-01-21 21:19:20.463187922 +0100
@@ -22,6 +22,7 @@
 /*==============*
  * HEADER FILES *
  *==============*/
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <malloc.h>
@@ -43,7 +44,7 @@
 void AllocYCC(void);
 
 
-void	main(int argc, char **argv)
+int	main(int argc, char **argv)
 {
     FILE *fpointer;
     char command[256];
@@ -105,6 +106,7 @@
     fprintf(stdout, "Converting to JPEG %s\n", dest);
     sprintf(command, "cjpeg /tmp/foobar > %s", dest);
     system(command);
+    return 0;
 }
 
 
diff -urN work.orig/convert/eyuvtoppm.c work/convert/eyuvtoppm.c
--- work.orig/convert/eyuvtoppm.c	1995-04-14 23:16:52.000000000 +0200
+++ work/convert/eyuvtoppm.c	2004-01-21 21:19:20.463187922 +0100
@@ -22,6 +22,7 @@
 /*==============*
  * HEADER FILES *
  *==============*/
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <malloc.h>
@@ -43,7 +44,7 @@
 void AllocYCC(void);
 
 
-void	main(int argc, char **argv)
+int	main(int argc, char **argv)
 {
     FILE *fpointer;
     char src[256], dest[256];
@@ -109,7 +110,7 @@
 
     WritePPM(fpointer);
     fclose(fpointer);
-
+    return 0;
 }
 
 void Usage(void)
diff -urN work.orig/convert/mtv/archdep.h work/convert/mtv/archdep.h
--- work.orig/convert/mtv/archdep.h	1995-01-24 23:42:33.000000000 +0100
+++ work/convert/mtv/archdep.h	2004-01-21 21:19:20.464187759 +0100
@@ -45,16 +45,46 @@
 			    ((char *)(to))[5] = ((char *)(from))[2];	\
 			    ((char *)(to))[6] = ((char *)(from))[1];	\
 			    ((char *)(to))[7] = ((char *)(from))[0];
-#endif /*little-endian*/
+#endif /*little-endian 32bit*/
+
+#if defined (__x86_64)
+#define	DECODE_SHORT(from, to)						\
+			    ((char *)(to))[0] = ((char *)(from))[1];	\
+			    ((char *)(to))[1] = ((char *)(from))[0];
+#define	DECODE_INT(from, to)						\
+			    ((char *)(to))[0] = ((char *)(from))[3];	\
+			    ((char *)(to))[1] = ((char *)(from))[2];	\
+			    ((char *)(to))[2] = ((char *)(from))[1];	\
+			    ((char *)(to))[3] = ((char *)(from))[0];
+
+#define	DECODE_LONG(from, to)						\
+			    ((char *)(to))[0] = ((char *)(from))[7];	\
+			    ((char *)(to))[1] = ((char *)(from))[6];	\
+			    ((char *)(to))[2] = ((char *)(from))[5];	\
+			    ((char *)(to))[3] = ((char *)(from))[4];    \
+			    ((char *)(to))[4] = ((char *)(from))[3];	\
+			    ((char *)(to))[5] = ((char *)(from))[2];	\
+			    ((char *)(to))[6] = ((char *)(from))[1];	\
+			    ((char *)(to))[7] = ((char *)(from))[0];
+
+#define	DECODE_FLOAT(from, to)		DECODE_INT((to), (from))
+
+#define	DECODE_DOUBLE(from, to)		DECODE_LONG((to), (from))
+
+#endif /*little-endian, 64bit*/
 
 
 /* Most architectures are symmetrical with respect to conversions. */
-#if defined (mc68000) || defined (sparc) || defined (i386)
+#if defined (mc68000) || defined (sparc) || defined (i386) || defined(__x86_64)
 #define	ENCODE_SHORT(from, to)		DECODE_SHORT((from), (to))
 #define	ENCODE_LONG(from, to)		DECODE_LONG((from), (to))
 #define	ENCODE_FLOAT(from, to)		DECODE_FLOAT((from), (to))
 #define	ENCODE_DOUBLE(from, to)		DECODE_DOUBLE((from), (to))
 
+#if defined(__x86_64)
+#define	ENCODE_INT(from, to)		DECODE_INT((from), (to))
+#endif
+
 /* Define types of specific length */
 typedef char		i_8;
 typedef short		i_16;
diff -urN work.orig/convert/mtv/movieToVid.c work/convert/mtv/movieToVid.c
--- work.orig/convert/mtv/movieToVid.c	1995-01-24 23:42:33.000000000 +0100
+++ work/convert/mtv/movieToVid.c	2004-01-21 21:19:20.465187595 +0100
@@ -295,7 +295,7 @@
     exit (0);
 }
 
-void
+int
 main (argc, argv)
 int argc;
 char **argv;
@@ -326,4 +326,5 @@
     WriteScriptFile (argv[1], argv[2], argv[3], argv[4],
 		     &header, offsets, numFrames);
     fprintf (stderr, "done\n");
+    return 0;
 }
diff -urN work.orig/convert/ppmtoeyuv.c work/convert/ppmtoeyuv.c
--- work.orig/convert/ppmtoeyuv.c	1995-01-20 04:25:37.000000000 +0100
+++ work/convert/ppmtoeyuv.c	2004-01-21 21:19:20.462188086 +0100
@@ -39,6 +39,7 @@
  * HEADER FILES *
  *==============*/
 
+#include <malloc.h> 
 #include <stdio.h>
 #include "ansi.h"
 
@@ -65,7 +66,7 @@
 static void PPMtoYUV _ANSI_ARGS_((void));
 
 
-void	main(int argc, char **argv)
+int	main(int argc, char **argv)
 {
     if ( ! ReadPPM(stdin) )
     {
@@ -76,6 +77,7 @@
     PPMtoYUV();
 
     WriteYUV(stdout);
+    return 0;
 }
 
 
diff -urN work.orig/mpeg_encode/bitio.c work/mpeg_encode/bitio.c
--- work.orig/mpeg_encode/bitio.c	1995-06-21 20:36:12.000000000 +0200
+++ work/mpeg_encode/bitio.c	2004-01-21 21:19:20.458188741 +0100
@@ -79,6 +79,8 @@
  * HEADER FILES *
  *==============*/
 
+#include <unistd.h>
+#include <time.h>
 #include <assert.h>
 #include "all.h"
 #include "byteorder.h"
diff -urN work.orig/mpeg_encode/jpeg.c work/mpeg_encode/jpeg.c
--- work.orig/mpeg_encode/jpeg.c	1995-08-05 01:35:07.000000000 +0200
+++ work/mpeg_encode/jpeg.c	2004-01-21 21:19:20.461188250 +0100
@@ -65,6 +65,8 @@
  *==============*/
 
 #include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
 #include "all.h"
 #include "mtypes.h"
 #include "frames.h"
diff -urN work.orig/mpeg_encode/libpnmrw.c work/mpeg_encode/libpnmrw.c
--- work.orig/mpeg_encode/libpnmrw.c	2004-01-21 19:41:38.000000000 +0100
+++ work/mpeg_encode/libpnmrw.c	2004-01-21 21:19:20.460188414 +0100
@@ -27,6 +27,7 @@
 /* #define MSDOS */
 #endif
 
+#include <stdlib.h>
 #include <stdio.h>
 #include "libpnmrw.h"
 
diff -urN work.orig/mpeg_encode/opts.c work/mpeg_encode/opts.c
--- work.orig/mpeg_encode/opts.c	1995-08-15 20:34:09.000000000 +0200
+++ work/mpeg_encode/opts.c	2004-01-21 21:19:20.459188578 +0100
@@ -35,6 +35,7 @@
  * HEADER FILES *
  *==============*/
 
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include "opts.h"