Lines 1-235
Link Here
|
1 |
--- lib/loader/ext.c.orig Sat Sep 16 17:02:10 2000 |
1 |
--- lib/avifile/AviWrite.cpp.orig Sat Sep 30 04:15:50 2000 |
2 |
+++ lib/loader/ext.c Sat Sep 16 17:02:14 2000 |
2 |
+++ lib/avifile/AviWrite.cpp Sat Sep 30 04:16:53 2000 |
3 |
@@ -7,7 +7,7 @@ |
3 |
@@ -24,7 +24,11 @@ |
4 |
********************************************************/ |
4 |
try |
5 |
#include <config.h> |
5 |
{ |
6 |
|
6 |
m_status=0; |
7 |
-#include <malloc.h> |
7 |
+#ifdef O_LARGEFILE |
8 |
+#include <stdlib.h> |
8 |
m_fd=open(name, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, mask); |
9 |
#include <unistd.h> |
9 |
+#else |
10 |
#include <sys/mman.h> |
10 |
+ m_fd=open(name, O_WRONLY | O_CREAT | O_TRUNC, mask); |
11 |
#include <errno.h> |
11 |
+#endif |
12 |
--- lib/loader/win32.c.orig Sat Sep 16 17:03:28 2000 |
12 |
if(m_fd==-1) |
13 |
+++ lib/loader/win32.c Sat Sep 16 17:03:30 2000 |
13 |
throw FATAL("Can't open file for writing"); |
14 |
@@ -13,7 +13,7 @@ |
14 |
const int junk_size=0x800; |
15 |
#include "win32.h" |
15 |
@@ -158,7 +162,11 @@ |
16 |
#include <stdio.h> |
|
|
17 |
#include <pthread.h> |
18 |
-#include <malloc.h> |
19 |
+#include <stdlib.h> |
20 |
#include <time.h> |
21 |
#include <sys/types.h> |
22 |
#include <sys/time.h> |
23 |
--- lib/loader/driver.c.orig Sat Sep 16 17:04:30 2000 |
24 |
+++ lib/loader/driver.c Sat Sep 16 17:04:32 2000 |
25 |
@@ -1,6 +1,6 @@ |
26 |
#include <config.h> |
27 |
#include <stdio.h> |
28 |
-#include <malloc.h> |
29 |
+#include <stdlib.h> |
30 |
#include <wine/driver.h> |
31 |
#include <wine/pe_image.h> |
32 |
#include <wine/winreg.h> |
33 |
--- lib/loader/resource.c.orig Sat Sep 16 17:07:41 2000 |
34 |
+++ lib/loader/resource.c Sat Sep 16 17:08:00 2000 |
35 |
@@ -253,6 +253,56 @@ |
36 |
return RES_SizeofResource( hModule, hRsrc ); |
37 |
} |
16 |
} |
38 |
|
17 |
long long AviWriteFile::FileSize() |
39 |
+/********************************************************************** |
18 |
{ |
40 |
+ * LoadStringW (USER32.376) |
19 |
+#ifdef __Linux__ |
41 |
+ */ |
20 |
return lseek64(m_fd, 0, SEEK_CUR); |
42 |
+INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, |
21 |
+#else |
43 |
+ LPWSTR buffer, INT buflen ) |
22 |
+ return lseek(m_fd, 0, SEEK_CUR); |
44 |
+{ |
|
|
45 |
+ HGLOBAL hmem; |
46 |
+ HRSRC hrsrc; |
47 |
+ WCHAR *p; |
48 |
+ int string_num; |
49 |
+ int i; |
50 |
+ |
51 |
+ if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */ |
52 |
+ resource_id = (UINT)(-((INT)resource_id)); |
53 |
+ TRACE("instance = %04x, id = %04x, buffer = %08x, " |
54 |
+ "length = %d\n", instance, (int)resource_id, (int) buffer, buflen); |
55 |
+ |
56 |
+ /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out |
57 |
+ * 20 - 31. */ |
58 |
+ hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1), |
59 |
+ RT_STRINGW ); |
60 |
+ if (!hrsrc) return 0; |
61 |
+ hmem = LoadResource( instance, hrsrc ); |
62 |
+ if (!hmem) return 0; |
63 |
+ |
64 |
+ p = LockResource(hmem); |
65 |
+ string_num = resource_id & 0x000f; |
66 |
+ for (i = 0; i < string_num; i++) |
67 |
+ p += *p + 1; |
68 |
+ |
69 |
+ TRACE("strlen = %d\n", (int)*p ); |
70 |
+ |
71 |
+ if (buffer == NULL) return *p; |
72 |
+ i = min(buflen - 1, *p); |
73 |
+ if (i > 0) { |
74 |
+ memcpy(buffer, p + 1, i * sizeof (WCHAR)); |
75 |
+ buffer[i] = (WCHAR) 0; |
76 |
+ } else { |
77 |
+ if (buflen > 1) { |
78 |
+ buffer[0] = (WCHAR) 0; |
79 |
+ return 0; |
80 |
+ } |
81 |
+#if 0 |
82 |
+ WARN("Dont know why caller give buflen=%d *p=%d trying to obtain string '%s'\n", buflen, *p, p + 1); |
83 |
+#endif |
23 |
+#endif |
84 |
+ } |
|
|
85 |
+ |
86 |
+ TRACE("String loaded !\n"); |
87 |
+ return i; |
88 |
+} |
89 |
|
90 |
|
91 |
/********************************************************************** |
92 |
@@ -303,57 +353,6 @@ |
93 |
HeapFree( GetProcessHeap(), 0, wbuf ); |
94 |
|
95 |
return retval; |
96 |
-} |
97 |
- |
98 |
-/********************************************************************** |
99 |
- * LoadStringW (USER32.376) |
100 |
- */ |
101 |
-INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, |
102 |
- LPWSTR buffer, INT buflen ) |
103 |
-{ |
104 |
- HGLOBAL hmem; |
105 |
- HRSRC hrsrc; |
106 |
- WCHAR *p; |
107 |
- int string_num; |
108 |
- int i; |
109 |
- |
110 |
- if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */ |
111 |
- resource_id = (UINT)(-((INT)resource_id)); |
112 |
- TRACE("instance = %04x, id = %04x, buffer = %08x, " |
113 |
- "length = %d\n", instance, (int)resource_id, (int) buffer, buflen); |
114 |
- |
115 |
- /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out |
116 |
- * 20 - 31. */ |
117 |
- hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1), |
118 |
- RT_STRINGW ); |
119 |
- if (!hrsrc) return 0; |
120 |
- hmem = LoadResource( instance, hrsrc ); |
121 |
- if (!hmem) return 0; |
122 |
- |
123 |
- p = LockResource(hmem); |
124 |
- string_num = resource_id & 0x000f; |
125 |
- for (i = 0; i < string_num; i++) |
126 |
- p += *p + 1; |
127 |
- |
128 |
- TRACE("strlen = %d\n", (int)*p ); |
129 |
- |
130 |
- if (buffer == NULL) return *p; |
131 |
- i = min(buflen - 1, *p); |
132 |
- if (i > 0) { |
133 |
- memcpy(buffer, p + 1, i * sizeof (WCHAR)); |
134 |
- buffer[i] = (WCHAR) 0; |
135 |
- } else { |
136 |
- if (buflen > 1) { |
137 |
- buffer[0] = (WCHAR) 0; |
138 |
- return 0; |
139 |
- } |
140 |
-#if 0 |
141 |
- WARN("Dont know why caller give buflen=%d *p=%d trying to obtain string '%s'\n", buflen, *p, p + 1); |
142 |
-#endif |
143 |
- } |
144 |
- |
145 |
- TRACE("String loaded !\n"); |
146 |
- return i; |
147 |
} |
24 |
} |
148 |
|
25 |
|
149 |
/* Messages...used by FormatMessage32* (KERNEL32.something) |
26 |
AviWriteStream::AviWriteStream |
150 |
--- lib/videocodec/VideoDecoder.cpp.orig Sat Sep 16 17:11:41 2000 |
27 |
@@ -357,4 +365,4 @@ |
151 |
+++ lib/videocodec/VideoDecoder.cpp Sat Sep 16 17:16:25 2000 |
28 |
lseek(m_fd, hdr_pos, SEEK_SET); |
152 |
@@ -20,7 +20,6 @@ |
29 |
write_int(hdr_size); |
153 |
#include <fcntl.h> |
30 |
lseek(m_fd, 0, SEEK_END); |
154 |
#include <sys/mman.h> |
31 |
-} |
155 |
#include <sys/types.h> |
32 |
+} |
156 |
-#include <malloc.h> |
|
|
157 |
#include <stdio.h> |
158 |
#include <unistd.h> |
159 |
#include <strstream> |
160 |
--- lib/avifile/Cache.h.orig Sat Sep 16 17:22:11 2000 |
161 |
+++ lib/avifile/Cache.h Sat Sep 16 17:22:14 2000 |
162 |
@@ -2,7 +2,7 @@ |
163 |
#include <default.h> |
164 |
#define _LARGEFILE64_SOURCE |
165 |
#include <unistd.h> |
166 |
-#include <malloc.h> |
167 |
+#include <stdlib.h> |
168 |
#include <string.h> |
169 |
#include <stdio.h> |
170 |
#include <pthread.h> |
171 |
--- lib/avifile/FastReadStream.cpp.orig Sat Sep 16 17:23:45 2000 |
172 |
+++ lib/avifile/FastReadStream.cpp Sat Sep 16 17:23:47 2000 |
173 |
@@ -8,7 +8,7 @@ |
174 |
#include <features.h> |
175 |
#endif |
176 |
#include <unistd.h> |
177 |
-#include <malloc.h> |
178 |
+#include <stdlib.h> |
179 |
|
180 |
#ifdef __FreeBSD__ |
181 |
#define lseek64 lseek |
182 |
--- lib/avifile/AviRead.h.orig Sat Sep 16 17:25:10 2000 |
183 |
+++ lib/avifile/AviRead.h Sat Sep 16 17:25:13 2000 |
184 |
@@ -10,7 +10,7 @@ |
185 |
#include <avifmt.h> |
186 |
#include <default.h> |
187 |
#include <unistd.h> |
188 |
-#include <malloc.h> |
189 |
+#include <stdlib.h> |
190 |
#include <string.h> |
191 |
#include <stdio.h> |
192 |
#include <pthread.h> |
193 |
--- lib/avifile/AviWrite.h.orig Sat Sep 16 17:26:35 2000 |
194 |
+++ lib/avifile/AviWrite.h Sat Sep 16 17:26:37 2000 |
195 |
@@ -11,7 +11,7 @@ |
196 |
#include <avifmt.h> |
197 |
#include <default.h> |
198 |
#include <unistd.h> |
199 |
-#include <malloc.h> |
200 |
+#include <stdlib.h> |
201 |
#include <string.h> |
202 |
#include <stdio.h> |
203 |
#include <pthread.h> |
204 |
--- samples/benchmark/main.cpp.orig Sat Sep 16 17:28:22 2000 |
205 |
+++ samples/benchmark/main.cpp Sat Sep 16 17:28:24 2000 |
206 |
@@ -9,7 +9,6 @@ |
207 |
#include <config.h> |
208 |
|
209 |
#include <stdio.h> |
210 |
-#include <malloc.h> |
211 |
#include <signal.h> |
212 |
#include <iostream.h> |
213 |
#include <unistd.h> |
214 |
--- samples/benchmark/renderer.cpp.orig Sat Sep 16 17:29:28 2000 |
215 |
+++ samples/benchmark/renderer.cpp Sat Sep 16 17:29:29 2000 |
216 |
@@ -14,7 +14,7 @@ |
217 |
#include <sys/ipc.h> |
218 |
#include <sys/shm.h> |
219 |
|
220 |
-#include <malloc.h> |
221 |
+#include <stdlib.h> |
222 |
#include <pthread.h> |
223 |
#include "renderer.h" |
224 |
#include "RegAccess.h" |
225 |
--- player/renderer.cpp.orig Sat Sep 16 22:31:56 2000 |
226 |
+++ player/renderer.cpp Sat Sep 16 22:32:02 2000 |
227 |
@@ -16,7 +16,7 @@ |
228 |
#include <sys/ipc.h> |
229 |
#include <sys/shm.h> |
230 |
|
231 |
-#include <malloc.h> |
232 |
+#include <stdlib.h> |
233 |
#include <pthread.h> |
234 |
#include "renderer.h" |
235 |
#include "RegAccess.h" |