Lines 1-13
Link Here
|
1 |
--- ../pr/tests/cleanup.c Sun Apr 25 11:01:02 2004 |
1 |
--- ../lib/tests/Makefile.in.orig 2015-10-16 13:22:19.000000000 +0000 |
2 |
+++ ../pr/tests/cleanup.c Tue Jul 12 01:19:53 2005 |
2 |
+++ ../lib/tests/Makefile.in 2015-11-04 02:02:20.438739000 +0000 |
3 |
@@ -48,5 +48,5 @@ |
3 |
@@ -167,7 +167,7 @@ else |
|
|
4 |
ifeq ($(OS_ARCH),OS2) |
5 |
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) |
6 |
else |
7 |
- $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@ |
8 |
+ $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@ |
9 |
endif |
10 |
endif |
11 |
endif |
12 |
--- ../pr/tests/Makefile.in.orig 2015-10-16 13:22:19.000000000 +0000 |
13 |
+++ ../pr/tests/Makefile.in 2015-11-04 02:02:20.439768000 +0000 |
14 |
@@ -489,17 +489,18 @@ endif |
15 |
ALWAYS: |
16 |
|
17 |
runtests:: $(PROGS) ALWAYS |
18 |
- @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n" |
19 |
- @$(ECHO) "BEGIN\t\t\t`date`" |
20 |
- @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n" |
21 |
- @$(ECHO) "Test\t\t\tResult\n" |
22 |
+ @$(ECHO) "NSPR Test Results - $(OBJDIR)" |
23 |
+ @$(ECHO) "BEGIN `date`" |
24 |
+ @$(ECHO) "Test Result" |
25 |
@cd $(OBJDIR); for i in $(PROGRAMS); do \ |
26 |
- $(ECHO) "$$i\c"; \ |
27 |
- ./$$i >> $(LOGFILE) 2>&1 ; \ |
28 |
+ printf "$$i"; \ |
29 |
+ ./$$i > $$i.output 2>&1; \ |
30 |
if [ 0 = $$? ] ; then \ |
31 |
- $(ECHO) "\t\t\tPassed"; \ |
32 |
- else \ |
33 |
- $(ECHO) "\t\t\tFAILED"; \ |
34 |
- fi; \ |
35 |
+ $(ECHO) " Passed"; \ |
36 |
+ rm $$i.output; \ |
37 |
+ else \ |
38 |
+ $(ECHO) " FAILED"; \ |
39 |
+ cat $$i.output; \ |
40 |
+ fi; \ |
41 |
done |
42 |
- @$(ECHO) "\nEND\t\t`date`\n" |
43 |
+ @$(ECHO) "END `date`" |
44 |
--- ../pr/tests/cleanup.c.orig 2015-10-16 13:22:19.000000000 +0000 |
45 |
+++ ../pr/tests/cleanup.c 2015-11-04 02:02:20.433719000 +0000 |
46 |
@@ -15,7 +15,7 @@ |
47 |
|
4 |
static void PR_CALLBACK Thread(void *sleep) |
48 |
static void PR_CALLBACK Thread(void *sleep) |
5 |
{ |
49 |
{ |
6 |
- PR_Sleep(PR_SecondsToInterval((PRUint32)sleep)); |
50 |
- PR_Sleep(PR_SecondsToInterval((PRUint32)sleep)); |
7 |
+ PR_Sleep(PR_SecondsToInterval((intptr_t)sleep)); |
51 |
+ PR_Sleep(PR_SecondsToInterval((intptr_t)sleep)); |
8 |
printf("Thread exiting\n"); |
52 |
printf("Thread exiting\n"); |
9 |
} |
53 |
} |
10 |
@@ -72,5 +72,6 @@ |
54 |
|
|
|
55 |
@@ -39,7 +39,8 @@ int main(int argc, char **argv) |
56 |
PRThreadScope type = PR_LOCAL_THREAD; |
11 |
PRFileDesc *err = PR_GetSpecialFD(PR_StandardError); |
57 |
PRFileDesc *err = PR_GetSpecialFD(PR_StandardError); |
12 |
PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:"); |
58 |
PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:"); |
13 |
- PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1; |
59 |
- PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1; |
Lines 15-37
Link Here
|
15 |
+ intptr_t child_sleep = 10; |
61 |
+ intptr_t child_sleep = 10; |
16 |
|
62 |
|
17 |
PR_STDIO_INIT(); |
63 |
PR_STDIO_INIT(); |
18 |
@@ -113,5 +114,5 @@ |
64 |
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) |
|
|
65 |
@@ -80,7 +81,7 @@ int main(int argc, char **argv) |
66 |
(PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL"); |
19 |
PR_fprintf(err, "\tConcurrency: %d\n", concurrency); |
67 |
PR_fprintf(err, "\tConcurrency: %d\n", concurrency); |
20 |
PR_fprintf(err, "\tNumber of threads: %d\n", threads); |
68 |
PR_fprintf(err, "\tNumber of threads: %d\n", threads); |
21 |
- PR_fprintf(err, "\tThread sleep: %d\n", child_sleep); |
69 |
- PR_fprintf(err, "\tThread sleep: %d\n", child_sleep); |
22 |
+ PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep); |
70 |
+ PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep); |
23 |
PR_fprintf(err, "\tMain sleep: %d\n", main_sleep); |
71 |
PR_fprintf(err, "\tMain sleep: %d\n", main_sleep); |
24 |
PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT "); |
72 |
PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT "); |
25 |
--- ../pr/tests/cvar.c Sun Apr 25 11:01:02 2004 |
73 |
|
26 |
+++ ../pr/tests/cvar.c Tue Jul 12 01:22:52 2005 |
74 |
--- ../pr/tests/cltsrv.c.orig 2015-10-16 13:22:19.000000000 +0000 |
27 |
@@ -174,5 +174,5 @@ |
75 |
+++ ../pr/tests/cltsrv.c 2015-11-04 02:02:20.467222000 +0000 |
|
|
76 |
@@ -887,7 +887,7 @@ int main(int argc, char** argv) |
77 |
{ |
78 |
PRUintn index; |
79 |
PRBool boolean; |
80 |
- CSClient_t *client; |
81 |
+ CSClient_t *client = NULL; |
82 |
PRStatus rv, joinStatus; |
83 |
CSServer_t *server = NULL; |
84 |
|
85 |
--- ../pr/tests/cvar.c.orig 2015-10-16 13:22:19.000000000 +0000 |
86 |
+++ ../pr/tests/cvar.c 2015-11-04 02:02:20.434287000 +0000 |
87 |
@@ -135,14 +135,14 @@ static int alive; |
88 |
static void PR_CALLBACK CXReader(void *arg) |
28 |
{ |
89 |
{ |
29 |
CircBuf *cbp = (CircBuf *)arg; |
90 |
CircBuf *cbp = (CircBuf *)arg; |
30 |
- PRInt32 i, n; |
91 |
- PRInt32 i, n; |
31 |
+ intptr_t i, n; |
92 |
+ intptr_t i, n; |
32 |
void *data; |
93 |
void *data; |
33 |
|
94 |
|
34 |
@@ -180,6 +180,6 @@ |
95 |
n = count / 2; |
35 |
for (i = 0; i < n; i++) { |
96 |
for (i = 0; i < n; i++) { |
36 |
data = GetCBData(cbp); |
97 |
data = GetCBData(cbp); |
37 |
- if ((int)data != i) |
98 |
- if ((int)data != i) |
Lines 40-213
Link Here
|
40 |
+ if (debug_mode) printf("data mismatch at for i = %ld usec\n", (long)i); |
101 |
+ if (debug_mode) printf("data mismatch at for i = %ld usec\n", (long)i); |
41 |
} |
102 |
} |
42 |
|
103 |
|
43 |
@@ -193,5 +193,5 @@ |
104 |
PR_EnterMonitor(mon); |
|
|
105 |
@@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a |
106 |
static void PR_CALLBACK CXWriter(void *arg) |
44 |
{ |
107 |
{ |
45 |
CircBuf *cbp = (CircBuf *)arg; |
108 |
CircBuf *cbp = (CircBuf *)arg; |
46 |
- PRInt32 i, n; |
109 |
- PRInt32 i, n; |
47 |
+ intptr_t i, n; |
110 |
+ intptr_t i, n; |
48 |
|
111 |
|
49 |
n = count / 2; |
112 |
n = count / 2; |
50 |
--- ../pr/tests/foreign.c Mon Mar 7 20:22:57 2005 |
113 |
for (i = 0; i < n; i++) |
51 |
+++ ../pr/tests/foreign.c Tue Jul 12 01:25:31 2005 |
114 |
--- ../pr/tests/cvar2.c.orig 2015-10-16 13:22:19.000000000 +0000 |
52 |
@@ -269,5 +269,5 @@ |
115 |
+++ ../pr/tests/cvar2.c 2015-11-04 02:02:20.452205000 +0000 |
|
|
116 |
@@ -95,7 +95,7 @@ PrivateCondVarThread(void *_info) |
117 |
for (index=0; index<info->loops; index++) { |
118 |
PR_Lock(info->lock); |
119 |
if (*info->tcount == 0) { |
120 |
- DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n", |
121 |
+ DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n", |
122 |
PR_GetCurrentThread(), info->cvar)); |
123 |
PR_WaitCondVar(info->cvar, info->timeout); |
124 |
} |
125 |
@@ -108,8 +108,8 @@ PrivateCondVarThread(void *_info) |
126 |
PR_Lock(info->exitlock); |
127 |
(*info->exitcount)++; |
128 |
PR_NotifyCondVar(info->exitcvar); |
129 |
-DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n", |
130 |
- PR_GetCurrentThread(), info->exitcvar,(*info->exitcount))); |
131 |
+DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n", |
132 |
+ PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount))); |
133 |
PR_Unlock(info->exitlock); |
134 |
} |
135 |
#if 0 |
136 |
@@ -157,7 +157,7 @@ CreateTestThread(threadinfo *info, |
137 |
void |
138 |
CondVarTestSUU(void *_arg) |
139 |
{ |
140 |
- PRInt32 arg = (PRInt32)_arg; |
141 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
142 |
PRInt32 index, loops; |
143 |
threadinfo *list; |
144 |
PRLock *sharedlock; |
145 |
@@ -189,7 +189,7 @@ CondVarTestSUU(void *_arg) |
146 |
PR_TRUE, |
147 |
PR_LOCAL_THREAD); |
148 |
index++; |
149 |
- DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread)); |
150 |
+ DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread)); |
151 |
} |
152 |
|
153 |
for (loops = 0; loops < count; loops++) { |
154 |
@@ -199,7 +199,7 @@ CondVarTestSUU(void *_arg) |
155 |
(*list[index].tcount)++; |
156 |
PR_NotifyCondVar(list[index].cvar); |
157 |
PR_Unlock(list[index].lock); |
158 |
- DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n", |
159 |
+ DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n", |
160 |
PR_GetCurrentThread(), list[index].cvar)); |
161 |
} |
162 |
|
163 |
@@ -227,7 +227,7 @@ CondVarTestSUU(void *_arg) |
164 |
void |
165 |
CondVarTestSUK(void *_arg) |
166 |
{ |
167 |
- PRInt32 arg = (PRInt32)_arg; |
168 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
169 |
PRInt32 index, loops; |
170 |
threadinfo *list; |
171 |
PRLock *sharedlock; |
172 |
@@ -301,7 +301,7 @@ CondVarTestSUK(void *_arg) |
173 |
void |
174 |
CondVarTestPUU(void *_arg) |
175 |
{ |
176 |
- PRInt32 arg = (PRInt32)_arg; |
177 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
178 |
PRInt32 index, loops; |
179 |
threadinfo *list; |
180 |
PRLock *sharedlock; |
181 |
@@ -336,7 +336,7 @@ CondVarTestPUU(void *_arg) |
182 |
PR_FALSE, |
183 |
PR_LOCAL_THREAD); |
184 |
|
185 |
- DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread)); |
186 |
+ DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread)); |
187 |
index++; |
188 |
tcount++; |
189 |
} |
190 |
@@ -354,8 +354,8 @@ CondVarTestPUU(void *_arg) |
191 |
PR_Lock(exitlock); |
192 |
/* Wait for threads to finish */ |
193 |
while(exitcount < arg) { |
194 |
-DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n", |
195 |
- PR_GetCurrentThread(), exitcvar, exitcount)); |
196 |
+DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n", |
197 |
+ PR_GetCurrentThread(), exitcvar, (int)exitcount)); |
198 |
PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60)); |
199 |
} |
200 |
PR_ASSERT(exitcount >= arg); |
201 |
@@ -365,7 +365,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w |
202 |
|
203 |
/* Join all the threads */ |
204 |
for(index=0; index<(arg); index++) { |
205 |
- DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread)); |
206 |
+ DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread)); |
207 |
PR_JoinThread(list[index].thread); |
208 |
if (list[index].internal) { |
209 |
PR_Lock(list[index].lock); |
210 |
@@ -387,7 +387,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w |
211 |
void |
212 |
CondVarTestPUK(void *_arg) |
213 |
{ |
214 |
- PRInt32 arg = (PRInt32)_arg; |
215 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
216 |
PRInt32 index, loops; |
217 |
threadinfo *list; |
218 |
PRLock *sharedlock; |
219 |
@@ -468,7 +468,7 @@ CondVarTestPUK(void *_arg) |
220 |
void |
221 |
CondVarTest(void *_arg) |
222 |
{ |
223 |
- PRInt32 arg = (PRInt32)_arg; |
224 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
225 |
PRInt32 index, loops; |
226 |
threadinfo *list; |
227 |
PRLock *sharedlock; |
228 |
@@ -601,7 +601,7 @@ CondVarTest(void *_arg) |
229 |
void |
230 |
CondVarTimeoutTest(void *_arg) |
231 |
{ |
232 |
- PRInt32 arg = (PRInt32)_arg; |
233 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
234 |
PRInt32 index, loops; |
235 |
threadinfo *list; |
236 |
PRLock *sharedlock; |
237 |
@@ -712,7 +712,7 @@ CondVarTimeoutTest(void *_arg) |
238 |
void |
239 |
CondVarMixedTest(void *_arg) |
240 |
{ |
241 |
- PRInt32 arg = (PRInt32)_arg; |
242 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
243 |
PRInt32 index, loops; |
244 |
threadinfo *list; |
245 |
PRLock *sharedlock; |
246 |
@@ -802,7 +802,7 @@ CondVarMixedTest(void *_arg) |
247 |
for(index=0; index<(arg*4); index+=3) { |
248 |
|
249 |
PR_Lock(list[index].lock); |
250 |
- *list[index].tcount++; |
251 |
+ list[index].tcount++; |
252 |
PR_NotifyCondVar(list[index].cvar); |
253 |
PR_Unlock(list[index].lock); |
254 |
|
255 |
@@ -873,7 +873,7 @@ static void Measure(void (*func)(void *) |
256 |
double d; |
257 |
|
258 |
start = PR_IntervalNow(); |
259 |
- (*func)((void *)arg); |
260 |
+ (*func)((void *)(intptr_t)arg); |
261 |
stop = PR_IntervalNow(); |
262 |
|
263 |
d = (double)PR_IntervalToMicroseconds(stop - start); |
264 |
@@ -932,7 +932,7 @@ default_threads, default_threads*2, defa |
265 |
PR_SetConcurrency(2); |
266 |
|
267 |
for (threads = default_threads; threads < default_threads*5; threads+=default_threads) { |
268 |
- printf("\n%ld Thread tests\n", threads); |
269 |
+ printf("\n%d Thread tests\n", (int)threads); |
270 |
Measure(CondVarTestSUU, threads, "Condvar simple test shared UU"); |
271 |
Measure(CondVarTestSUK, threads, "Condvar simple test shared UK"); |
272 |
Measure(CondVarTestPUU, threads, "Condvar simple test priv UU"); |
273 |
--- ../pr/tests/foreign.c.orig 2015-10-16 13:22:19.000000000 +0000 |
274 |
+++ ../pr/tests/foreign.c 2015-11-04 02:02:20.434883000 +0000 |
275 |
@@ -202,7 +202,7 @@ static void OneShot(void *arg) |
276 |
PRFileDesc *fd; |
53 |
PRDir *dir; |
277 |
PRDir *dir; |
54 |
PRFileDesc *pair[2]; |
278 |
PRFileDesc *pair[2]; |
55 |
- PRIntn test = (PRIntn)arg; |
279 |
- PRIntn test = (PRIntn)arg; |
56 |
+ intptr_t test = (intptr_t)arg; |
280 |
+ intptr_t test = (intptr_t)arg; |
57 |
|
281 |
|
58 |
for (test = 0; test < 12; ++test) { |
282 |
for (test = 0; test < 12; ++test) { |
59 |
@@ -364,5 +364,5 @@ |
283 |
|
|
|
284 |
@@ -302,7 +302,7 @@ static void OneShot(void *arg) |
285 |
int main(int argc, char **argv) |
60 |
{ |
286 |
{ |
61 |
PRStatus rv; |
287 |
PRStatus rv; |
62 |
- PRInt32 thread_cnt = DEFAULT_THREAD_COUNT; |
288 |
- PRInt32 thread_cnt = DEFAULT_THREAD_COUNT; |
63 |
+ intptr_t thread_cnt = DEFAULT_THREAD_COUNT; |
289 |
+ intptr_t thread_cnt = DEFAULT_THREAD_COUNT; |
64 |
PLOptStatus os; |
290 |
PLOptStatus os; |
65 |
PLOptState *opt = PL_CreateOptState(argc, argv, "dt:"); |
291 |
PLOptState *opt = PL_CreateOptState(argc, argv, "dt:"); |
66 |
--- ../pr/tests/forktest.c Sun Apr 25 11:01:02 2004 |
292 |
|
67 |
+++ ../pr/tests/forktest.c Tue Jul 12 01:28:15 2005 |
293 |
--- ../pr/tests/forktest.c.orig 2015-10-16 13:22:19.000000000 +0000 |
68 |
@@ -80,5 +80,5 @@ |
294 |
+++ ../pr/tests/forktest.c 2015-11-04 02:02:20.435492000 +0000 |
|
|
295 |
@@ -47,7 +47,7 @@ ClientThreadFunc(void *arg) |
296 |
{ |
69 |
PRNetAddr addr; |
297 |
PRNetAddr addr; |
70 |
PRFileDesc *sock = NULL; |
298 |
PRFileDesc *sock = NULL; |
71 |
- PRInt32 tmp = (PRInt32)arg; |
299 |
- PRInt32 tmp = (PRInt32)arg; |
72 |
+ intptr_t tmp = (intptr_t)arg; |
300 |
+ intptr_t tmp = (intptr_t)arg; |
73 |
|
301 |
|
74 |
/* |
302 |
/* |
75 |
@@ -176,5 +176,5 @@ |
303 |
* Make sure the PR_Accept call will block |
|
|
304 |
@@ -143,7 +143,7 @@ DoIO(void) |
305 |
goto finish; |
76 |
} |
306 |
} |
77 |
clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc, |
307 |
clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc, |
78 |
- (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
308 |
- (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
79 |
+ (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
309 |
+ (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
80 |
PR_JOINABLE_THREAD, 0); |
310 |
PR_JOINABLE_THREAD, 0); |
81 |
if (clientThread == NULL) { |
311 |
if (clientThread == NULL) { |
82 |
@@ -185,2 +185,5 @@ |
312 |
fprintf(stderr, "Cannot create client thread: (%d, %d)\n", |
|
|
313 |
@@ -151,6 +151,9 @@ DoIO(void) |
314 |
failed_already = 1; |
315 |
goto finish; |
83 |
} |
316 |
} |
84 |
+ printf("Wait one second before accept\n"); |
317 |
+ printf("Wait one second before accept\n"); |
85 |
+ fflush(stdout); |
318 |
+ fflush(stdout); |
86 |
+ PR_Sleep(PR_SecondsToInterval(1)); |
319 |
+ PR_Sleep(PR_SecondsToInterval(1)); |
87 |
printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port)); |
320 |
printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port)); |
88 |
--- ../pr/tests/mbcs.c Sun Apr 25 11:01:02 2004 |
321 |
fflush(stdout); |
89 |
+++ ../pr/tests/mbcs.c Tue Jul 12 01:34:26 2005 |
322 |
sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5)); |
90 |
@@ -87,5 +87,5 @@ |
323 |
--- ../pr/tests/getai.c.orig 2015-10-16 13:22:19.000000000 +0000 |
91 |
** Traverse directory |
324 |
+++ ../pr/tests/getai.c 2015-11-04 02:02:20.439194000 +0000 |
92 |
*/ |
325 |
@@ -13,8 +13,13 @@ int main(int argc, char **argv) |
93 |
-static void TraverseDirectory( unsigned char *dir ) |
326 |
PRAddrInfo *ai; |
94 |
+static void TraverseDirectory(const char *dir) |
|
|
95 |
{ |
96 |
PRDir *cwd; |
97 |
@@ -93,5 +93,4 @@ |
98 |
PRFileInfo info; |
99 |
PRStatus rc; |
100 |
- PRInt32 err; |
101 |
PRFileDesc *fd; |
102 |
char nextDir[256]; |
103 |
@@ -114,14 +114,14 @@ |
104 |
} |
105 |
if ( PR_FILE_FILE == info.type ) { |
106 |
- printf("File: %s \tsize: %ld\n", dirEntry->name, info.size ); |
107 |
+ printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size ); |
108 |
fd = PR_Open( file, PR_RDONLY, 0 ); |
109 |
if ( NULL == fd ) { |
110 |
printf("PR_Open() failed. Error: %ld, OSError: %ld\n", |
111 |
- PR_GetError(), PR_GetOSError()); |
112 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
113 |
} |
114 |
rc = PR_Close( fd ); |
115 |
if ( PR_FAILURE == rc ) { |
116 |
printf("PR_Close() failed. Error: %ld, OSError: %ld\n", |
117 |
- PR_GetError(), PR_GetOSError()); |
118 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
119 |
} |
120 |
} else if ( PR_FILE_DIRECTORY == info.type ) { |
121 |
--- ../pr/tests/nonblock.c Sun Apr 25 11:01:02 2004 |
122 |
+++ ../pr/tests/nonblock.c Tue Jul 12 01:37:52 2005 |
123 |
@@ -84,5 +84,5 @@ |
124 |
clientThreadFunc(void *arg) |
125 |
{ |
126 |
- PRUintn port = (PRUintn)arg; |
127 |
+ intptr_t port = (intptr_t)arg; |
128 |
PRFileDesc *sock; |
129 |
PRNetAddr addr; |
130 |
@@ -196,5 +196,5 @@ |
131 |
|
132 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
133 |
- clientThreadFunc, (void *) listenPort, |
134 |
+ clientThreadFunc, (void *) (intptr_t)listenPort, |
135 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
136 |
PR_UNJOINABLE_THREAD, 0); |
137 |
@@ -240,5 +240,5 @@ |
138 |
PL_PrintError("First Receive:\n"); |
139 |
fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n", |
140 |
- retVal, PR_GetError()); |
141 |
+ (long)retVal, (long)PR_GetError()); |
142 |
exit(1); |
143 |
} |
144 |
@@ -250,5 +250,5 @@ |
145 |
PL_PrintError("Second Receive:\n"); |
146 |
fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n", |
147 |
- retVal, PR_GetError()); |
148 |
+ (long)retVal, (long)PR_GetError()); |
149 |
exit(1); |
150 |
} |
151 |
--- ../pr/tests/peek.c Sun Apr 25 11:01:02 2004 |
152 |
+++ ../pr/tests/peek.c Tue Jul 12 01:41:44 2005 |
153 |
@@ -168,5 +168,5 @@ |
154 |
PRFileDesc *sock; |
155 |
PRSocketOptionData opt; |
156 |
- PRUint16 port = (PRUint16) arg; |
157 |
+ PRUint16 port = (intptr_t) arg; |
158 |
PRNetAddr addr; |
159 |
char buf[BUFFER_SIZE]; |
160 |
@@ -332,5 +332,5 @@ |
161 |
} |
162 |
client = PR_CreateThread( |
163 |
- PR_USER_THREAD, ClientNB, (void *) port, |
164 |
+ PR_USER_THREAD, ClientNB, (void *)(intptr_t) port, |
165 |
PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0); |
166 |
if (NULL == client) { |
167 |
--- ../pr/tests/pipepong.c Sun Apr 25 11:01:02 2004 |
168 |
+++ ../pr/tests/pipepong.c Tue Jul 12 01:43:52 2005 |
169 |
@@ -69,5 +69,5 @@ |
170 |
fprintf(stderr, "pong process: received \"%s\"\n", buf); |
171 |
if (nBytes != 5) { |
172 |
- fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n", |
173 |
+ fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n", |
174 |
nBytes); |
175 |
exit(1); |
176 |
--- ../pr/tests/poll_nm.c Sun Apr 25 11:01:02 2004 |
177 |
+++ ../pr/tests/poll_nm.c Tue Jul 12 01:45:57 2005 |
178 |
@@ -97,5 +97,5 @@ |
179 |
clientThreadFunc(void *arg) |
180 |
{ |
181 |
- PRUintn port = (PRUintn) arg; |
182 |
+ PRUintn port = (intptr_t) arg; |
183 |
PRFileDesc *sock; |
184 |
PRNetAddr addr; |
185 |
@@ -251,5 +251,5 @@ |
186 |
|
187 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
188 |
- clientThreadFunc, (void *) listenPort1, |
189 |
+ clientThreadFunc, (void *)(intptr_t)listenPort1, |
190 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
191 |
PR_UNJOINABLE_THREAD, 0); |
192 |
@@ -261,5 +261,5 @@ |
193 |
|
194 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
195 |
- clientThreadFunc, (void *) listenPort2, |
196 |
+ clientThreadFunc, (void *)(intptr_t)listenPort2, |
197 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
198 |
PR_UNJOINABLE_THREAD, 0); |
199 |
--- ../lib/tests/Makefile.in Sun Nov 7 21:52:55 2004 |
200 |
+++ ../lib/tests/Makefile.in Tue Jul 12 01:49:15 2005 |
201 |
@@ -247,5 +247,5 @@ |
202 |
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) |
203 |
else |
204 |
- $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@ |
205 |
+ $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@ |
206 |
endif |
207 |
endif |
208 |
--- ../pr/tests/getai.c Sun Apr 25 11:01:02 2004 |
209 |
+++ ../pr/tests/getai.c Tue Jul 12 02:20:40 2005 |
210 |
@@ -46,6 +46,11 @@ |
211 |
void *iter; |
327 |
void *iter; |
212 |
PRNetAddr addr; |
328 |
PRNetAddr addr; |
213 |
+ const char *host; |
329 |
+ const char *host; |
Lines 220-271
Link Here
|
220 |
+ ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG); |
336 |
+ ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG); |
221 |
if (ai == NULL) { |
337 |
if (ai == NULL) { |
222 |
fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n", |
338 |
fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n", |
223 |
--- ../pr/tests/Makefile.in Sun Apr 25 11:01:02 2004 |
339 |
PR_GetError(), PR_GetOSError()); |
224 |
+++ ../pr/tests/Makefile.in Tue Jul 12 02:25:18 2005 |
340 |
--- ../pr/tests/instrumt.c.orig 2015-10-16 13:22:19.000000000 +0000 |
225 |
@@ -556,16 +557,17 @@ |
341 |
+++ ../pr/tests/instrumt.c 2015-11-04 02:02:20.440472000 +0000 |
226 |
|
342 |
@@ -36,6 +36,7 @@ |
227 |
runtests:: $(PROGS) ALWAYS |
343 |
*/ |
228 |
- @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n" |
|
|
229 |
- @$(ECHO) "BEGIN\t\t\t`date`" |
230 |
- @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n" |
231 |
- @$(ECHO) "Test\t\t\tResult\n" |
232 |
+ @$(ECHO) "NSPR Test Results - $(OBJDIR)" |
233 |
+ @$(ECHO) "BEGIN `date`" |
234 |
+ @$(ECHO) "Test Result" |
235 |
@cd $(OBJDIR); for i in $(PROGRAMS); do \ |
236 |
- $(ECHO) "$$i\c"; \ |
237 |
- ./$$i >> $(LOGFILE) 2>&1 ; \ |
238 |
+ printf "$$i"; \ |
239 |
+ ./$$i > $$i.output 2>&1; \ |
240 |
if [ 0 = $$? ] ; then \ |
241 |
- $(ECHO) "\t\t\tPassed"; \ |
242 |
- else \ |
243 |
- $(ECHO) "\t\t\tFAILED"; \ |
244 |
- fi; \ |
245 |
+ $(ECHO) " Passed"; \ |
246 |
+ rm $$i.output; \ |
247 |
+ else \ |
248 |
+ $(ECHO) " FAILED"; \ |
249 |
+ cat $$i.output; \ |
250 |
+ fi; \ |
251 |
done |
252 |
- @$(ECHO) "\nEND\t\t`date`\n" |
253 |
+ @$(ECHO) "END `date`" |
254 |
--- ../pr/tests/instrumt.c Sun Apr 25 11:01:02 2004 |
255 |
+++ ../pr/tests/instrumt.c Mon Jul 25 20:45:54 2005 |
256 |
@@ -69,4 +69,5 @@ |
257 |
|
344 |
|
258 |
#include <stdio.h> |
345 |
#include <stdio.h> |
259 |
+#define DEBUG |
346 |
+#define DEBUG |
260 |
#include <plstr.h> |
347 |
#include <plstr.h> |
261 |
#include <prclist.h> |
348 |
#include <prclist.h> |
262 |
@@ -83,5 +84,4 @@ |
349 |
#include <prmem.h> |
|
|
350 |
@@ -50,7 +51,6 @@ |
351 |
#define COUNT_LIMIT (10 * ( 1024)) |
263 |
|
352 |
|
264 |
#define SMALL_TRACE_BUFSIZE ( 60 * 1024 ) |
353 |
#define SMALL_TRACE_BUFSIZE ( 60 * 1024 ) |
265 |
- |
354 |
- |
266 |
typedef enum |
355 |
typedef enum |
267 |
{ |
356 |
{ |
268 |
@@ -111,8 +111,8 @@ |
357 |
CountLoop = 1, |
|
|
358 |
@@ -78,10 +78,10 @@ static void Help(void) |
359 |
|
269 |
static void ListCounters(void) |
360 |
static void ListCounters(void) |
270 |
{ |
361 |
{ |
271 |
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) |
362 |
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) |
Lines 275-281
Link Here
|
275 |
- const char **qname = &qn, **rname = &rn, **desc = &dn; |
366 |
- const char **qname = &qn, **rname = &rn, **desc = &dn; |
276 |
PRUint32 tCtr; |
367 |
PRUint32 tCtr; |
277 |
|
368 |
|
278 |
@@ -125,6 +125,6 @@ |
369 |
PR_INIT_COUNTER_HANDLE( qh, NULL ); |
|
|
370 |
@@ -92,7 +92,7 @@ static void ListCounters(void) |
371 |
PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh ); |
279 |
while ( rh != NULL ) |
372 |
while ( rh != NULL ) |
280 |
{ |
373 |
{ |
281 |
- PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc ); |
374 |
- PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc ); |
Lines 283-289
Link Here
|
283 |
PR_GET_COUNTER(tCtr, rh); |
376 |
PR_GET_COUNTER(tCtr, rh); |
284 |
PR_LOG( lm, msgLevel, |
377 |
PR_LOG( lm, msgLevel, |
285 |
( "QName: %s RName: %s Desc: %s Value: %ld\n", |
378 |
( "QName: %s RName: %s Desc: %s Value: %ld\n", |
286 |
@@ -134,13 +134,13 @@ |
379 |
@@ -101,15 +101,15 @@ static void ListCounters(void) |
|
|
380 |
} |
287 |
PR_FIND_NEXT_COUNTER_QNAME(qh, qh); |
381 |
PR_FIND_NEXT_COUNTER_QNAME(qh, qh); |
288 |
} |
382 |
} |
289 |
- return; |
383 |
- return; |
Lines 299-328
Link Here
|
299 |
- const char **qname = &qn, **rname = &rn, **desc = &dn; |
393 |
- const char **qname = &qn, **rname = &rn, **desc = &dn; |
300 |
|
394 |
|
301 |
PR_INIT_TRACE_HANDLE( qh, NULL ); |
395 |
PR_INIT_TRACE_HANDLE( qh, NULL ); |
302 |
@@ -152,5 +152,5 @@ |
396 |
PR_FIND_NEXT_TRACE_QNAME(qh, qh ); |
|
|
397 |
@@ -119,7 +119,7 @@ static void ListTraces(void) |
398 |
PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh ); |
303 |
while ( rh != NULL ) |
399 |
while ( rh != NULL ) |
304 |
{ |
400 |
{ |
305 |
- PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc ); |
401 |
- PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc ); |
306 |
+ PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn ); |
402 |
+ PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn ); |
307 |
PR_LOG( lm, msgLevel, |
403 |
PR_LOG( lm, msgLevel, |
308 |
( "QName: %s RName: %s Desc: %s", |
404 |
( "QName: %s RName: %s Desc: %s", |
309 |
@@ -160,5 +160,5 @@ |
405 |
qn, rn, dn )); |
|
|
406 |
@@ -127,7 +127,7 @@ static void ListTraces(void) |
407 |
} |
310 |
PR_FIND_NEXT_TRACE_QNAME(qh, qh); |
408 |
PR_FIND_NEXT_TRACE_QNAME(qh, qh); |
311 |
} |
409 |
} |
312 |
- return; |
410 |
- return; |
313 |
+#endif |
411 |
+#endif |
314 |
} /* end ListCounters() */ |
412 |
} /* end ListCounters() */ |
315 |
|
413 |
|
316 |
@@ -359,5 +359,5 @@ |
414 |
|
|
|
415 |
@@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi |
416 |
*/ |
317 |
static void TraceTest( void ) |
417 |
static void TraceTest( void ) |
318 |
{ |
418 |
{ |
319 |
- PRInt32 i; |
419 |
- PRInt32 i; |
320 |
+ PRIntn i = 0; |
420 |
+ PRIntn i = 0; |
321 |
PRInt32 size; |
421 |
PRInt32 size; |
322 |
PR_DEFINE_TRACE( th ); |
422 |
PR_DEFINE_TRACE( th ); |
323 |
--- ../pr/tests/layer.c Fri Apr 29 18:46:05 2005 |
423 |
PRThread *t1, *t2; |
324 |
+++ ../pr/tests/layer.c Mon Jul 25 20:53:03 2005 |
424 |
--- ../pr/tests/io_timeout.c.orig 2015-10-16 13:22:19.000000000 +0000 |
325 |
@@ -78,5 +78,8 @@ |
425 |
+++ ../pr/tests/io_timeout.c 2015-11-04 02:02:20.452831000 +0000 |
|
|
426 |
@@ -22,11 +22,13 @@ |
427 |
/* Used to get the command line option */ |
428 |
#include "plgetopt.h" |
429 |
|
430 |
+#include <errno.h> |
431 |
#include <stdio.h> |
432 |
+#include <string.h> |
433 |
#include "nspr.h" |
434 |
|
435 |
#define NUM_THREADS 1 |
436 |
-#define BASE_PORT 8000 |
437 |
+#define BASE_PORT 38011 |
438 |
#define DEFAULT_ACCEPT_TIMEOUT 2 |
439 |
|
440 |
typedef struct threadInfo { |
441 |
@@ -38,7 +40,7 @@ typedef struct threadInfo { |
442 |
} threadInfo; |
443 |
|
444 |
PRIntn failed_already = 0; |
445 |
-PRIntn debug_mode = 0; |
446 |
+PRIntn debug_mode = 1; |
447 |
|
448 |
#define LOCAL_SCOPE_STRING "LOCAL scope" |
449 |
#define GLOBAL_SCOPE_STRING "GLOBAL scope" |
450 |
@@ -54,7 +56,7 @@ thread_main(void *_info) |
451 |
PRFileDesc *clientSock; |
452 |
PRStatus rv; |
453 |
PRThreadScope tscope; |
454 |
- char *scope_str; |
455 |
+ const char *scope_str; |
456 |
|
457 |
|
458 |
if (debug_mode) |
459 |
@@ -73,6 +75,7 @@ thread_main(void *_info) |
460 |
break; |
461 |
default: |
462 |
PR_NOT_REACHED("Invalid thread scope"); |
463 |
+ scope_str = NULL; |
464 |
break; |
465 |
} |
466 |
printf("thread id %d, scope %s\n", info->id, scope_str); |
467 |
@@ -91,7 +94,12 @@ thread_main(void *_info) |
468 |
rv = PR_Bind(listenSock, &listenAddr); |
469 |
if (rv == PR_FAILURE) { |
470 |
if (debug_mode) |
471 |
- printf("unable to bind\n"); |
472 |
+ printf("unable to bind to %d: %s\n", |
473 |
+ BASE_PORT + info->id, strerror(PR_GetOSError())); |
474 |
+ if (PR_GetOSError() == EADDRINUSE) { |
475 |
+ printf("can not proceed with this test\n"); |
476 |
+ exit(0); |
477 |
+ } |
478 |
failed_already=1; |
479 |
goto dead; |
480 |
} |
481 |
@@ -113,8 +121,9 @@ thread_main(void *_info) |
482 |
if (clientSock == NULL) { |
483 |
if (PR_GetError() == PR_IO_TIMEOUT_ERROR) { |
484 |
if (debug_mode) { |
485 |
- printf("PR_Accept() timeout worked!\n"); |
486 |
- printf("TEST PASSED! PR_Accept() returned error %d\n", |
487 |
+ printf("PR_Accept() timeout worked!\n" |
488 |
+ "TEST PASSED! PR_Accept() returned error " |
489 |
+ "PR_IO_TIMEOUT_ERROR (%ld)\n", |
490 |
PR_IO_TIMEOUT_ERROR); |
491 |
} |
492 |
} else { |
493 |
--- ../pr/tests/layer.c.orig 2015-10-16 13:22:19.000000000 +0000 |
494 |
+++ ../pr/tests/layer.c 2015-11-04 02:02:20.441092000 +0000 |
495 |
@@ -45,7 +45,10 @@ static PRUint16 default_port = 12273; |
496 |
static PRFileDesc *PushLayer(PRFileDesc *stack) |
326 |
{ |
497 |
{ |
327 |
PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods); |
498 |
PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods); |
328 |
- PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer); |
499 |
- PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer); |
Lines 332-450
Link Here
|
332 |
+ PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer); |
503 |
+ PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer); |
333 |
if (verbosity > quiet) |
504 |
if (verbosity > quiet) |
334 |
PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack); |
505 |
PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack); |
335 |
--- ../pr/tests/lazyinit.c Sun Apr 25 11:01:02 2004 |
506 |
PR_ASSERT(PR_SUCCESS == rv); |
336 |
+++ ../pr/tests/lazyinit.c Mon Jul 25 20:54:18 2005 |
507 |
--- ../pr/tests/lazyinit.c.orig 2015-10-16 13:22:19.000000000 +0000 |
337 |
@@ -76,5 +76,4 @@ |
508 |
+++ ../pr/tests/lazyinit.c 2015-11-04 02:02:20.441575000 +0000 |
|
|
509 |
@@ -43,7 +43,6 @@ int main(int argc, char **argv) |
510 |
char *path = NULL; |
338 |
PRDir *dir = NULL; |
511 |
PRDir *dir = NULL; |
339 |
PRLock *ml = NULL; |
512 |
PRLock *ml = NULL; |
340 |
- PRCondVar *cv = NULL; |
513 |
- PRCondVar *cv = NULL; |
341 |
PRThread *thread = NULL; |
514 |
PRThread *thread = NULL; |
342 |
PRIntervalTime interval = 0; |
515 |
PRIntervalTime interval = 0; |
343 |
--- ../pr/tests/lltest.c Sun Apr 25 11:01:02 2004 |
516 |
PRFileDesc *file, *udp, *tcp, *pair[2]; |
344 |
+++ ../pr/tests/lltest.c Mon Jul 25 20:57:30 2005 |
517 |
--- ../pr/tests/lltest.c.orig 2015-10-16 13:22:19.000000000 +0000 |
345 |
@@ -578,4 +578,5 @@ |
518 |
+++ ../pr/tests/lltest.c 2015-11-04 02:02:20.442340000 +0000 |
|
|
519 |
@@ -545,6 +545,7 @@ TestConversion( void ) |
520 |
return; |
346 |
} |
521 |
} |
347 |
|
522 |
|
348 |
+#if 0 |
523 |
+#if 0 |
349 |
static void ShiftCompileOnly() |
524 |
static void ShiftCompileOnly() |
350 |
{ |
525 |
{ |
351 |
@@ -594,4 +595,5 @@ |
526 |
/* |
|
|
527 |
@@ -561,6 +562,7 @@ static void ShiftCompileOnly() |
528 |
LL_ISHL(ia, 49, 32); |
352 |
|
529 |
|
353 |
} /* ShiftCompileOnly */ |
530 |
} /* ShiftCompileOnly */ |
354 |
+#endif |
531 |
+#endif |
355 |
|
532 |
|
356 |
|
533 |
|
357 |
@@ -668,5 +670,4 @@ |
534 |
/* |
|
|
535 |
@@ -635,7 +637,6 @@ TestArithmetic( void ) |
536 |
PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 ); |
358 |
PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe ); |
537 |
PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe ); |
359 |
PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff ); |
538 |
PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff ); |
360 |
- PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 ); |
539 |
- PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 ); |
361 |
PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 ); |
540 |
PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 ); |
362 |
PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 ); |
541 |
PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 ); |
363 |
--- ../pr/tests/nbconn.c Fri Apr 29 18:46:05 2005 |
542 |
PRInt64 result, result2; |
364 |
+++ ../pr/tests/nbconn.c Mon Jul 25 21:00:51 2005 |
543 |
--- ../pr/tests/mbcs.c.orig 2015-10-16 13:22:19.000000000 +0000 |
365 |
@@ -93,6 +93,5 @@ |
544 |
+++ ../pr/tests/mbcs.c 2015-11-04 02:02:20.436041000 +0000 |
|
|
545 |
@@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam |
546 |
/* |
547 |
** Traverse directory |
548 |
*/ |
549 |
-static void TraverseDirectory( unsigned char *dir ) |
550 |
+static void TraverseDirectory(const char *dir) |
551 |
{ |
552 |
PRDir *cwd; |
553 |
PRDirEntry *dirEntry; |
554 |
PRFileInfo info; |
555 |
PRStatus rc; |
556 |
- PRInt32 err; |
557 |
PRFileDesc *fd; |
558 |
char nextDir[256]; |
559 |
char file[256]; |
560 |
@@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned |
561 |
exit(1); |
562 |
} |
563 |
if ( PR_FILE_FILE == info.type ) { |
564 |
- printf("File: %s \tsize: %ld\n", dirEntry->name, info.size ); |
565 |
+ printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size ); |
566 |
fd = PR_Open( file, PR_RDONLY, 0 ); |
567 |
if ( NULL == fd ) { |
568 |
printf("PR_Open() failed. Error: %ld, OSError: %ld\n", |
569 |
- PR_GetError(), PR_GetOSError()); |
570 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
571 |
} |
572 |
rc = PR_Close( fd ); |
573 |
if ( PR_FAILURE == rc ) { |
574 |
printf("PR_Close() failed. Error: %ld, OSError: %ld\n", |
575 |
- PR_GetError(), PR_GetOSError()); |
576 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
577 |
} |
578 |
} else if ( PR_FILE_DIRECTORY == info.type ) { |
579 |
sprintf( nextDir, "%s/%s", dir, dirEntry->name ); |
580 |
--- ../pr/tests/nbconn.c.orig 2015-10-16 13:22:19.000000000 +0000 |
581 |
+++ ../pr/tests/nbconn.c 2015-11-04 02:02:20.443098000 +0000 |
582 |
@@ -54,8 +54,7 @@ int main(int argc, char **argv) |
583 |
PRStatus rv; |
366 |
PRSocketOptionData optData; |
584 |
PRSocketOptionData optData; |
367 |
const char *hostname = NULL; |
585 |
const char *hostname = NULL; |
368 |
- PRIntn default_case, n, bytes_read, bytes_sent; |
586 |
- PRIntn default_case, n, bytes_read, bytes_sent; |
369 |
- PRInt32 failed_already = 0; |
587 |
- PRInt32 failed_already = 0; |
370 |
+ PRIntn default_case, n; |
588 |
+ PRIntn default_case, n; |
371 |
#ifdef XP_MAC |
589 |
|
372 |
int index; |
590 |
/* |
373 |
@@ -226,5 +225,5 @@ |
591 |
* -d debug mode |
|
|
592 |
@@ -164,7 +163,7 @@ int main(int argc, char **argv) |
593 |
exit(1); |
374 |
} |
594 |
} |
375 |
printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n", |
595 |
printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n", |
376 |
- PR_GetError(), PR_GetOSError()); |
596 |
- PR_GetError(), PR_GetOSError()); |
377 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
597 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
378 |
} |
598 |
} |
379 |
PR_Close(sock); |
599 |
PR_Close(sock); |
380 |
@@ -300,5 +299,5 @@ |
600 |
printf( "PASS\n"); |
|
|
601 |
@@ -235,7 +234,7 @@ connection_success_test() |
602 |
PRThread *thr = NULL; |
381 |
Server_Param sp; |
603 |
Server_Param sp; |
382 |
char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE]; |
604 |
char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE]; |
383 |
- PRIntn default_case, n, bytes_read, bytes_sent; |
605 |
- PRIntn default_case, n, bytes_read, bytes_sent; |
384 |
+ PRIntn n, bytes_read, bytes_sent; |
606 |
+ PRIntn n, bytes_read, bytes_sent; |
385 |
PRIntn failed_already = 0; |
607 |
PRIntn failed_already = 0; |
386 |
|
608 |
|
387 |
@@ -376,5 +375,5 @@ |
609 |
/* |
|
|
610 |
@@ -311,7 +310,7 @@ connection_success_test() |
611 |
failed_already=1; |
388 |
goto def_exit; |
612 |
goto def_exit; |
389 |
} |
613 |
} |
390 |
- DPRINTF(("Created TCP_Server thread [0x%x]\n",thr)); |
614 |
- DPRINTF(("Created TCP_Server thread [0x%x]\n",thr)); |
391 |
+ DPRINTF(("Created TCP_Server thread [%p]\n", thr)); |
615 |
+ DPRINTF(("Created TCP_Server thread [%p]\n", thr)); |
392 |
pd.fd = conn_fd; |
616 |
pd.fd = conn_fd; |
393 |
pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT; |
617 |
pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT; |
394 |
@@ -459,5 +458,5 @@ |
618 |
n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT); |
|
|
619 |
@@ -390,7 +389,7 @@ connection_success_test() |
620 |
DPRINTF(("Data integrity verified\n")); |
395 |
} else { |
621 |
} else { |
396 |
fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n", |
622 |
fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n", |
397 |
- PR_GetError(), PR_GetOSError()); |
623 |
- PR_GetError(), PR_GetOSError()); |
398 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
624 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
399 |
failed_already = 1; |
625 |
failed_already = 1; |
400 |
goto def_exit; |
626 |
goto def_exit; |
401 |
@@ -569,5 +568,4 @@ |
627 |
} |
|
|
628 |
@@ -496,7 +495,6 @@ connection_failure_test() |
629 |
goto def_exit; |
402 |
} |
630 |
} |
403 |
if (PR_GetConnectStatus(&pd) == PR_SUCCESS) { |
631 |
if (PR_GetConnectStatus(&pd) == PR_SUCCESS) { |
404 |
- PRInt32 rv; |
632 |
- PRInt32 rv; |
405 |
fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n"); |
633 |
fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n"); |
406 |
failed_already = 1; |
634 |
failed_already = 1; |
407 |
--- ../pr/tests/nblayer.c 2009-02-23 00:00:44.000000000 -0500 |
635 |
goto def_exit; |
408 |
+++ ../pr/tests/nblayer.c 2009-11-04 16:22:00.000000000 -0500 |
636 |
--- ../pr/tests/nblayer.c.orig 2015-10-16 13:22:19.000000000 +0000 |
409 |
@@ -332,5 +332,5 @@ |
637 |
+++ ../pr/tests/nblayer.c 2015-11-04 02:02:20.443837000 +0000 |
|
|
638 |
@@ -299,7 +299,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi |
639 |
static PRInt16 PR_CALLBACK MyPoll( |
410 |
PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags) |
640 |
PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags) |
411 |
{ |
641 |
{ |
412 |
- PRInt16 my_flags, new_flags; |
642 |
- PRInt16 my_flags, new_flags; |
413 |
+ PRInt16 my_flags = -1, new_flags; |
643 |
+ PRInt16 my_flags = -1, new_flags; |
414 |
PRFilePrivate *mine = (PRFilePrivate*)fd->secret; |
644 |
PRFilePrivate *mine = (PRFilePrivate*)fd->secret; |
415 |
if (0 != (PR_POLL_READ & in_flags)) |
645 |
if (0 != (PR_POLL_READ & in_flags)) |
416 |
@@ -375,5 +375,5 @@ |
646 |
{ |
|
|
647 |
@@ -342,7 +342,7 @@ static PRFileDesc * PR_CALLBACK MyAccept |
648 |
PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout) |
417 |
{ |
649 |
{ |
418 |
PRStatus rv; |
650 |
PRStatus rv; |
419 |
- PRFileDesc *newfd, *layer = fd; |
651 |
- PRFileDesc *newfd, *layer = fd; |
420 |
+ PRFileDesc *newfd; |
652 |
+ PRFileDesc *newfd; |
421 |
PRFileDesc *newstack; |
653 |
PRFileDesc *newstack; |
422 |
PRFilePrivate *newsecret; |
654 |
PRFilePrivate *newsecret; |
423 |
@@ -461,4 +461,6 @@ |
655 |
|
|
|
656 |
@@ -428,6 +428,8 @@ static PRInt32 PR_CALLBACK MyRecv( |
657 |
mine->rcvinprogress = 0; |
424 |
return mine->rcvreq; /* << -- that's it! */ |
658 |
return mine->rcvreq; /* << -- that's it! */ |
425 |
default: |
659 |
default: |
426 |
+ PR_ASSERT(!"How did I get this mine->rcvstate?"); |
660 |
+ PR_ASSERT(!"How did I get this mine->rcvstate?"); |
427 |
+ rv = -1; |
661 |
+ rv = -1; |
428 |
break; |
662 |
break; |
429 |
} |
663 |
} |
430 |
@@ -517,4 +517,6 @@ |
664 |
} while (-1 != rv); |
|
|
665 |
@@ -484,6 +486,8 @@ static PRInt32 PR_CALLBACK MySend( |
666 |
mine->xmtinprogress = 0; |
431 |
return mine->xmtreq; /* <<-- That's the one! */ |
667 |
return mine->xmtreq; /* <<-- That's the one! */ |
432 |
default: |
668 |
default: |
433 |
+ PR_ASSERT(!"How did I get this mine->xmtstate?"); |
669 |
+ PR_ASSERT(!"How did I get this mine->xmtstate?"); |
434 |
+ rv = -1; |
670 |
+ rv = -1; |
435 |
break; |
671 |
break; |
436 |
} |
672 |
} |
437 |
--- ../pr/tests/obsints.c Sun Apr 25 11:01:02 2004 |
673 |
} while (-1 != rv); |
438 |
+++ ../pr/tests/obsints.c Mon Jul 25 21:04:56 2005 |
674 |
--- ../pr/tests/nonblock.c.orig 2015-10-16 13:22:19.000000000 +0000 |
439 |
@@ -58,4 +58,7 @@ |
675 |
+++ ../pr/tests/nonblock.c 2015-11-04 02:02:20.436606000 +0000 |
|
|
676 |
@@ -39,7 +39,7 @@ |
677 |
static void PR_CALLBACK |
678 |
clientThreadFunc(void *arg) |
679 |
{ |
680 |
- PRUintn port = (PRUintn)arg; |
681 |
+ intptr_t port = (intptr_t)arg; |
682 |
PRFileDesc *sock; |
683 |
PRNetAddr addr; |
684 |
char buf[CHUNK_SIZE]; |
685 |
@@ -147,7 +147,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn |
686 |
printf("%s", buf); |
687 |
|
688 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
689 |
- clientThreadFunc, (void *) listenPort, |
690 |
+ clientThreadFunc, (void *) (intptr_t)listenPort, |
691 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
692 |
PR_UNJOINABLE_THREAD, 0); |
693 |
if (clientThread == NULL) { |
694 |
@@ -191,7 +191,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn |
695 |
if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) { |
696 |
PL_PrintError("First Receive:\n"); |
697 |
fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n", |
698 |
- retVal, PR_GetError()); |
699 |
+ (long)retVal, (long)PR_GetError()); |
700 |
exit(1); |
701 |
} |
702 |
printf("read: EWOULDBLOCK, good\n"); |
703 |
@@ -201,7 +201,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn |
704 |
if (retVal != CHUNK_SIZE) { |
705 |
PL_PrintError("Second Receive:\n"); |
706 |
fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n", |
707 |
- retVal, PR_GetError()); |
708 |
+ (long)retVal, (long)PR_GetError()); |
709 |
exit(1); |
710 |
} |
711 |
printf("read: %d bytes, good\n", retVal); |
712 |
--- ../pr/tests/obsints.c.orig 2015-10-16 13:22:19.000000000 +0000 |
713 |
+++ ../pr/tests/obsints.c 2015-11-04 02:02:20.444330000 +0000 |
714 |
@@ -25,6 +25,9 @@ int main(int argc, char **argv) |
715 |
#else /* NO_NSPR_10_SUPPORT */ |
440 |
|
716 |
|
441 |
#include "prtypes.h" /* which includes protypes.h */ |
717 |
#include "prtypes.h" /* which includes protypes.h */ |
442 |
+#if !defined(__GNUC__) |
718 |
+#if !defined(__GNUC__) |
443 |
+# define __unused |
719 |
+# define __unused |
444 |
+#endif |
720 |
+#endif |
445 |
|
721 |
|
446 |
int main() |
722 |
int main(int argc, char **argv) |
447 |
@@ -65,15 +68,15 @@ |
723 |
{ |
|
|
724 |
@@ -32,17 +35,17 @@ int main(int argc, char **argv) |
725 |
* Compilation fails if any of these integer types are not |
448 |
* defined by protypes.h. |
726 |
* defined by protypes.h. |
449 |
*/ |
727 |
*/ |
450 |
- intn in; |
728 |
- intn in; |
Lines 471-521
Link Here
|
471 |
+ uint64 ui64 __unused; |
749 |
+ uint64 ui64 __unused; |
472 |
|
750 |
|
473 |
printf("PASS\n"); |
751 |
printf("PASS\n"); |
474 |
--- ../pr/tests/perf.c Sun Apr 25 11:01:02 2004 |
752 |
return 0; |
475 |
+++ ../pr/tests/perf.c Mon Jul 25 21:05:55 2005 |
753 |
--- ../pr/tests/parsetm.c.orig 2015-10-16 13:22:19.000000000 +0000 |
476 |
@@ -181,5 +181,5 @@ |
754 |
+++ ../pr/tests/parsetm.c 2015-11-04 02:02:20.467739000 +0000 |
|
|
755 |
@@ -31,8 +31,8 @@ static void PrintExplodedTime(const PREx |
756 |
|
757 |
/* Print day of the week, month, day, hour, minute, and second */ |
758 |
if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ", |
759 |
- dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
760 |
- et->tm_hour, et->tm_min, et->tm_sec); |
761 |
+ dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday, |
762 |
+ (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec); |
763 |
|
764 |
/* Print time zone */ |
765 |
totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset; |
766 |
@@ -47,7 +47,7 @@ static void PrintExplodedTime(const PREx |
767 |
hourOffset = totalOffset / 3600; |
768 |
minOffset = (totalOffset % 3600) / 60; |
769 |
if (debug_mode) |
770 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
771 |
+ printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset); |
772 |
} |
773 |
|
774 |
/* Print year */ |
775 |
--- ../pr/tests/peek.c.orig 2015-10-16 13:22:19.000000000 +0000 |
776 |
+++ ../pr/tests/peek.c 2015-11-04 02:02:20.437204000 +0000 |
777 |
@@ -135,7 +135,7 @@ static void ClientNB(void *arg) |
778 |
{ |
779 |
PRFileDesc *sock; |
780 |
PRSocketOptionData opt; |
781 |
- PRUint16 port = (PRUint16) arg; |
782 |
+ PRUint16 port = (intptr_t) arg; |
783 |
PRNetAddr addr; |
784 |
char buf[BUFFER_SIZE]; |
785 |
PRPollDesc pd; |
786 |
@@ -299,7 +299,7 @@ RunTest(PRThreadScope scope, PRFileDesc |
787 |
exit(1); |
788 |
} |
789 |
client = PR_CreateThread( |
790 |
- PR_USER_THREAD, ClientNB, (void *) port, |
791 |
+ PR_USER_THREAD, ClientNB, (void *)(intptr_t) port, |
792 |
PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0); |
793 |
if (NULL == client) { |
794 |
fprintf(stderr, "PR_CreateThread failed\n"); |
795 |
--- ../pr/tests/perf.c.orig 2015-10-16 13:22:19.000000000 +0000 |
796 |
+++ ../pr/tests/perf.c 2015-11-04 02:02:20.445028000 +0000 |
797 |
@@ -141,7 +141,7 @@ static void PR_CALLBACK CXReader(void *a |
798 |
n = count / 2; |
477 |
for (i = 0; i < n; i++) { |
799 |
for (i = 0; i < n; i++) { |
478 |
while (cxq == 0) { |
800 |
while (cxq == 0) { |
479 |
- DPRINTF(("CXReader: thread = 0x%lx waiting\n", |
801 |
- DPRINTF(("CXReader: thread = 0x%lx waiting\n", |
480 |
+ DPRINTF(("CXReader: thread = %p waiting\n", |
802 |
+ DPRINTF(("CXReader: thread = %p waiting\n", |
481 |
PR_GetCurrentThread())); |
803 |
PR_GetCurrentThread())); |
482 |
PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT); |
804 |
PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT); |
483 |
@@ -194,5 +194,5 @@ |
805 |
} |
|
|
806 |
@@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a |
807 |
--alive; |
484 |
PR_Notify(mon2); |
808 |
PR_Notify(mon2); |
485 |
PR_ExitMonitor(mon2); |
809 |
PR_ExitMonitor(mon2); |
486 |
- DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
810 |
- DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
487 |
+ DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread())); |
811 |
+ DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread())); |
488 |
} |
812 |
} |
489 |
|
813 |
|
490 |
@@ -205,5 +205,5 @@ |
814 |
static void PR_CALLBACK CXWriter(void *arg) |
|
|
815 |
@@ -165,7 +165,7 @@ static void PR_CALLBACK CXWriter(void *a |
816 |
n = count / 2; |
491 |
for (i = 0; i < n; i++) { |
817 |
for (i = 0; i < n; i++) { |
492 |
while (cxq == 1) { |
818 |
while (cxq == 1) { |
493 |
- DPRINTF(("CXWriter: thread = 0x%lx waiting\n", |
819 |
- DPRINTF(("CXWriter: thread = 0x%lx waiting\n", |
494 |
+ DPRINTF(("CXWriter: thread = %p waiting\n", |
820 |
+ DPRINTF(("CXWriter: thread = %p waiting\n", |
495 |
PR_GetCurrentThread())); |
821 |
PR_GetCurrentThread())); |
496 |
PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT); |
822 |
PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT); |
497 |
@@ -218,5 +218,5 @@ |
823 |
} |
|
|
824 |
@@ -178,7 +178,7 @@ static void PR_CALLBACK CXWriter(void *a |
825 |
--alive; |
498 |
PR_Notify(mon2); |
826 |
PR_Notify(mon2); |
499 |
PR_ExitMonitor(mon2); |
827 |
PR_ExitMonitor(mon2); |
500 |
- DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
828 |
- DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
501 |
+ DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread())); |
829 |
+ DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread())); |
502 |
} |
830 |
} |
503 |
|
831 |
|
504 |
@@ -238,5 +238,5 @@ |
832 |
static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2) |
|
|
833 |
@@ -198,7 +198,7 @@ static void ContextSwitch(PRThreadScope |
834 |
if (NULL == t1) { |
505 |
fprintf(stderr, "ContextSwitch: cannot create thread\n"); |
835 |
fprintf(stderr, "ContextSwitch: cannot create thread\n"); |
506 |
} else { |
836 |
} else { |
507 |
- DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n", |
837 |
- DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n", |
508 |
+ DPRINTF(("ContextSwitch: created %s thread = %p\n", |
838 |
+ DPRINTF(("ContextSwitch: created %s thread = %p\n", |
509 |
(scope1 == PR_GLOBAL_THREAD ? |
839 |
(scope1 == PR_GLOBAL_THREAD ? |
510 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
840 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
511 |
@@ -252,5 +252,5 @@ |
841 |
t1)); |
|
|
842 |
@@ -212,7 +212,7 @@ static void ContextSwitch(PRThreadScope |
843 |
if (NULL == t2) { |
512 |
fprintf(stderr, "ContextSwitch: cannot create thread\n"); |
844 |
fprintf(stderr, "ContextSwitch: cannot create thread\n"); |
513 |
} else { |
845 |
} else { |
514 |
- DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n", |
846 |
- DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n", |
515 |
+ DPRINTF(("ContextSwitch: created %s thread = %p\n", |
847 |
+ DPRINTF(("ContextSwitch: created %s thread = %p\n", |
516 |
(scope2 == PR_GLOBAL_THREAD ? |
848 |
(scope2 == PR_GLOBAL_THREAD ? |
517 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
849 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
518 |
@@ -294,8 +294,8 @@ |
850 |
t2)); |
|
|
851 |
@@ -254,10 +254,10 @@ static void PR_CALLBACK SemaThread(void |
852 |
|
519 |
n = count / 2; |
853 |
n = count / 2; |
520 |
for (i = 0; i < n; i++) { |
854 |
for (i = 0; i < n; i++) { |
521 |
- DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n", |
855 |
- DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n", |
Lines 526-599
Link Here
|
526 |
+ DPRINTF(("SemaThread: thread = %p posting on sem = %p\n", |
860 |
+ DPRINTF(("SemaThread: thread = %p posting on sem = %p\n", |
527 |
PR_GetCurrentThread(), sem[1])); |
861 |
PR_GetCurrentThread(), sem[1])); |
528 |
PR_PostSem(sem[1]); |
862 |
PR_PostSem(sem[1]); |
529 |
@@ -306,5 +306,5 @@ |
863 |
} |
|
|
864 |
@@ -266,7 +266,7 @@ static void PR_CALLBACK SemaThread(void |
865 |
--alive; |
530 |
PR_Notify(mon2); |
866 |
PR_Notify(mon2); |
531 |
PR_ExitMonitor(mon2); |
867 |
PR_ExitMonitor(mon2); |
532 |
- DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
868 |
- DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread())); |
533 |
+ DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread())); |
869 |
+ DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread())); |
534 |
} |
870 |
} |
535 |
|
871 |
|
536 |
@@ -334,5 +334,5 @@ |
872 |
static PRSemaphore *sem_set1[2]; |
|
|
873 |
@@ -294,7 +294,7 @@ static void SemaContextSwitch(PRThreadSc |
874 |
if (NULL == t1) { |
537 |
fprintf(stderr, "SemaContextSwitch: cannot create thread\n"); |
875 |
fprintf(stderr, "SemaContextSwitch: cannot create thread\n"); |
538 |
} else { |
876 |
} else { |
539 |
- DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n", |
877 |
- DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n", |
540 |
+ DPRINTF(("SemaContextSwitch: created %s thread = %p\n", |
878 |
+ DPRINTF(("SemaContextSwitch: created %s thread = %p\n", |
541 |
(scope1 == PR_GLOBAL_THREAD ? |
879 |
(scope1 == PR_GLOBAL_THREAD ? |
542 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
880 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
543 |
@@ -349,5 +349,5 @@ |
881 |
t1)); |
|
|
882 |
@@ -309,7 +309,7 @@ static void SemaContextSwitch(PRThreadSc |
883 |
if (NULL == t2) { |
544 |
fprintf(stderr, "SemaContextSwitch: cannot create thread\n"); |
884 |
fprintf(stderr, "SemaContextSwitch: cannot create thread\n"); |
545 |
} else { |
885 |
} else { |
546 |
- DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n", |
886 |
- DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n", |
547 |
+ DPRINTF(("SemaContextSwitch: created %s thread = %p\n", |
887 |
+ DPRINTF(("SemaContextSwitch: created %s thread = %p\n", |
548 |
(scope2 == PR_GLOBAL_THREAD ? |
888 |
(scope2 == PR_GLOBAL_THREAD ? |
549 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
889 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"), |
550 |
--- ../pr/tests/prpoll.c 2009-05-06 01:40:39.000000000 -0400 |
890 |
t2)); |
551 |
+++ ../pr/tests/prpoll.c 2009-11-04 16:31:54.000000000 -0500 |
891 |
--- ../pr/tests/pipepong.c.orig 2015-10-16 13:22:19.000000000 +0000 |
552 |
@@ -72,5 +72,5 @@ |
892 |
+++ ../pr/tests/pipepong.c 2015-11-04 02:02:20.437688000 +0000 |
|
|
893 |
@@ -36,7 +36,7 @@ int main(int argc, char **argv) |
894 |
nBytes = fread(buf, 1, 5, stdin); |
895 |
fprintf(stderr, "pong process: received \"%s\"\n", buf); |
896 |
if (nBytes != 5) { |
897 |
- fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n", |
898 |
+ fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n", |
899 |
nBytes); |
900 |
exit(1); |
901 |
} |
902 |
--- ../pr/tests/poll_nm.c.orig 2015-10-16 13:22:19.000000000 +0000 |
903 |
+++ ../pr/tests/poll_nm.c 2015-11-04 02:02:20.438299000 +0000 |
904 |
@@ -47,7 +47,7 @@ PRIntn debug_mode; |
905 |
static void PR_CALLBACK |
906 |
clientThreadFunc(void *arg) |
907 |
{ |
908 |
- PRUintn port = (PRUintn) arg; |
909 |
+ PRUintn port = (intptr_t) arg; |
910 |
PRFileDesc *sock; |
911 |
PRNetAddr addr; |
912 |
char buf[128]; |
913 |
@@ -196,7 +196,7 @@ int main(int argc, char **argv) |
914 |
npds = 5; |
915 |
|
916 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
917 |
- clientThreadFunc, (void *) listenPort1, |
918 |
+ clientThreadFunc, (void *)(intptr_t)listenPort1, |
919 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
920 |
PR_UNJOINABLE_THREAD, 0); |
921 |
if (clientThread == NULL) { |
922 |
@@ -206,7 +206,7 @@ int main(int argc, char **argv) |
923 |
} |
924 |
|
925 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
926 |
- clientThreadFunc, (void *) listenPort2, |
927 |
+ clientThreadFunc, (void *)(intptr_t)listenPort2, |
928 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
929 |
PR_UNJOINABLE_THREAD, 0); |
930 |
if (clientThread == NULL) { |
931 |
--- ../pr/tests/provider.c.orig 2015-10-16 13:22:19.000000000 +0000 |
932 |
+++ ../pr/tests/provider.c 2015-11-04 02:02:20.468667000 +0000 |
933 |
@@ -1049,7 +1049,7 @@ int main(int argc, char **argv) |
934 |
{ |
935 |
PRUintn index; |
936 |
PRBool boolean; |
937 |
- CSClient_t *client; |
938 |
+ CSClient_t *client = NULL; |
939 |
PRStatus rv, joinStatus; |
940 |
CSServer_t *server = NULL; |
941 |
char *thread_type; |
942 |
--- ../pr/tests/prpoll.c.orig 2015-10-16 13:22:19.000000000 +0000 |
943 |
+++ ../pr/tests/prpoll.c 2015-11-04 02:02:20.445656000 +0000 |
944 |
@@ -39,7 +39,7 @@ int main(int argc, char **argv) |
945 |
static void |
553 |
clientThreadFunc(void *arg) |
946 |
clientThreadFunc(void *arg) |
554 |
{ |
947 |
{ |
555 |
- PRUint16 port = (PRUint16) arg; |
948 |
- PRUint16 port = (PRUint16) arg; |
556 |
+ PRUint16 port = (PRUint16)(uintptr_t)arg; |
949 |
+ PRUint16 port = (PRUint16)(uintptr_t)arg; |
557 |
PRFileDesc *sock; |
950 |
PRFileDesc *sock; |
558 |
PRNetAddr addr; |
951 |
PRNetAddr addr; |
559 |
@@ -106,5 +106,5 @@ |
952 |
char buf[BUF_SIZE]; |
|
|
953 |
@@ -73,7 +73,7 @@ int main(int argc, char **argv) |
954 |
PRInt32 rv; |
560 |
PROsfd sd; |
955 |
PROsfd sd; |
561 |
struct sockaddr_in saddr; |
956 |
struct sockaddr_in saddr; |
562 |
- PRIntn saddr_len; |
957 |
- PRIntn saddr_len; |
563 |
+ socklen_t saddr_len; |
958 |
+ socklen_t saddr_len; |
564 |
PRUint16 listenPort3; |
959 |
PRUint16 listenPort3; |
565 |
PRFileDesc *socket_poll_fd; |
960 |
PRFileDesc *socket_poll_fd; |
566 |
@@ -232,5 +232,5 @@ |
961 |
PRIntn i, j; |
|
|
962 |
@@ -199,7 +199,7 @@ int main(int argc, char **argv) |
963 |
npds--; |
567 |
|
964 |
|
568 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
965 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
569 |
- clientThreadFunc, (void *) listenPort1, |
966 |
- clientThreadFunc, (void *) listenPort1, |
570 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort1, |
967 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort1, |
571 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
968 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
572 |
PR_UNJOINABLE_THREAD, 0); |
969 |
PR_UNJOINABLE_THREAD, 0); |
573 |
@@ -241,5 +241,5 @@ |
970 |
if (clientThread == NULL) { |
|
|
971 |
@@ -208,7 +208,7 @@ int main(int argc, char **argv) |
972 |
} |
574 |
|
973 |
|
575 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
974 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
576 |
- clientThreadFunc, (void *) listenPort2, |
975 |
- clientThreadFunc, (void *) listenPort2, |
577 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort2, |
976 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort2, |
578 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, |
977 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, |
579 |
PR_UNJOINABLE_THREAD, 0); |
978 |
PR_UNJOINABLE_THREAD, 0); |
580 |
@@ -250,5 +250,5 @@ |
979 |
if (clientThread == NULL) { |
|
|
980 |
@@ -217,7 +217,7 @@ int main(int argc, char **argv) |
981 |
} |
581 |
|
982 |
|
582 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
983 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
583 |
- clientThreadFunc, (void *) listenPort3, |
984 |
- clientThreadFunc, (void *) listenPort3, |
584 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort3, |
985 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort3, |
585 |
PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD, |
986 |
PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD, |
586 |
PR_UNJOINABLE_THREAD, 0); |
987 |
PR_UNJOINABLE_THREAD, 0); |
587 |
--- ../pr/tests/ranfile.c Sun Apr 25 11:01:02 2004 |
988 |
if (clientThread == NULL) { |
588 |
+++ ../pr/tests/ranfile.c Mon Jul 25 21:13:44 2005 |
989 |
--- ../pr/tests/randseed.c.orig 2015-10-16 13:22:19.000000000 +0000 |
589 |
@@ -169,5 +169,5 @@ |
990 |
+++ ../pr/tests/randseed.c 2015-11-04 02:02:20.446756000 +0000 |
|
|
991 |
@@ -48,7 +48,6 @@ static void Help( void ) |
992 |
static void PrintRand( void *buf, PRIntn size ) |
993 |
{ |
994 |
PRUint32 *rp = buf; |
995 |
- PRIntn i; |
996 |
|
997 |
printf("%4.4d--\n", size ); |
998 |
while (size > 0 ) { |
999 |
--- ../pr/tests/ranfile.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1000 |
+++ ../pr/tests/ranfile.c 2015-11-04 02:02:20.446281000 +0000 |
1001 |
@@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg |
1002 |
PRStatus rv = PR_SUCCESS; |
590 |
Hammer_t *cd = (Hammer_t*)arg; |
1003 |
Hammer_t *cd = (Hammer_t*)arg; |
591 |
|
1004 |
|
592 |
- (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id); |
1005 |
- (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id); |
593 |
+ (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id); |
1006 |
+ (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id); |
594 |
|
1007 |
|
595 |
if (debug_mode) printf("Starting work on %s\n", filename); |
1008 |
if (debug_mode) printf("Starting work on %s\n", filename); |
596 |
@@ -408,6 +408,6 @@ |
1009 |
|
|
|
1010 |
@@ -364,14 +364,14 @@ int main(int argc, char **argv) |
1011 |
} |
597 |
else |
1012 |
else |
598 |
if (debug_mode) printf( |
1013 |
if (debug_mode) printf( |
599 |
- "%s: test failed %s after %ld seconds\n", |
1014 |
- "%s: test failed %s after %ld seconds\n", |
Lines 602-625
Link Here
|
602 |
+ programName, where[hammer[poll].problem], (int)duration); |
1017 |
+ programName, where[hammer[poll].problem], (int)duration); |
603 |
else failed_already=1; |
1018 |
else failed_already=1; |
604 |
} |
1019 |
} |
605 |
@@ -415,5 +415,5 @@ |
1020 |
} |
606 |
} |
1021 |
} |
607 |
if (debug_mode) printf( |
1022 |
if (debug_mode) printf( |
608 |
- "%s: [%ld [%ld] %ld] writes/sec average\n", |
1023 |
- "%s: [%ld [%ld] %ld] writes/sec average\n", |
609 |
+ "%s: [%d [%d] %d] writes/sec average\n", |
1024 |
+ "%s: [%d [%d] %d] writes/sec average\n", |
610 |
programName, writesMin, writesTot * 1000 / durationTot, writesMax); |
1025 |
programName, writesMin, writesTot * 1000 / durationTot, writesMax); |
611 |
|
1026 |
|
612 |
--- ../pr/tests/randseed.c Fri Apr 29 18:46:05 2005 |
1027 |
PR_DestroyCondVar(cv); |
613 |
+++ ../pr/tests/randseed.c Mon Jul 25 21:15:01 2005 |
1028 |
--- ../pr/tests/runtests.sh.orig 2015-10-16 13:22:19.000000000 +0000 |
614 |
@@ -81,5 +81,4 @@ |
1029 |
+++ ../pr/tests/runtests.sh 2015-11-04 02:02:20.463710000 +0000 |
615 |
{ |
1030 |
@@ -58,9 +58,6 @@ fi |
616 |
PRUint32 *rp = buf; |
1031 |
# Tests not run (but should) |
617 |
- PRIntn i; |
1032 |
# |
618 |
|
1033 |
|
619 |
printf("%4.4d--\n", size ); |
1034 |
-#forktest (failed on IRIX) |
620 |
--- ../pr/tests/sel_spd.c 2009-05-06 01:40:39.000000000 -0400 |
1035 |
-#nbconn - fails on some platforms |
621 |
+++ ../pr/tests/sel_spd.c 2009-11-04 16:34:14.000000000 -0500 |
1036 |
-#poll_er - fails on some platforms? limited use? |
622 |
@@ -48,4 +48,7 @@ |
1037 |
#prpoll - the bad-FD test needs to be moved to a different test |
|
|
1038 |
#sleep - specific to OS/2 |
1039 |
|
1040 |
@@ -92,6 +89,7 @@ exit |
1041 |
fdcach |
1042 |
fileio |
1043 |
foreign |
1044 |
+forktest |
1045 |
formattm |
1046 |
fsync |
1047 |
gethost |
1048 |
@@ -99,7 +97,6 @@ getproto |
1049 |
i2l |
1050 |
initclk |
1051 |
inrval |
1052 |
-instrumt |
1053 |
intrio |
1054 |
intrupt |
1055 |
io_timeout |
1056 |
@@ -120,6 +117,7 @@ logger |
1057 |
many_cv |
1058 |
multiwait |
1059 |
nameshm1 |
1060 |
+nbconn |
1061 |
nblayer |
1062 |
nonblock |
1063 |
ntioto |
1064 |
@@ -136,6 +134,7 @@ perf |
1065 |
pipeping |
1066 |
pipeping2 |
1067 |
pipeself |
1068 |
+poll_er |
1069 |
poll_nm |
1070 |
poll_to |
1071 |
pollable |
1072 |
@@ -208,7 +207,7 @@ OBJDIR=`basename $PWD` |
1073 |
printf "\nNSPR Test Results - $OBJDIR\n\n" |
1074 |
printf "BEGIN\t\t\t`date`\n" |
1075 |
printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n" |
1076 |
-printf "Test\t\t\tResult\n\n" |
1077 |
+printf " Test\t\t\tResult\n\n" |
1078 |
if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then |
1079 |
for prog in $TESTS |
1080 |
do |
1081 |
@@ -226,10 +225,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [ |
1082 |
else |
1083 |
for prog in $TESTS |
1084 |
do |
1085 |
- printf "$prog" |
1086 |
- printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1 |
1087 |
- export test_rval |
1088 |
- ./$prog >> ${LOGFILE} 2>&1 & |
1089 |
+ printf %16s $prog |
1090 |
+ ./$prog >> $prog.output 2>&1 & |
1091 |
test_pid=$! |
1092 |
sleep_pid=0 |
1093 |
if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0 |
1094 |
@@ -244,28 +241,11 @@ else |
1095 |
printf "\t\t\tPassed\n"; |
1096 |
else |
1097 |
printf "\t\t\tFAILED\n"; |
1098 |
+ sed "s,^, $prog: ," < $prog.output |
1099 |
rval=1 |
1100 |
fi; |
1101 |
- printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1 |
1102 |
done |
1103 |
fi; |
1104 |
|
1105 |
printf "END\t\t\t`date`\n" |
1106 |
exit $rval |
1107 |
- |
1108 |
- |
1109 |
- |
1110 |
- |
1111 |
- |
1112 |
- |
1113 |
- |
1114 |
- |
1115 |
- |
1116 |
- |
1117 |
- |
1118 |
- |
1119 |
- |
1120 |
- |
1121 |
- |
1122 |
- |
1123 |
- |
1124 |
--- ../pr/tests/sel_spd.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1125 |
+++ ../pr/tests/sel_spd.c 2015-11-04 02:02:20.447432000 +0000 |
1126 |
@@ -15,6 +15,9 @@ |
1127 |
#include <stdio.h> |
623 |
#include <errno.h> |
1128 |
#include <errno.h> |
624 |
#include <string.h> |
1129 |
#include <string.h> |
625 |
+#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
1130 |
+#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
Lines 627-633
Link Here
|
627 |
+#endif |
1132 |
+#endif |
628 |
#ifdef SYMBIAN |
1133 |
#ifdef SYMBIAN |
629 |
#include <getopt.h> |
1134 |
#include <getopt.h> |
630 |
@@ -55,14 +58,14 @@ |
1135 |
#endif |
|
|
1136 |
@@ -22,16 +25,16 @@ |
1137 |
#define PORT_BASE 19000 |
631 |
|
1138 |
|
632 |
typedef struct timer_slot_t { |
1139 |
typedef struct timer_slot_t { |
633 |
- unsigned long d_connect; |
1140 |
- unsigned long d_connect; |
Lines 650-656
Link Here
|
650 |
+static int _client_data = 8192; |
1157 |
+static int _client_data = 8192; |
651 |
|
1158 |
|
652 |
#ifdef SYMBIAN |
1159 |
#ifdef SYMBIAN |
653 |
@@ -73,10 +76,9 @@ |
1160 |
/* |
|
|
1161 |
@@ -40,12 +43,11 @@ static long _client_data = 8192; |
1162 |
* memory and not be able to allocate thread stack or client/server data |
654 |
* buffer. |
1163 |
* buffer. |
655 |
*/ |
1164 |
*/ |
656 |
-static long _server_data = (8*1024); |
1165 |
-static long _server_data = (8*1024); |
Lines 664-677
Link Here
|
664 |
+static int _threads_max = 10, _threads = 10; |
1173 |
+static int _threads_max = 10, _threads = 10; |
665 |
|
1174 |
|
666 |
static int verbose=0; |
1175 |
static int verbose=0; |
667 |
@@ -134,5 +136,5 @@ |
1176 |
static PRMonitor *exit_cv; |
|
|
1177 |
@@ -101,7 +103,7 @@ _server_thread(void *arg_id) |
1178 |
void _client_thread(void *); |
668 |
PRThread *thread; |
1179 |
PRThread *thread; |
669 |
int *id = (int *)arg_id; |
1180 |
int *id = (int *)arg_id; |
670 |
- PRFileDesc *sock; |
1181 |
- PRFileDesc *sock; |
671 |
+ PRFileDesc *sock = NULL; |
1182 |
+ PRFileDesc *sock = NULL; |
672 |
PRSocketOptionData sockopt; |
1183 |
PRSocketOptionData sockopt; |
673 |
PRNetAddr sa; |
1184 |
PRNetAddr sa; |
674 |
@@ -502,10 +504,10 @@ |
1185 |
PRFileDesc * newsock; |
|
|
1186 |
@@ -469,12 +471,12 @@ void |
1187 |
tally_results(int verbose) |
675 |
{ |
1188 |
{ |
676 |
int index; |
1189 |
int index; |
677 |
- unsigned long tot_connect = 0; |
1190 |
- unsigned long tot_connect = 0; |
Lines 688-725
Link Here
|
688 |
+ unsigned int tot_requests = 0; |
1201 |
+ unsigned int tot_requests = 0; |
689 |
|
1202 |
|
690 |
fprintf(stdout, "Server results:\n\n"); |
1203 |
fprintf(stdout, "Server results:\n\n"); |
691 |
--- ../pr/tests/selct_nm.c Sun Apr 25 11:01:02 2004 |
1204 |
for (index=0; index<_threads_max*2; index+=2) { |
692 |
+++ ../pr/tests/selct_nm.c Mon Jul 25 21:21:56 2005 |
1205 |
--- ../pr/tests/selct_nm.c.orig 2015-10-16 13:22:19.000000000 +0000 |
693 |
@@ -82,5 +82,5 @@ |
1206 |
+++ ../pr/tests/selct_nm.c 2015-11-04 02:02:20.447983000 +0000 |
|
|
1207 |
@@ -45,7 +45,7 @@ PRIntn debug_mode; |
1208 |
static void |
694 |
clientThreadFunc(void *arg) |
1209 |
clientThreadFunc(void *arg) |
695 |
{ |
1210 |
{ |
696 |
- PRUintn port = (PRUintn) arg; |
1211 |
- PRUintn port = (PRUintn) arg; |
697 |
+ PRUintn port = (PRUintn)(uintptr_t)arg; |
1212 |
+ PRUintn port = (PRUintn)(uintptr_t)arg; |
698 |
PRFileDesc *sock; |
1213 |
PRFileDesc *sock; |
699 |
PRNetAddr addr; |
1214 |
PRNetAddr addr; |
700 |
@@ -202,5 +202,5 @@ |
1215 |
char buf[128]; |
|
|
1216 |
@@ -165,7 +165,7 @@ failed_already=1; |
1217 |
if (debug_mode) printf("%s", buf); |
701 |
|
1218 |
|
702 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
1219 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
703 |
- clientThreadFunc, (void *) listenPort1, |
1220 |
- clientThreadFunc, (void *) listenPort1, |
704 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort1, |
1221 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort1, |
705 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
1222 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
706 |
PR_UNJOINABLE_THREAD, 0); |
1223 |
PR_UNJOINABLE_THREAD, 0); |
707 |
@@ -212,5 +212,5 @@ |
1224 |
if (clientThread == NULL) { |
|
|
1225 |
@@ -175,7 +175,7 @@ failed_already=1; |
1226 |
} |
708 |
|
1227 |
|
709 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
1228 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
710 |
- clientThreadFunc, (void *) listenPort2, |
1229 |
- clientThreadFunc, (void *) listenPort2, |
711 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort2, |
1230 |
+ clientThreadFunc, (void *)(uintptr_t)listenPort2, |
712 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
1231 |
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, |
713 |
PR_UNJOINABLE_THREAD, 0); |
1232 |
PR_UNJOINABLE_THREAD, 0); |
714 |
--- ../pr/tests/select2.c Sun Apr 25 11:01:02 2004 |
1233 |
if (clientThread == NULL) { |
715 |
+++ ../pr/tests/select2.c Mon Jul 25 21:27:44 2005 |
1234 |
--- ../pr/tests/select2.c.orig 2015-10-16 13:22:19.000000000 +0000 |
716 |
@@ -86,4 +86,5 @@ |
1235 |
+++ ../pr/tests/select2.c 2015-11-04 02:02:20.448561000 +0000 |
|
|
1236 |
@@ -53,6 +53,7 @@ PRInt32 count; |
1237 |
** |
717 |
***********************************************************************/ |
1238 |
***********************************************************************/ |
718 |
|
1239 |
|
719 |
+static int exitcode = 2; |
1240 |
+static int exitcode = 2; |
720 |
|
1241 |
|
721 |
static void Test_Result (int result) |
1242 |
static void Test_Result (int result) |
722 |
@@ -93,7 +94,10 @@ |
1243 |
{ |
|
|
1244 |
@@ -60,9 +61,12 @@ static void Test_Result (int result) |
1245 |
{ |
723 |
case PASS: |
1246 |
case PASS: |
724 |
printf ("PASS\n"); |
1247 |
printf ("PASS\n"); |
725 |
+ if (exitcode == 2) |
1248 |
+ if (exitcode == 2) |
Lines 730-798
Link Here
|
730 |
+ exitcode = 1; |
1253 |
+ exitcode = 1; |
731 |
break; |
1254 |
break; |
732 |
default: |
1255 |
default: |
733 |
@@ -352,3 +357,4 @@ |
1256 |
printf ("NOSTATUS\n"); |
|
|
1257 |
@@ -319,4 +323,5 @@ int main(int argc, char **argv) |
1258 |
PR_Cleanup(); |
734 |
|
1259 |
|
735 |
|
1260 |
|
736 |
+ return exitcode; |
1261 |
+ return exitcode; |
737 |
} |
1262 |
} |
738 |
--- ../pr/tests/semaerr.c Sun Apr 25 11:01:02 2004 |
1263 |
--- ../pr/tests/semaerr.c.orig 2015-10-16 13:22:19.000000000 +0000 |
739 |
+++ ../pr/tests/semaerr.c Mon Jul 25 21:29:23 2005 |
1264 |
+++ ../pr/tests/semaerr.c 2015-11-04 02:02:20.449040000 +0000 |
740 |
@@ -91,5 +91,5 @@ |
1265 |
@@ -65,7 +65,7 @@ int main(int argc, char **argv) |
|
|
1266 |
exit(1); |
741 |
} |
1267 |
} |
742 |
if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) { |
1268 |
if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) { |
743 |
- fprintf(stderr, "Expected error is %d but got (%d, %d)\n", |
1269 |
- fprintf(stderr, "Expected error is %d but got (%d, %d)\n", |
744 |
+ fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n", |
1270 |
+ fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n", |
745 |
PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError()); |
1271 |
PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError()); |
746 |
exit(1); |
1272 |
exit(1); |
747 |
--- ../pr/tests/semaerr1.c Sun Apr 25 11:01:02 2004 |
1273 |
} |
748 |
+++ ../pr/tests/semaerr1.c Mon Jul 25 21:30:25 2005 |
1274 |
--- ../pr/tests/semaerr1.c.orig 2015-10-16 13:22:19.000000000 +0000 |
749 |
@@ -103,5 +103,5 @@ |
1275 |
+++ ../pr/tests/semaerr1.c 2015-11-04 02:02:20.449526000 +0000 |
|
|
1276 |
@@ -75,7 +75,7 @@ int main(int argc, char **argv) |
1277 |
exit(1); |
750 |
} |
1278 |
} |
751 |
if (PR_GetError() != PR_FILE_EXISTS_ERROR) { |
1279 |
if (PR_GetError() != PR_FILE_EXISTS_ERROR) { |
752 |
- fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR, |
1280 |
- fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR, |
753 |
+ fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR, |
1281 |
+ fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR, |
754 |
PR_GetError()); |
1282 |
PR_GetError()); |
755 |
exit(1); |
1283 |
exit(1); |
756 |
--- ../pr/tests/sendzlf.c Sun Apr 25 11:01:02 2004 |
1284 |
} |
757 |
+++ ../pr/tests/sendzlf.c Mon Jul 25 21:31:35 2005 |
1285 |
--- ../pr/tests/sendzlf.c.orig 2015-10-16 13:22:19.000000000 +0000 |
758 |
@@ -59,5 +59,5 @@ |
1286 |
+++ ../pr/tests/sendzlf.c 2015-11-04 02:02:20.450064000 +0000 |
|
|
1287 |
@@ -26,7 +26,7 @@ static void ClientThread(void *arg) |
1288 |
{ |
759 |
PRFileDesc *sock; |
1289 |
PRFileDesc *sock; |
760 |
PRNetAddr addr; |
1290 |
PRNetAddr addr; |
761 |
- PRUint16 port = (PRUint16) arg; |
1291 |
- PRUint16 port = (PRUint16) arg; |
762 |
+ PRUint16 port = (PRUint16)(uintptr_t)arg; |
1292 |
+ PRUint16 port = (PRUint16)(uintptr_t)arg; |
763 |
char buf[1024]; |
1293 |
char buf[1024]; |
764 |
char *bufPtr; |
1294 |
char *bufPtr; |
765 |
@@ -217,5 +217,5 @@ |
1295 |
PRInt32 nbytes; |
|
|
1296 |
@@ -184,7 +184,7 @@ int main(int argc, char **argv) |
1297 |
} |
766 |
|
1298 |
|
767 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
1299 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
768 |
- ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)), |
1300 |
- ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)), |
769 |
+ ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)), |
1301 |
+ ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)), |
770 |
PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0); |
1302 |
PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0); |
771 |
if (NULL == clientThread) { |
1303 |
if (NULL == clientThread) { |
772 |
--- ../pr/tests/servr_kk.c Sun Apr 25 11:01:02 2004 |
1304 |
fprintf(stderr, "PR_CreateThread failed\n"); |
773 |
+++ ../pr/tests/servr_kk.c Mon Jul 25 21:38:28 2005 |
1305 |
--- ../pr/tests/server_test.c.orig 2015-10-16 13:22:19.000000000 +0000 |
774 |
@@ -90,5 +90,5 @@ |
1306 |
+++ ../pr/tests/server_test.c 2015-11-04 02:02:20.464401000 +0000 |
|
|
1307 |
@@ -60,7 +60,7 @@ PRCondVar *ServerStateCV; |
1308 |
#ifdef DEBUGPRINTS |
1309 |
#define DPRINTF printf |
1310 |
#else |
1311 |
-#define DPRINTF |
1312 |
+#define DPRINTF(...) |
1313 |
#endif |
1314 |
|
1315 |
|
1316 |
@@ -502,6 +502,7 @@ static void do_workUU(void) |
1317 |
do_work(); |
1318 |
} |
1319 |
|
1320 |
+#if 0 |
1321 |
static void do_workUK(void) |
1322 |
{ |
1323 |
ServerScope = PR_LOCAL_THREAD; |
1324 |
@@ -522,6 +523,7 @@ static void do_workKK(void) |
1325 |
ClientScope = PR_GLOBAL_THREAD; |
1326 |
do_work(); |
1327 |
} |
1328 |
+#endif |
1329 |
|
1330 |
|
1331 |
static void Measure(void (*func)(void), const char *msg) |
1332 |
--- ../pr/tests/servr_kk.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1333 |
+++ ../pr/tests/servr_kk.c 2015-11-04 02:02:20.450733000 +0000 |
1334 |
@@ -57,7 +57,7 @@ PRCondVar *ServerStateCV; |
1335 |
#ifdef DEBUGPRINTS |
775 |
#define DPRINTF printf |
1336 |
#define DPRINTF printf |
776 |
#else |
1337 |
#else |
777 |
-#define DPRINTF |
1338 |
-#define DPRINTF |
778 |
+#define DPRINTF(...) |
1339 |
+#define DPRINTF(...) |
779 |
#endif |
1340 |
#endif |
780 |
|
1341 |
|
781 |
@@ -501,4 +501,5 @@ |
1342 |
PRIntn failed_already=0; |
|
|
1343 |
@@ -472,6 +472,7 @@ void do_work() |
1344 |
PR_JoinThread(ServerThread); |
782 |
} |
1345 |
} |
783 |
|
1346 |
|
784 |
+#if 0 |
1347 |
+#if 0 |
785 |
static void do_workUU(void) |
1348 |
static void do_workUU(void) |
786 |
{ |
1349 |
{ |
787 |
@@ -521,4 +522,5 @@ |
1350 |
ServerScope = PR_LOCAL_THREAD; |
|
|
1351 |
@@ -492,6 +493,7 @@ static void do_workKU(void) |
1352 |
ClientScope = PR_LOCAL_THREAD; |
788 |
do_work(); |
1353 |
do_work(); |
789 |
} |
1354 |
} |
790 |
+#endif |
1355 |
+#endif |
791 |
|
1356 |
|
792 |
static void do_workKK(void) |
1357 |
static void do_workKK(void) |
793 |
--- ../pr/tests/short_thread.c Sun Apr 25 11:01:02 2004 |
1358 |
{ |
794 |
+++ ../pr/tests/short_thread.c Mon Jul 25 21:44:20 2005 |
1359 |
--- ../pr/tests/servr_ku.c.orig 2015-10-16 13:22:19.000000000 +0000 |
795 |
@@ -76,6 +76,6 @@ |
1360 |
+++ ../pr/tests/servr_ku.c 2015-11-04 02:02:20.465050000 +0000 |
|
|
1361 |
@@ -57,7 +57,7 @@ PRCondVar *ServerStateCV; |
1362 |
#ifdef DEBUGPRINTS |
1363 |
#define DPRINTF printf |
1364 |
#else |
1365 |
-#define DPRINTF |
1366 |
+#define DPRINTF(...) |
1367 |
#endif |
1368 |
|
1369 |
PRIntn failed_already=0; |
1370 |
--- ../pr/tests/servr_uk.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1371 |
+++ ../pr/tests/servr_uk.c 2015-11-04 02:02:20.465699000 +0000 |
1372 |
@@ -57,7 +57,7 @@ PRCondVar *ServerStateCV; |
1373 |
#ifdef DEBUGPRINTS |
1374 |
#define DPRINTF printf |
1375 |
#else |
1376 |
-#define DPRINTF |
1377 |
+#define DPRINTF(...) |
1378 |
#endif |
1379 |
|
1380 |
PRIntn failed_already=0; |
1381 |
--- ../pr/tests/servr_uu.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1382 |
+++ ../pr/tests/servr_uu.c 2015-11-04 02:02:20.466349000 +0000 |
1383 |
@@ -57,7 +57,7 @@ PRCondVar *ServerStateCV; |
1384 |
#ifdef DEBUGPRINTS |
1385 |
#define DPRINTF printf |
1386 |
#else |
1387 |
-#define DPRINTF |
1388 |
+#define DPRINTF(...) |
1389 |
#endif |
1390 |
|
1391 |
PRIntn failed_already=0; |
1392 |
--- ../pr/tests/short_thread.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1393 |
+++ ../pr/tests/short_thread.c 2015-11-04 02:02:20.451202000 +0000 |
1394 |
@@ -43,8 +43,8 @@ int main (int argc, char **argv) |
1395 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0)) |
796 |
== NULL ) { |
1396 |
== NULL ) { |
797 |
fprintf(stderr, |
1397 |
fprintf(stderr, |
798 |
- "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n", |
1398 |
- "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n", |
Lines 801-991
Link Here
|
801 |
+ PR_GetError(), PR_GetOSError()); |
1401 |
+ PR_GetError(), PR_GetOSError()); |
802 |
exit( 1 ); |
1402 |
exit( 1 ); |
803 |
} |
1403 |
} |
804 |
--- ../pr/tests/cvar2.c Sun Apr 25 11:01:02 2004 |
1404 |
PR_Cleanup(); |
805 |
+++ ../pr/tests/cvar2.c Mon Jul 25 20:37:10 2005 |
1405 |
--- ../pr/tests/socket.c.orig 2015-10-16 13:22:19.000000000 +0000 |
806 |
@@ -128,5 +128,5 @@ |
1406 |
+++ ../pr/tests/socket.c 2015-11-04 02:02:20.454777000 +0000 |
807 |
PR_Lock(info->lock); |
1407 |
@@ -103,13 +103,15 @@ char *LARGE_FILE_NAME = "/tmp/prsocket_t |
808 |
if (*info->tcount == 0) { |
1408 |
#endif |
809 |
- DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n", |
|
|
810 |
+ DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n", |
811 |
PR_GetCurrentThread(), info->cvar)); |
812 |
PR_WaitCondVar(info->cvar, info->timeout); |
813 |
@@ -141,6 +141,6 @@ |
814 |
(*info->exitcount)++; |
815 |
PR_NotifyCondVar(info->exitcvar); |
816 |
-DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n", |
817 |
- PR_GetCurrentThread(), info->exitcvar,(*info->exitcount))); |
818 |
+DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n", |
819 |
+ PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount))); |
820 |
PR_Unlock(info->exitlock); |
821 |
} |
822 |
@@ -190,5 +190,5 @@ |
823 |
CondVarTestSUU(void *_arg) |
824 |
{ |
825 |
- PRInt32 arg = (PRInt32)_arg; |
826 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
827 |
PRInt32 index, loops; |
828 |
threadinfo *list; |
829 |
@@ -222,5 +222,5 @@ |
830 |
PR_LOCAL_THREAD); |
831 |
index++; |
832 |
- DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread)); |
833 |
+ DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread)); |
834 |
} |
835 |
|
836 |
@@ -232,5 +232,5 @@ |
837 |
PR_NotifyCondVar(list[index].cvar); |
838 |
PR_Unlock(list[index].lock); |
839 |
- DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n", |
840 |
+ DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n", |
841 |
PR_GetCurrentThread(), list[index].cvar)); |
842 |
} |
843 |
@@ -260,5 +260,5 @@ |
844 |
CondVarTestSUK(void *_arg) |
845 |
{ |
846 |
- PRInt32 arg = (PRInt32)_arg; |
847 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
848 |
PRInt32 index, loops; |
849 |
threadinfo *list; |
850 |
@@ -334,5 +334,5 @@ |
851 |
CondVarTestPUU(void *_arg) |
852 |
{ |
853 |
- PRInt32 arg = (PRInt32)_arg; |
854 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
855 |
PRInt32 index, loops; |
856 |
threadinfo *list; |
857 |
@@ -369,5 +369,5 @@ |
858 |
PR_LOCAL_THREAD); |
859 |
|
860 |
- DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread)); |
861 |
+ DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread)); |
862 |
index++; |
863 |
tcount++; |
864 |
@@ -387,6 +387,6 @@ |
865 |
/* Wait for threads to finish */ |
866 |
while(exitcount < arg) { |
867 |
-DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n", |
868 |
- PR_GetCurrentThread(), exitcvar, exitcount)); |
869 |
+DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n", |
870 |
+ PR_GetCurrentThread(), exitcvar, (int)exitcount)); |
871 |
PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60)); |
872 |
} |
873 |
@@ -398,5 +398,5 @@ |
874 |
/* Join all the threads */ |
875 |
for(index=0; index<(arg); index++) { |
876 |
- DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread)); |
877 |
+ DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread)); |
878 |
PR_JoinThread(list[index].thread); |
879 |
if (list[index].internal) { |
880 |
@@ -420,5 +420,5 @@ |
881 |
CondVarTestPUK(void *_arg) |
882 |
{ |
883 |
- PRInt32 arg = (PRInt32)_arg; |
884 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
885 |
PRInt32 index, loops; |
886 |
threadinfo *list; |
887 |
@@ -501,5 +501,5 @@ |
888 |
CondVarTest(void *_arg) |
889 |
{ |
890 |
- PRInt32 arg = (PRInt32)_arg; |
891 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
892 |
PRInt32 index, loops; |
893 |
threadinfo *list; |
894 |
@@ -634,5 +634,5 @@ |
895 |
CondVarTimeoutTest(void *_arg) |
896 |
{ |
897 |
- PRInt32 arg = (PRInt32)_arg; |
898 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
899 |
PRInt32 index, loops; |
900 |
threadinfo *list; |
901 |
@@ -745,5 +745,5 @@ |
902 |
CondVarMixedTest(void *_arg) |
903 |
{ |
904 |
- PRInt32 arg = (PRInt32)_arg; |
905 |
+ PRInt32 arg = (PRInt32)(intptr_t)_arg; |
906 |
PRInt32 index, loops; |
907 |
threadinfo *list; |
908 |
@@ -835,5 +835,5 @@ |
909 |
|
910 |
PR_Lock(list[index].lock); |
911 |
- *list[index].tcount++; |
912 |
+ list[index].tcount++; |
913 |
PR_NotifyCondVar(list[index].cvar); |
914 |
PR_Unlock(list[index].lock); |
915 |
@@ -906,5 +906,5 @@ |
916 |
|
917 |
start = PR_IntervalNow(); |
918 |
- (*func)((void *)arg); |
919 |
+ (*func)((void *)(intptr_t)arg); |
920 |
stop = PR_IntervalNow(); |
921 |
|
922 |
@@ -965,5 +965,5 @@ |
923 |
|
924 |
for (threads = default_threads; threads < default_threads*5; threads+=default_threads) { |
925 |
- printf("\n%ld Thread tests\n", threads); |
926 |
+ printf("\n%d Thread tests\n", (int)threads); |
927 |
Measure(CondVarTestSUU, threads, "Condvar simple test shared UU"); |
928 |
Measure(CondVarTestSUK, threads, "Condvar simple test shared UK"); |
929 |
--- ../pr/tests/io_timeout.c Sun Apr 25 11:01:02 2004 |
930 |
+++ ../pr/tests/io_timeout.c Mon Jul 25 20:50:40 2005 |
931 |
@@ -55,9 +55,11 @@ |
932 |
#include "plgetopt.h" |
933 |
|
934 |
+#include <errno.h> |
935 |
#include <stdio.h> |
936 |
+#include <string.h> |
937 |
#include "nspr.h" |
938 |
|
939 |
#define NUM_THREADS 1 |
940 |
-#define BASE_PORT 8000 |
941 |
+#define BASE_PORT 38011 |
942 |
#define DEFAULT_ACCEPT_TIMEOUT 2 |
943 |
|
944 |
@@ -71,5 +73,5 @@ |
945 |
|
946 |
PRIntn failed_already = 0; |
947 |
-PRIntn debug_mode = 0; |
948 |
+PRIntn debug_mode = 1; |
949 |
|
950 |
#define LOCAL_SCOPE_STRING "LOCAL scope" |
951 |
@@ -87,5 +89,5 @@ |
952 |
PRStatus rv; |
953 |
PRThreadScope tscope; |
954 |
- char *scope_str; |
955 |
+ const char *scope_str; |
956 |
|
957 |
|
958 |
@@ -106,4 +108,5 @@ |
959 |
default: |
960 |
PR_ASSERT(!"Invalid thread scope"); |
961 |
+ scope_str = NULL; |
962 |
break; |
963 |
} |
964 |
@@ -124,5 +127,10 @@ |
965 |
if (rv == PR_FAILURE) { |
966 |
if (debug_mode) |
967 |
- printf("unable to bind\n"); |
968 |
+ printf("unable to bind to %d: %s\n", |
969 |
+ BASE_PORT + info->id, strerror(PR_GetOSError())); |
970 |
+ if (PR_GetOSError() == EADDRINUSE) { |
971 |
+ printf("can not proceed with this test\n"); |
972 |
+ exit(0); |
973 |
+ } |
974 |
failed_already=1; |
975 |
goto dead; |
976 |
@@ -146,6 +154,7 @@ |
977 |
if (PR_GetError() == PR_IO_TIMEOUT_ERROR) { |
978 |
if (debug_mode) { |
979 |
- printf("PR_Accept() timeout worked!\n"); |
980 |
- printf("TEST PASSED! PR_Accept() returned error %d\n", |
981 |
+ printf("PR_Accept() timeout worked!\n" |
982 |
+ "TEST PASSED! PR_Accept() returned error " |
983 |
+ "PR_IO_TIMEOUT_ERROR (%ld)\n", |
984 |
PR_IO_TIMEOUT_ERROR); |
985 |
} |
986 |
--- ../pr/tests/socket.c 2009-05-06 01:40:39.000000000 -0400 |
987 |
+++ ../pr/tests/socket.c 2009-11-04 16:45:41.000000000 -0500 |
988 |
@@ -132,11 +132,13 @@ |
989 |
|
1409 |
|
990 |
static PRInt32 num_tcp_clients = NUM_TCP_CLIENTS; |
1410 |
static PRInt32 num_tcp_clients = NUM_TCP_CLIENTS; |
991 |
-static PRInt32 num_udp_clients = NUM_UDP_CLIENTS; |
1411 |
-static PRInt32 num_udp_clients = NUM_UDP_CLIENTS; |
Lines 1000-1006
Link Here
|
1000 |
+#endif |
1420 |
+#endif |
1001 |
|
1421 |
|
1002 |
static PRInt32 thread_count; |
1422 |
static PRInt32 thread_count; |
1003 |
@@ -210,5 +212,7 @@ |
1423 |
PRUint16 server_domain = PR_AF_INET, client_domain = PR_AF_INET; |
|
|
1424 |
@@ -181,19 +183,23 @@ readn(PRFileDesc *sockfd, char *buf, int |
1425 |
int rem; |
1004 |
int bytes; |
1426 |
int bytes; |
1005 |
int offset = 0; |
1427 |
int offset = 0; |
1006 |
+#ifdef WINNT |
1428 |
+#ifdef WINNT |
Lines 1008-1014
Link Here
|
1008 |
+#endif |
1430 |
+#endif |
1009 |
PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT; |
1431 |
PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT; |
1010 |
|
1432 |
|
1011 |
@@ -217,10 +221,12 @@ |
1433 |
if (test_cancelio) |
|
|
1434 |
timeout = PR_SecondsToInterval(2); |
1012 |
|
1435 |
|
1013 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1436 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1014 |
- DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n", |
1437 |
- DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n", |
Lines 1023-1029
Link Here
|
1023 |
+ DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n", |
1446 |
+ DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n", |
1024 |
PR_GetCurrentThread(), bytes)); |
1447 |
PR_GetCurrentThread(), bytes)); |
1025 |
if (bytes < 0) { |
1448 |
if (bytes < 0) { |
1026 |
@@ -253,9 +259,9 @@ |
1449 |
#ifdef WINNT |
|
|
1450 |
@@ -224,11 +230,11 @@ writen(PRFileDesc *sockfd, char *buf, in |
1451 |
int offset = 0; |
1027 |
|
1452 |
|
1028 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1453 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1029 |
- DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n", |
1454 |
- DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n", |
Lines 1035-1069
Link Here
|
1035 |
+ DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n", |
1460 |
+ DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n", |
1036 |
PR_GetCurrentThread(), bytes)); |
1461 |
PR_GetCurrentThread(), bytes)); |
1037 |
if (bytes <= 0) |
1462 |
if (bytes <= 0) |
1038 |
@@ -308,5 +314,5 @@ |
1463 |
return -1; |
|
|
1464 |
@@ -279,7 +285,7 @@ Serve_Client(void *arg) |
1465 |
fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n"); |
1039 |
} |
1466 |
} |
1040 |
#endif |
1467 |
#endif |
1041 |
- DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(), |
1468 |
- DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(), |
1042 |
+ DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(), |
1469 |
+ DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(), |
1043 |
(*((int *) in_buf->data)))); |
1470 |
(*((int *) in_buf->data)))); |
1044 |
if (writen(sockfd, in_buf->data, bytes) < bytes) { |
1471 |
if (writen(sockfd, in_buf->data, bytes) < bytes) { |
1045 |
@@ -447,5 +453,5 @@ |
1472 |
fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n"); |
|
|
1473 |
@@ -418,7 +424,7 @@ TCP_Server(void *arg) |
1474 |
goto exit; |
1046 |
} |
1475 |
} |
1047 |
|
1476 |
|
1048 |
- DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1477 |
- DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1049 |
+ DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1478 |
+ DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1050 |
netaddr.inet.ip, netaddr.inet.port)); |
1479 |
netaddr.inet.ip, netaddr.inet.port)); |
1051 |
if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain, |
1480 |
if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain, |
1052 |
@@ -489,5 +495,5 @@ |
1481 |
PR_ntohs(PR_NetAddrInetPort(&netaddr)), |
|
|
1482 |
@@ -460,7 +466,7 @@ TCP_Server(void *arg) |
1483 |
scp->datalen = sp->datalen; |
1053 |
|
1484 |
|
1054 |
t = create_new_thread(PR_USER_THREAD, |
1485 |
t = create_new_thread(PR_USER_THREAD, |
1055 |
- Serve_Client, (void *)scp, |
1486 |
- Serve_Client, (void *)scp, |
1056 |
+ Serve_Client, (void *)scp, |
1487 |
+ Serve_Client, (void *)scp, |
1057 |
PR_PRIORITY_NORMAL, |
1488 |
PR_PRIORITY_NORMAL, |
1058 |
PR_LOCAL_THREAD, |
1489 |
PR_LOCAL_THREAD, |
1059 |
@@ -499,5 +505,5 @@ |
1490 |
PR_UNJOINABLE_THREAD, |
|
|
1491 |
@@ -470,7 +476,7 @@ TCP_Server(void *arg) |
1492 |
failed_already=1; |
1060 |
goto exit; |
1493 |
goto exit; |
1061 |
} |
1494 |
} |
1062 |
- DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t)); |
1495 |
- DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t)); |
1063 |
+ DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t)); |
1496 |
+ DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t)); |
1064 |
} |
1497 |
} |
1065 |
|
1498 |
|
1066 |
@@ -515,7 +521,8 @@ |
1499 |
exit: |
|
|
1500 |
@@ -486,9 +492,10 @@ exit: |
1501 |
--(*sp->exit_counter); |
1067 |
PR_Notify(sp->exit_mon); |
1502 |
PR_Notify(sp->exit_mon); |
1068 |
PR_ExitMonitor(sp->exit_mon); |
1503 |
PR_ExitMonitor(sp->exit_mon); |
1069 |
- DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread())); |
1504 |
- DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread())); |
Lines 1073-1100
Link Here
|
1073 |
+#if defined(SYMBIAN) && !defined(__WINSCW__) |
1508 |
+#if defined(SYMBIAN) && !defined(__WINSCW__) |
1074 |
/* |
1509 |
/* |
1075 |
* UDP Server |
1510 |
* UDP Server |
1076 |
@@ -573,5 +580,5 @@ |
1511 |
* Server Thread |
|
|
1512 |
@@ -544,7 +551,7 @@ UDP_Server(void *arg) |
1513 |
return; |
1077 |
} |
1514 |
} |
1078 |
|
1515 |
|
1079 |
- DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1516 |
- DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1080 |
+ DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1517 |
+ DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1081 |
netaddr.inet.ip, netaddr.inet.port)); |
1518 |
netaddr.inet.ip, netaddr.inet.port)); |
1082 |
/* |
1519 |
/* |
1083 |
@@ -611,5 +618,5 @@ |
1520 |
* We can't use the IP address returned by PR_GetSockName in |
|
|
1521 |
@@ -582,13 +589,13 @@ UDP_Server(void *arg) |
1522 |
*/ |
1084 |
memset(&netaddr, 0 , sizeof(netaddr)); |
1523 |
memset(&netaddr, 0 , sizeof(netaddr)); |
1085 |
for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) { |
1524 |
for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) { |
1086 |
- DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n", |
1525 |
- DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n", |
1087 |
+ DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n", |
1526 |
+ DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n", |
1088 |
netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data, |
1527 |
netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data, |
1089 |
in_buf->data[0])); |
1528 |
in_buf->data[0])); |
1090 |
@@ -617,5 +624,5 @@ |
1529 |
|
1091 |
rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr, |
1530 |
rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr, |
1092 |
PR_INTERVAL_NO_TIMEOUT); |
1531 |
PR_INTERVAL_NO_TIMEOUT); |
1093 |
- DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n", |
1532 |
- DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n", |
1094 |
+ DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n", |
1533 |
+ DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n", |
1095 |
netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data, |
1534 |
netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data, |
1096 |
in_buf->data[0])); |
1535 |
in_buf->data[0])); |
1097 |
@@ -640,6 +647,7 @@ |
1536 |
if (rv != bytes) { |
|
|
1537 |
@@ -611,8 +618,9 @@ UDP_Server(void *arg) |
1538 |
--(*sp->exit_counter); |
1098 |
PR_Notify(sp->exit_mon); |
1539 |
PR_Notify(sp->exit_mon); |
1099 |
PR_ExitMonitor(sp->exit_mon); |
1540 |
PR_ExitMonitor(sp->exit_mon); |
1100 |
- DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread())); |
1541 |
- DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread())); |
Lines 1103-1130
Link Here
|
1103 |
+#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */ |
1544 |
+#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */ |
1104 |
|
1545 |
|
1105 |
/* |
1546 |
/* |
1106 |
@@ -684,5 +692,5 @@ |
1547 |
* TCP_Client |
|
|
1548 |
@@ -655,7 +663,7 @@ TCP_Client(void *arg) |
1549 |
} |
1107 |
if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){ |
1550 |
if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){ |
1108 |
fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n", |
1551 |
fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n", |
1109 |
- PR_GetError(), PR_GetOSError()); |
1552 |
- PR_GetError(), PR_GetOSError()); |
1110 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1553 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1111 |
failed_already=1; |
1554 |
failed_already=1; |
1112 |
return; |
1555 |
return; |
1113 |
@@ -692,5 +700,5 @@ |
1556 |
} |
|
|
1557 |
@@ -663,7 +671,7 @@ TCP_Client(void *arg) |
1558 |
/* |
1114 |
* fill in random data |
1559 |
* fill in random data |
1115 |
*/ |
1560 |
*/ |
1116 |
- memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes); |
1561 |
- memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes); |
1117 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes); |
1562 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes); |
1118 |
/* |
1563 |
/* |
1119 |
* write to server |
1564 |
* write to server |
1120 |
@@ -705,5 +713,5 @@ |
1565 |
*/ |
|
|
1566 |
@@ -676,7 +684,7 @@ TCP_Client(void *arg) |
1567 |
failed_already=1; |
1121 |
return; |
1568 |
return; |
1122 |
} |
1569 |
} |
1123 |
- DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n", |
1570 |
- DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n", |
1124 |
+ DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n", |
1571 |
+ DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n", |
1125 |
PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data)))); |
1572 |
PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data)))); |
1126 |
if (readn(sockfd, in_buf->data, bytes) < bytes) { |
1573 |
if (readn(sockfd, in_buf->data, bytes) < bytes) { |
1127 |
@@ -745,11 +753,12 @@ |
1574 |
fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n"); |
|
|
1575 |
@@ -716,13 +724,14 @@ TCP_Client(void *arg) |
1576 |
--(*cp->exit_counter); |
1128 |
PR_Notify(cp->exit_mon); |
1577 |
PR_Notify(cp->exit_mon); |
1129 |
PR_ExitMonitor(cp->exit_mon); |
1578 |
PR_ExitMonitor(cp->exit_mon); |
1130 |
- DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread())); |
1579 |
- DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread())); |
Lines 1139-1152
Link Here
|
1139 |
+ * Create a socket and bind an address |
1588 |
+ * Create a socket and bind an address |
1140 |
* Communicate with the server at the address specified in the argument. |
1589 |
* Communicate with the server at the address specified in the argument. |
1141 |
* Fill in a buffer, write data to server, read it back and check |
1590 |
* Fill in a buffer, write data to server, read it back and check |
1142 |
@@ -809,5 +818,5 @@ |
1591 |
* for data corruption. |
|
|
1592 |
@@ -780,7 +789,7 @@ UDP_Client(void *arg) |
1593 |
return; |
1143 |
} |
1594 |
} |
1144 |
|
1595 |
|
1145 |
- DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1596 |
- DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1146 |
+ DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1597 |
+ DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1147 |
netaddr.inet.ip, netaddr.inet.port)); |
1598 |
netaddr.inet.ip, netaddr.inet.port)); |
1148 |
|
1599 |
|
1149 |
@@ -826,7 +835,7 @@ |
1600 |
netaddr = cp->server_addr; |
|
|
1601 |
@@ -797,9 +806,9 @@ UDP_Client(void *arg) |
1602 |
/* |
1150 |
* fill in random data |
1603 |
* fill in random data |
1151 |
*/ |
1604 |
*/ |
1152 |
- DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n", |
1605 |
- DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n", |
Lines 1156-1176
Link Here
|
1156 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes); |
1609 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes); |
1157 |
/* |
1610 |
/* |
1158 |
* write to server |
1611 |
* write to server |
1159 |
@@ -841,5 +850,5 @@ |
1612 |
*/ |
|
|
1613 |
@@ -812,7 +821,7 @@ UDP_Client(void *arg) |
1614 |
if (rv != bytes) { |
1160 |
return; |
1615 |
return; |
1161 |
} |
1616 |
} |
1162 |
- DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n", |
1617 |
- DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n", |
1163 |
+ DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n", |
1618 |
+ DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n", |
1164 |
PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data)))); |
1619 |
PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data)))); |
1165 |
if (cp->udp_connect) |
1620 |
if (cp->udp_connect) |
1166 |
@@ -852,5 +861,5 @@ |
1621 |
rv = PR_Recv(sockfd, in_buf->data, bytes, 0, |
|
|
1622 |
@@ -823,7 +832,7 @@ UDP_Client(void *arg) |
1623 |
if (rv != bytes) { |
1167 |
return; |
1624 |
return; |
1168 |
} |
1625 |
} |
1169 |
- DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n", |
1626 |
- DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n", |
1170 |
+ DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n", |
1627 |
+ DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n", |
1171 |
PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data)))); |
1628 |
PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data)))); |
1172 |
/* |
1629 |
/* |
1173 |
@@ -877,10 +886,11 @@ |
1630 |
* verify the data read |
|
|
1631 |
@@ -848,12 +857,13 @@ UDP_Client(void *arg) |
1632 |
PR_Notify(cp->exit_mon); |
1174 |
PR_ExitMonitor(cp->exit_mon); |
1633 |
PR_ExitMonitor(cp->exit_mon); |
1175 |
PR_DELETE(cp); |
1634 |
PR_DELETE(cp); |
1176 |
- DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread())); |
1635 |
- DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread())); |
Lines 1184-1211
Link Here
|
1184 |
+ * |
1643 |
+ * |
1185 |
* One server and several clients are started |
1644 |
* One server and several clients are started |
1186 |
* Each client connects to the server and sends a chunk of data |
1645 |
* Each client connects to the server and sends a chunk of data |
1187 |
@@ -934,5 +944,5 @@ |
1646 |
* For each connection, server starts another thread to read the data |
|
|
1647 |
@@ -905,7 +915,7 @@ TCP_Socket_Client_Server_Test(void) |
1648 |
sparamp->exit_counter = &thread_count; |
1188 |
sparamp->datalen = datalen; |
1649 |
sparamp->datalen = datalen; |
1189 |
t = PR_CreateThread(PR_USER_THREAD, |
1650 |
t = PR_CreateThread(PR_USER_THREAD, |
1190 |
- TCP_Server, (void *)sparamp, |
1651 |
- TCP_Server, (void *)sparamp, |
1191 |
+ TCP_Server, (void *)sparamp, |
1652 |
+ TCP_Server, (void *)sparamp, |
1192 |
PR_PRIORITY_NORMAL, |
1653 |
PR_PRIORITY_NORMAL, |
1193 |
PR_LOCAL_THREAD, |
1654 |
PR_LOCAL_THREAD, |
1194 |
@@ -944,5 +954,5 @@ |
1655 |
PR_UNJOINABLE_THREAD, |
|
|
1656 |
@@ -915,7 +925,7 @@ TCP_Socket_Client_Server_Test(void) |
1657 |
failed_already=1; |
1195 |
return -1; |
1658 |
return -1; |
1196 |
} |
1659 |
} |
1197 |
- DPRINTF(("Created TCP server = 0x%lx\n", t)); |
1660 |
- DPRINTF(("Created TCP server = 0x%lx\n", t)); |
1198 |
+ DPRINTF(("Created TCP server = %p\n", t)); |
1661 |
+ DPRINTF(("Created TCP server = %p\n", t)); |
1199 |
thread_count++; |
1662 |
thread_count++; |
1200 |
|
1663 |
|
1201 |
@@ -978,5 +988,5 @@ |
1664 |
/* |
|
|
1665 |
@@ -949,7 +959,7 @@ TCP_Socket_Client_Server_Test(void) |
1666 |
failed_already=1; |
1202 |
return -1; |
1667 |
return -1; |
1203 |
} |
1668 |
} |
1204 |
- DPRINTF(("Created TCP client = 0x%lx\n", t)); |
1669 |
- DPRINTF(("Created TCP client = 0x%lx\n", t)); |
1205 |
+ DPRINTF(("Created TCP client = %p\n", t)); |
1670 |
+ DPRINTF(("Created TCP client = %p\n", t)); |
1206 |
thread_count++; |
1671 |
thread_count++; |
1207 |
} |
1672 |
} |
1208 |
@@ -988,7 +998,7 @@ |
1673 |
/* Wait for server and client threads to exit */ |
|
|
1674 |
@@ -959,17 +969,18 @@ TCP_Socket_Client_Server_Test(void) |
1675 |
} |
1209 |
PR_ExitMonitor(mon2); |
1676 |
PR_ExitMonitor(mon2); |
1210 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
1677 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
1211 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
1678 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
Lines 1215-1221
Link Here
|
1215 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
1682 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
1216 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
1683 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
1217 |
|
1684 |
|
1218 |
@@ -996,7 +1006,8 @@ |
1685 |
return 0; |
1219 |
} |
1686 |
} |
1220 |
|
1687 |
|
1221 |
+#if defined(SYMBIAN) && !defined(__WINSCW__) |
1688 |
+#if defined(SYMBIAN) && !defined(__WINSCW__) |
Lines 1225-1238
Link Here
|
1225 |
+ * |
1692 |
+ * |
1226 |
* One server and several clients are started |
1693 |
* One server and several clients are started |
1227 |
* Each client connects to the server and sends a chunk of data |
1694 |
* Each client connects to the server and sends a chunk of data |
1228 |
@@ -1052,5 +1063,5 @@ |
1695 |
* For each connection, server starts another thread to read the data |
|
|
1696 |
@@ -1023,7 +1034,7 @@ UDP_Socket_Client_Server_Test(void) |
1697 |
sparamp->datalen = datalen; |
1229 |
DPRINTF(("Creating UDP server")); |
1698 |
DPRINTF(("Creating UDP server")); |
1230 |
t = PR_CreateThread(PR_USER_THREAD, |
1699 |
t = PR_CreateThread(PR_USER_THREAD, |
1231 |
- UDP_Server, (void *)sparamp, |
1700 |
- UDP_Server, (void *)sparamp, |
1232 |
+ UDP_Server, (void *)sparamp, |
1701 |
+ UDP_Server, (void *)sparamp, |
1233 |
PR_PRIORITY_NORMAL, |
1702 |
PR_PRIORITY_NORMAL, |
1234 |
PR_LOCAL_THREAD, |
1703 |
PR_LOCAL_THREAD, |
1235 |
@@ -1113,10 +1124,11 @@ |
1704 |
PR_UNJOINABLE_THREAD, |
|
|
1705 |
@@ -1084,12 +1095,13 @@ UDP_Socket_Client_Server_Test(void) |
1706 |
} |
1236 |
PR_ExitMonitor(mon2); |
1707 |
PR_ExitMonitor(mon2); |
1237 |
printf("%30s","UDP_Socket_Client_Server_Test: "); |
1708 |
printf("%30s","UDP_Socket_Client_Server_Test: "); |
1238 |
- printf("%2ld Server %2ld Clients\n",1l, num_udp_clients); |
1709 |
- printf("%2ld Server %2ld Clients\n",1l, num_udp_clients); |
Lines 1246-1350
Link Here
|
1246 |
+#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */ |
1717 |
+#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */ |
1247 |
|
1718 |
|
1248 |
static PRFileDesc *small_file_fd, *large_file_fd; |
1719 |
static PRFileDesc *small_file_fd, *large_file_fd; |
1249 |
@@ -1470,5 +1482,5 @@ |
1720 |
static void *small_file_addr, *small_file_header, *large_file_addr; |
|
|
1721 |
@@ -1441,7 +1453,7 @@ TransmitFile_Client(void *arg) |
1722 |
--(*cp->exit_counter); |
1250 |
PR_Notify(cp->exit_mon); |
1723 |
PR_Notify(cp->exit_mon); |
1251 |
PR_ExitMonitor(cp->exit_mon); |
1724 |
PR_ExitMonitor(cp->exit_mon); |
1252 |
- DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread())); |
1725 |
- DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread())); |
1253 |
+ DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread())); |
1726 |
+ DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread())); |
1254 |
} |
1727 |
} |
1255 |
|
1728 |
|
1256 |
@@ -1513,5 +1525,5 @@ |
1729 |
/* |
|
|
1730 |
@@ -1484,7 +1496,7 @@ Serve_TransmitFile_Client(void *arg) |
1731 |
if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) { |
1257 |
fprintf(stderr, |
1732 |
fprintf(stderr, |
1258 |
"prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n", |
1733 |
"prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n", |
1259 |
- PR_GetError(), PR_GetOSError()); |
1734 |
- PR_GetError(), PR_GetOSError()); |
1260 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1735 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1261 |
failed_already=1; |
1736 |
failed_already=1; |
1262 |
} |
1737 |
} |
1263 |
@@ -1521,5 +1533,5 @@ |
1738 |
bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0, |
|
|
1739 |
@@ -1492,7 +1504,7 @@ Serve_TransmitFile_Client(void *arg) |
1740 |
if (bytes != LARGE_FILE_SIZE) { |
1264 |
fprintf(stderr, |
1741 |
fprintf(stderr, |
1265 |
"prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n", |
1742 |
"prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n", |
1266 |
- PR_GetError(), PR_GetOSError()); |
1743 |
- PR_GetError(), PR_GetOSError()); |
1267 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1744 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1268 |
failed_already=1; |
1745 |
failed_already=1; |
1269 |
} |
1746 |
} |
1270 |
@@ -1549,5 +1561,5 @@ |
1747 |
|
|
|
1748 |
@@ -1520,7 +1532,7 @@ Serve_TransmitFile_Client(void *arg) |
1749 |
slen, bytes); |
1271 |
fprintf(stderr, |
1750 |
fprintf(stderr, |
1272 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1751 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1273 |
- PR_GetError(), PR_GetOSError()); |
1752 |
- PR_GetError(), PR_GetOSError()); |
1274 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1753 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1275 |
failed_already=1; |
1754 |
failed_already=1; |
1276 |
} |
1755 |
} |
1277 |
@@ -1573,5 +1585,5 @@ |
1756 |
|
|
|
1757 |
@@ -1544,7 +1556,7 @@ Serve_TransmitFile_Client(void *arg) |
1758 |
slen, bytes); |
1278 |
fprintf(stderr, |
1759 |
fprintf(stderr, |
1279 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1760 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1280 |
- PR_GetError(), PR_GetOSError()); |
1761 |
- PR_GetError(), PR_GetOSError()); |
1281 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1762 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1282 |
failed_already=1; |
1763 |
failed_already=1; |
1283 |
} |
1764 |
} |
1284 |
@@ -1595,5 +1607,5 @@ |
1765 |
/* |
|
|
1766 |
@@ -1566,7 +1578,7 @@ Serve_TransmitFile_Client(void *arg) |
1767 |
slen, bytes); |
1285 |
fprintf(stderr, |
1768 |
fprintf(stderr, |
1286 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1769 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1287 |
- PR_GetError(), PR_GetOSError()); |
1770 |
- PR_GetError(), PR_GetOSError()); |
1288 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1771 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1289 |
failed_already=1; |
1772 |
failed_already=1; |
1290 |
} |
1773 |
} |
1291 |
@@ -1617,5 +1629,5 @@ |
1774 |
/* |
|
|
1775 |
@@ -1588,7 +1600,7 @@ Serve_TransmitFile_Client(void *arg) |
1776 |
slen, bytes); |
1292 |
fprintf(stderr, |
1777 |
fprintf(stderr, |
1293 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1778 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1294 |
- PR_GetError(), PR_GetOSError()); |
1779 |
- PR_GetError(), PR_GetOSError()); |
1295 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1780 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1296 |
failed_already=1; |
1781 |
failed_already=1; |
1297 |
} |
1782 |
} |
1298 |
@@ -1639,5 +1651,5 @@ |
1783 |
/* |
|
|
1784 |
@@ -1610,7 +1622,7 @@ Serve_TransmitFile_Client(void *arg) |
1785 |
slen, bytes); |
1299 |
fprintf(stderr, |
1786 |
fprintf(stderr, |
1300 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1787 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1301 |
- PR_GetError(), PR_GetOSError()); |
1788 |
- PR_GetError(), PR_GetOSError()); |
1302 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1789 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1303 |
failed_already=1; |
1790 |
failed_already=1; |
1304 |
} |
1791 |
} |
1305 |
@@ -1661,5 +1673,5 @@ |
1792 |
/* |
|
|
1793 |
@@ -1632,7 +1644,7 @@ Serve_TransmitFile_Client(void *arg) |
1794 |
slen, bytes); |
1306 |
fprintf(stderr, |
1795 |
fprintf(stderr, |
1307 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1796 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1308 |
- PR_GetError(), PR_GetOSError()); |
1797 |
- PR_GetError(), PR_GetOSError()); |
1309 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1798 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1310 |
failed_already=1; |
1799 |
failed_already=1; |
1311 |
} |
1800 |
} |
1312 |
@@ -1683,5 +1695,5 @@ |
1801 |
/* |
|
|
1802 |
@@ -1654,7 +1666,7 @@ Serve_TransmitFile_Client(void *arg) |
1803 |
slen, bytes); |
1313 |
fprintf(stderr, |
1804 |
fprintf(stderr, |
1314 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1805 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1315 |
- PR_GetError(), PR_GetOSError()); |
1806 |
- PR_GetError(), PR_GetOSError()); |
1316 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1807 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1317 |
failed_already=1; |
1808 |
failed_already=1; |
1318 |
} |
1809 |
} |
1319 |
@@ -1707,5 +1719,5 @@ |
1810 |
/* |
|
|
1811 |
@@ -1678,7 +1690,7 @@ Serve_TransmitFile_Client(void *arg) |
1812 |
slen, bytes); |
1320 |
fprintf(stderr, |
1813 |
fprintf(stderr, |
1321 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1814 |
"prsocket_test: PR_SendFile failed: (%ld, %ld)\n", |
1322 |
- PR_GetError(), PR_GetOSError()); |
1815 |
- PR_GetError(), PR_GetOSError()); |
1323 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1816 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1324 |
failed_already=1; |
1817 |
failed_already=1; |
1325 |
} |
1818 |
} |
1326 |
@@ -1781,5 +1793,5 @@ |
1819 |
done: |
|
|
1820 |
@@ -1752,7 +1764,7 @@ TransmitFile_Server(void *arg) |
1821 |
goto exit; |
1327 |
} |
1822 |
} |
1328 |
|
1823 |
|
1329 |
- DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1824 |
- DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1330 |
+ DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1825 |
+ DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1331 |
netaddr.inet.ip, netaddr.inet.port)); |
1826 |
netaddr.inet.ip, netaddr.inet.port)); |
1332 |
tcp_server_addr.inet.family = netaddr.inet.family; |
1827 |
tcp_server_addr.inet.family = netaddr.inet.family; |
1333 |
@@ -1836,5 +1848,5 @@ |
1828 |
tcp_server_addr.inet.port = netaddr.inet.port; |
|
|
1829 |
@@ -1807,7 +1819,7 @@ TransmitFile_Server(void *arg) |
1830 |
scp->datalen = sp->datalen; |
1334 |
|
1831 |
|
1335 |
t[i] = PR_CreateThread(PR_USER_THREAD, |
1832 |
t[i] = PR_CreateThread(PR_USER_THREAD, |
1336 |
- Serve_TransmitFile_Client, (void *)scp, |
1833 |
- Serve_TransmitFile_Client, (void *)scp, |
1337 |
+ Serve_TransmitFile_Client, (void *)scp, |
1834 |
+ Serve_TransmitFile_Client, (void *)scp, |
1338 |
PR_PRIORITY_NORMAL, |
1835 |
PR_PRIORITY_NORMAL, |
1339 |
PR_LOCAL_THREAD, |
1836 |
PR_LOCAL_THREAD, |
1340 |
@@ -1847,5 +1859,5 @@ |
1837 |
PR_JOINABLE_THREAD, |
|
|
1838 |
@@ -1818,7 +1830,7 @@ TransmitFile_Server(void *arg) |
1839 |
failed_already=1; |
1341 |
goto exit; |
1840 |
goto exit; |
1342 |
} |
1841 |
} |
1343 |
- DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t)); |
1842 |
- DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t)); |
1344 |
+ DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t)); |
1843 |
+ DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t)); |
1345 |
} |
1844 |
} |
1346 |
|
1845 |
|
1347 |
@@ -1875,10 +1887,10 @@ |
1846 |
/* |
|
|
1847 |
@@ -1846,12 +1858,12 @@ exit: |
1848 |
--(*sp->exit_counter); |
1348 |
PR_Notify(sp->exit_mon); |
1849 |
PR_Notify(sp->exit_mon); |
1349 |
PR_ExitMonitor(sp->exit_mon); |
1850 |
PR_ExitMonitor(sp->exit_mon); |
1350 |
- DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread())); |
1851 |
- DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread())); |
Lines 1358-1426
Link Here
|
1358 |
+ * |
1859 |
+ * |
1359 |
*/ |
1860 |
*/ |
1360 |
static PRInt32 |
1861 |
static PRInt32 |
1361 |
@@ -2015,5 +2027,5 @@ |
1862 |
Socket_Misc_Test(void) |
|
|
1863 |
@@ -1986,7 +1998,7 @@ Socket_Misc_Test(void) |
1864 |
fprintf(stderr, |
1362 |
"prsocket_test failed to write to file %s: (%ld, %ld)\n", |
1865 |
"prsocket_test failed to write to file %s: (%ld, %ld)\n", |
1363 |
LARGE_FILE_NAME, |
1866 |
LARGE_FILE_NAME, |
1364 |
- PR_GetError(), PR_GetOSError()); |
1867 |
- PR_GetError(), PR_GetOSError()); |
1365 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1868 |
+ (long)PR_GetError(), (long)PR_GetOSError()); |
1366 |
failed_already=1; |
1869 |
failed_already=1; |
1367 |
rv = -1; |
1870 |
rv = -1; |
1368 |
@@ -2094,5 +2106,5 @@ |
1871 |
goto done; |
|
|
1872 |
@@ -2065,7 +2077,7 @@ Socket_Misc_Test(void) |
1873 |
sparamp->exit_counter = &thread_count; |
1369 |
sparamp->datalen = datalen; |
1874 |
sparamp->datalen = datalen; |
1370 |
t = PR_CreateThread(PR_USER_THREAD, |
1875 |
t = PR_CreateThread(PR_USER_THREAD, |
1371 |
- TransmitFile_Server, (void *)sparamp, |
1876 |
- TransmitFile_Server, (void *)sparamp, |
1372 |
+ TransmitFile_Server, (void *)sparamp, |
1877 |
+ TransmitFile_Server, (void *)sparamp, |
1373 |
PR_PRIORITY_NORMAL, |
1878 |
PR_PRIORITY_NORMAL, |
1374 |
PR_LOCAL_THREAD, |
1879 |
PR_LOCAL_THREAD, |
1375 |
@@ -2105,5 +2117,5 @@ |
1880 |
PR_UNJOINABLE_THREAD, |
|
|
1881 |
@@ -2076,7 +2088,7 @@ Socket_Misc_Test(void) |
1882 |
rv = -1; |
1376 |
goto done; |
1883 |
goto done; |
1377 |
} |
1884 |
} |
1378 |
- DPRINTF(("Created TCP server = 0x%x\n", t)); |
1885 |
- DPRINTF(("Created TCP server = 0x%x\n", t)); |
1379 |
+ DPRINTF(("Created TCP server = %p\n", t)); |
1886 |
+ DPRINTF(("Created TCP server = %p\n", t)); |
1380 |
thread_count++; |
1887 |
thread_count++; |
1381 |
|
1888 |
|
1382 |
@@ -2142,5 +2154,5 @@ |
1889 |
/* |
|
|
1890 |
@@ -2113,7 +2125,7 @@ Socket_Misc_Test(void) |
1891 |
failed_already=1; |
1383 |
goto done; |
1892 |
goto done; |
1384 |
} |
1893 |
} |
1385 |
- DPRINTF(("Created TransmitFile client = 0x%lx\n", t)); |
1894 |
- DPRINTF(("Created TransmitFile client = 0x%lx\n", t)); |
1386 |
+ DPRINTF(("Created TransmitFile client = %p\n", t)); |
1895 |
+ DPRINTF(("Created TransmitFile client = %p\n", t)); |
1387 |
thread_count++; |
1896 |
thread_count++; |
1388 |
} |
1897 |
} |
1389 |
@@ -2173,5 +2185,5 @@ |
1898 |
/* Wait for server and client threads to exit */ |
|
|
1899 |
@@ -2144,7 +2156,7 @@ done: |
1900 |
} |
1390 |
if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) { |
1901 |
if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) { |
1391 |
fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n", |
1902 |
fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n", |
1392 |
- TEST_DIR, PR_GetError(), PR_GetOSError()); |
1903 |
- TEST_DIR, PR_GetError(), PR_GetOSError()); |
1393 |
+ TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError()); |
1904 |
+ TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError()); |
1394 |
failed_already=1; |
1905 |
failed_already=1; |
1395 |
} |
1906 |
} |
1396 |
--- ../pr/tests/sprintf.c Sun Apr 25 11:01:02 2004 |
1907 |
|
1397 |
+++ ../pr/tests/sprintf.c Mon Jul 25 22:21:32 2005 |
1908 |
--- ../pr/tests/sprintf.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1398 |
@@ -162,5 +162,5 @@ |
1909 |
+++ ../pr/tests/sprintf.c 2015-11-04 02:02:20.455364000 +0000 |
|
|
1910 |
@@ -127,7 +127,7 @@ static void test_l(char *pattern, char * |
1911 |
(strncmp(s, sbuf, sizeof(sbuf)) != 0)) { |
1399 |
fprintf(stderr, |
1912 |
fprintf(stderr, |
1400 |
"pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n", |
1913 |
"pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n", |
1401 |
- pattern, l, s, buf, sbuf); |
1914 |
- pattern, l, s, buf, sbuf); |
1402 |
+ pattern, (long)l, s, buf, sbuf); |
1915 |
+ pattern, (long)l, s, buf, sbuf); |
1403 |
PR_smprintf_free(s); |
1916 |
PR_smprintf_free(s); |
1404 |
exit(-1); |
1917 |
exit(-1); |
1405 |
--- ../pr/tests/stack.c Sun Apr 25 11:01:02 2004 |
1918 |
} |
1406 |
+++ ../pr/tests/stack.c Mon Jul 25 22:22:43 2005 |
1919 |
--- ../pr/tests/stack.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1407 |
@@ -86,5 +86,5 @@ |
1920 |
+++ ../pr/tests/stack.c 2015-11-04 02:02:20.455937000 +0000 |
1408 |
PRIntn main(PRIntn argc, char **argv) |
1921 |
@@ -54,7 +54,7 @@ PRFileDesc *errhandle; |
|
|
1922 |
int main(int argc, char **argv) |
1409 |
{ |
1923 |
{ |
|
|
1924 |
#if !(defined(SYMBIAN) && defined(__WINS__)) |
1410 |
- PRInt32 rv, cnt, sum; |
1925 |
- PRInt32 rv, cnt, sum; |
1411 |
+ PRInt32 cnt, sum; |
1926 |
+ PRInt32 cnt, sum; |
1412 |
DataRecord *Item; |
1927 |
DataRecord *Item; |
1413 |
PRStack *list1, *list2; |
1928 |
PRStack *list1, *list2; |
1414 |
@@ -240,5 +240,5 @@ |
1929 |
PRStackElem *node; |
|
|
1930 |
@@ -209,7 +209,7 @@ int main(int argc, char **argv) |
1931 |
static void stackop(void *thread_arg) |
1415 |
{ |
1932 |
{ |
1416 |
PRInt32 val, cnt, index, loops; |
1933 |
PRInt32 val, cnt, index, loops; |
1417 |
- DataRecord *Items, *Item; |
1934 |
- DataRecord *Items, *Item; |
1418 |
+ DataRecord *Items; |
1935 |
+ DataRecord *Items; |
1419 |
PRStack *list1, *list2; |
1936 |
PRStack *list1, *list2; |
1420 |
PRStackElem *node; |
1937 |
PRStackElem *node; |
1421 |
--- ../pr/tests/suspend.c.orig 2010-09-24 20:14:40.000000000 +0200 |
1938 |
stack_data *arg = (stack_data *) thread_arg; |
1422 |
+++ ../pr/tests/suspend.c 2011-01-15 13:56:43.000000000 +0100 |
1939 |
--- ../pr/tests/suspend.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1423 |
@@ -62,14 +62,14 @@ |
1940 |
+++ ../pr/tests/suspend.c 2015-11-04 02:02:20.456555000 +0000 |
|
|
1941 |
@@ -30,14 +30,14 @@ void PR_CALLBACK |
1424 |
Level_2_Thread(void *arg) |
1942 |
Level_2_Thread(void *arg) |
1425 |
{ |
1943 |
{ |
1426 |
PR_Sleep(PR_MillisecondsToInterval(4 * 1000)); |
1944 |
PR_Sleep(PR_MillisecondsToInterval(4 * 1000)); |
Lines 1437-1443
Link Here
|
1437 |
PRThreadScope scope = (PRThreadScope) tmp; |
1955 |
PRThreadScope scope = (PRThreadScope) tmp; |
1438 |
PRThread *thr; |
1956 |
PRThread *thr; |
1439 |
|
1957 |
|
1440 |
@@ -84,7 +84,7 @@ |
1958 |
@@ -52,7 +52,7 @@ Level_1_Thread(void *arg) |
1441 |
if (!thr) { |
1959 |
if (!thr) { |
1442 |
printf("Could not create thread!\n"); |
1960 |
printf("Could not create thread!\n"); |
1443 |
} else { |
1961 |
} else { |
Lines 1446-1452
Link Here
|
1446 |
PR_GetCurrentThread(), |
1964 |
PR_GetCurrentThread(), |
1447 |
(scope == PR_GLOBAL_THREAD) ? |
1965 |
(scope == PR_GLOBAL_THREAD) ? |
1448 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", |
1966 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", |
1449 |
@@ -95,7 +95,7 @@ |
1967 |
@@ -63,7 +63,7 @@ Level_1_Thread(void *arg) |
1450 |
alive--; |
1968 |
alive--; |
1451 |
PR_Notify(mon); |
1969 |
PR_Notify(mon); |
1452 |
PR_ExitMonitor(mon); |
1970 |
PR_ExitMonitor(mon); |
Lines 1455-1461
Link Here
|
1455 |
} |
1973 |
} |
1456 |
|
1974 |
|
1457 |
static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg) |
1975 |
static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg) |
1458 |
@@ -104,14 +104,15 @@ |
1976 |
@@ -72,14 +72,15 @@ static PRStatus PR_CALLBACK print_thread |
1459 |
PRWord *registers; |
1977 |
PRWord *registers; |
1460 |
|
1978 |
|
1461 |
printf( |
1979 |
printf( |
Lines 1475-1481
Link Here
|
1475 |
return PR_SUCCESS; |
1993 |
return PR_SUCCESS; |
1476 |
} |
1994 |
} |
1477 |
|
1995 |
|
1478 |
@@ -139,7 +140,7 @@ |
1996 |
@@ -107,7 +108,7 @@ static void Level_0_Thread(PRThreadScope |
1479 |
printf("Could not create thread!\n"); |
1997 |
printf("Could not create thread!\n"); |
1480 |
alive--; |
1998 |
alive--; |
1481 |
} |
1999 |
} |
Lines 1484-1490
Link Here
|
1484 |
PR_GetCurrentThread(), |
2002 |
PR_GetCurrentThread(), |
1485 |
(scope1 == PR_GLOBAL_THREAD) ? |
2003 |
(scope1 == PR_GLOBAL_THREAD) ? |
1486 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", |
2004 |
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", |
1487 |
@@ -151,9 +152,10 @@ |
2005 |
@@ -119,9 +120,10 @@ static void Level_0_Thread(PRThreadScope |
1488 |
PR_EnumerateThreads(print_thread, NULL); |
2006 |
PR_EnumerateThreads(print_thread, NULL); |
1489 |
registers = PR_GetGCRegisters(me, 1, (int *)&words); |
2007 |
registers = PR_GetGCRegisters(me, 1, (int *)&words); |
1490 |
if (registers) |
2008 |
if (registers) |
Lines 1498-1506
Link Here
|
1498 |
PR_ResumeAll(); |
2016 |
PR_ResumeAll(); |
1499 |
|
2017 |
|
1500 |
/* Wait for all threads to exit */ |
2018 |
/* Wait for all threads to exit */ |
1501 |
--- ../pr/tests/testfile.c Tue Jun 20 17:46:54 2000 |
2019 |
--- ../pr/tests/switch.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1502 |
+++ ../pr/tests/testfile.c Mon Jul 25 22:36:39 2005 |
2020 |
+++ ../pr/tests/switch.c 2015-11-04 02:02:20.469217000 +0000 |
1503 |
@@ -69,4 +69,7 @@ |
2021 |
@@ -80,7 +80,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c |
|
|
2022 |
PRStatus status; |
2023 |
PRBool help = PR_FALSE; |
2024 |
PRUintn concurrency = 1; |
2025 |
- Shared *shared, *link; |
2026 |
+ Shared *shared = NULL, *link; |
2027 |
PRIntervalTime timein, timeout; |
2028 |
PRThreadScope thread_scope = PR_LOCAL_THREAD; |
2029 |
PRUintn thread_count, inner_count, loop_count, average; |
2030 |
--- ../pr/tests/testfile.c.orig 2015-10-16 13:22:19.000000000 +0000 |
2031 |
+++ ../pr/tests/testfile.c 2015-11-04 02:02:20.457379000 +0000 |
2032 |
@@ -36,6 +36,9 @@ static int _debug_on = 0; |
2033 |
#ifdef XP_WIN |
1504 |
#define mode_t int |
2034 |
#define mode_t int |
1505 |
#endif |
2035 |
#endif |
1506 |
+#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
2036 |
+#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
Lines 1508-1528
Link Here
|
1508 |
+#endif |
2038 |
+#endif |
1509 |
|
2039 |
|
1510 |
#define DPRINTF(arg) if (_debug_on) printf arg |
2040 |
#define DPRINTF(arg) if (_debug_on) printf arg |
1511 |
@@ -119,5 +122,5 @@ |
2041 |
|
|
|
2042 |
@@ -93,7 +96,7 @@ static PRInt32 PR_CALLBACK DirTest(void |
2043 |
PRInt32 dirtest_failed = 0; |
1512 |
|
2044 |
|
1513 |
PRThread* create_new_thread(PRThreadType type, |
2045 |
PRThread* create_new_thread(PRThreadType type, |
1514 |
- void (*start)(void *arg), |
2046 |
- void (*start)(void *arg), |
1515 |
+ void *(*start)(void *arg), |
2047 |
+ void *(*start)(void *arg), |
1516 |
void *arg, |
2048 |
void *arg, |
1517 |
PRThreadPriority priority, |
2049 |
PRThreadPriority priority, |
1518 |
@@ -181,5 +184,5 @@ |
2050 |
PRThreadScope scope, |
|
|
2051 |
@@ -155,7 +158,7 @@ PRInt32 native_thread = 0; |
2052 |
return((PRThread *) thandle); |
1519 |
#endif |
2053 |
#endif |
1520 |
} else { |
2054 |
} else { |
1521 |
- return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize)); |
2055 |
- return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize)); |
1522 |
+ return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize)); |
2056 |
+ return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize)); |
1523 |
} |
2057 |
} |
1524 |
#else |
2058 |
#else |
1525 |
@@ -342,6 +345,6 @@ |
2059 |
return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize)); |
|
|
2060 |
@@ -316,8 +319,8 @@ char tmpname[1024]; |
2061 |
printf( |
1526 |
"testfile PR_GetFileInfo returned incorrect status-change time: %s\n", |
2062 |
"testfile PR_GetFileInfo returned incorrect status-change time: %s\n", |
1527 |
pathname); |
2063 |
pathname); |
1528 |
- printf("ft = %lld, ft1 = %lld\n",file_info.creationTime, |
2064 |
- printf("ft = %lld, ft1 = %lld\n",file_info.creationTime, |
Lines 1531-1537
Link Here
|
1531 |
+ (long long)file_info1.creationTime); |
2067 |
+ (long long)file_info1.creationTime); |
1532 |
rv = -1; |
2068 |
rv = -1; |
1533 |
goto cleanup; |
2069 |
goto cleanup; |
1534 |
@@ -368,6 +371,6 @@ |
2070 |
} |
|
|
2071 |
@@ -342,8 +345,8 @@ char tmpname[1024]; |
2072 |
printf( |
1535 |
"testfile PR_GetFileInfo returned incorrect modify time: %s\n", |
2073 |
"testfile PR_GetFileInfo returned incorrect modify time: %s\n", |
1536 |
pathname); |
2074 |
pathname); |
1537 |
- printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime, |
2075 |
- printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime, |
Lines 1540-1616
Link Here
|
1540 |
+ (long long)file_info1.modifyTime); |
2078 |
+ (long long)file_info1.modifyTime); |
1541 |
rv = -1; |
2079 |
rv = -1; |
1542 |
goto cleanup; |
2080 |
goto cleanup; |
1543 |
@@ -495,5 +498,5 @@ |
2081 |
} |
|
|
2082 |
@@ -469,7 +472,7 @@ File_Rdwr_Param *fparamp; |
2083 |
memset(fparamp->buf, i, len); |
1544 |
|
2084 |
|
1545 |
t = create_new_thread(PR_USER_THREAD, |
2085 |
t = create_new_thread(PR_USER_THREAD, |
1546 |
- File_Write, (void *)fparamp, |
2086 |
- File_Write, (void *)fparamp, |
1547 |
+ (void *(*)(void *))File_Write, (void *)fparamp, |
2087 |
+ (void *(*)(void *))File_Write, (void *)fparamp, |
1548 |
PR_PRIORITY_NORMAL, |
2088 |
PR_PRIORITY_NORMAL, |
1549 |
scope, |
2089 |
scope, |
1550 |
@@ -530,5 +533,5 @@ |
2090 |
PR_UNJOINABLE_THREAD, |
|
|
2091 |
@@ -504,7 +507,7 @@ File_Rdwr_Param *fparamp; |
2092 |
fparamp->len = len; |
1551 |
|
2093 |
|
1552 |
t = create_new_thread(PR_USER_THREAD, |
2094 |
t = create_new_thread(PR_USER_THREAD, |
1553 |
- File_Read, (void *)fparamp, |
2095 |
- File_Read, (void *)fparamp, |
1554 |
+ (void *(*)(void *))File_Read, (void *)fparamp, |
2096 |
+ (void *(*)(void *))File_Read, (void *)fparamp, |
1555 |
PR_PRIORITY_NORMAL, |
2097 |
PR_PRIORITY_NORMAL, |
1556 |
scope, |
2098 |
scope, |
1557 |
@@ -598,5 +601,5 @@ |
2099 |
PR_UNJOINABLE_THREAD, |
|
|
2100 |
@@ -572,7 +575,7 @@ struct dirtest_arg thrarg; |
2101 |
|
1558 |
thrarg.done= 0; |
2102 |
thrarg.done= 0; |
1559 |
t = create_new_thread(PR_USER_THREAD, |
2103 |
t = create_new_thread(PR_USER_THREAD, |
1560 |
- DirTest, &thrarg, |
2104 |
- DirTest, &thrarg, |
1561 |
+ (void *(*)(void *))DirTest, &thrarg, |
2105 |
+ (void *(*)(void *))DirTest, &thrarg, |
1562 |
PR_PRIORITY_NORMAL, |
2106 |
PR_PRIORITY_NORMAL, |
1563 |
PR_LOCAL_THREAD, |
2107 |
PR_LOCAL_THREAD, |
1564 |
@@ -953,6 +956,4 @@ |
2108 |
PR_UNJOINABLE_THREAD, |
1565 |
#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
2109 |
@@ -895,8 +898,6 @@ int main(int argc, char **argv) |
1566 |
int opt; |
2110 |
#endif |
1567 |
- extern char *optarg; |
2111 |
#if defined(XP_UNIX) || defined(XP_OS2) |
1568 |
- extern int optind; |
2112 |
int opt; |
1569 |
#endif |
2113 |
- extern char *optarg; |
1570 |
#if defined(XP_UNIX) || defined(XP_OS2_EMX) |
2114 |
- extern int optind; |
1571 |
--- ../pr/tests/thrpool_server.c 2009-05-06 01:40:39.000000000 -0400 |
2115 |
#endif |
1572 |
+++ ../pr/tests/thrpool_server.c 2009-11-04 16:53:49.000000000 -0500 |
2116 |
#if defined(XP_UNIX) || defined(XP_OS2) |
1573 |
@@ -351,5 +351,5 @@ |
2117 |
while ((opt = getopt(argc, argv, "d")) != EOF) { |
1574 |
|
2118 |
--- ../pr/tests/threads.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1575 |
DPRINTF(( |
2119 |
+++ ../pr/tests/threads.c 2015-11-04 02:02:20.459183000 +0000 |
1576 |
- "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
2120 |
@@ -27,7 +27,7 @@ void |
1577 |
+ "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
2121 |
PR_CALLBACK |
1578 |
netaddr.inet.ip, netaddr.inet.port)); |
2122 |
DumbThread(void *arg) |
1579 |
|
2123 |
{ |
1580 |
@@ -363,5 +363,5 @@ |
2124 |
- PRInt32 tmp = (PRInt32)arg; |
1581 |
sp->iod.timeout = PR_SecondsToInterval(60); |
2125 |
+ PRInt32 tmp = (PRInt32)(intptr_t)arg; |
1582 |
sp->datalen = tcp_mesg_size; |
2126 |
PRThreadScope scope = (PRThreadScope)tmp; |
1583 |
- sp->exit_mon = sc_mon; |
2127 |
PRThread *thr; |
1584 |
+ sp->exit_mon = NULL; |
|
|
1585 |
sp->job_counterp = &job_counter; |
1586 |
sp->conn_counter = 0; |
1587 |
@@ -486,5 +486,5 @@ |
1588 |
|
1589 |
PR_ASSERT(NULL != jobp); |
1590 |
- DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp)); |
1591 |
+ DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp)); |
1592 |
|
1593 |
/* |
1594 |
@@ -503,5 +503,5 @@ |
1595 |
|
2128 |
|
1596 |
PR_ASSERT(NULL != jobp); |
2129 |
@@ -167,10 +167,10 @@ int main(int argc, char **argv) |
1597 |
- DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp)); |
|
|
1598 |
+ DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp)); |
1599 |
|
2130 |
|
1600 |
exit: |
2131 |
if (debug_mode) |
1601 |
@@ -520,7 +520,7 @@ |
2132 |
{ |
1602 |
PR_DestroyMonitor(sp->exit_mon); |
2133 |
- printf("\ |
1603 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
2134 |
-** Tests lots of thread creations. \n\ |
1604 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
2135 |
-** Create %ld native threads %ld times. \n\ |
1605 |
+ printf(" 1 Server %2d Clients %2d connections_per_client\n", |
2136 |
-** Create %ld user threads %ld times \n", iterations,count,iterations,count); |
1606 |
num_tcp_clients, num_tcp_connections_per_client); |
2137 |
+ printf("** Tests lots of thread creations.\n" |
1607 |
- printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":", |
2138 |
+ "** Create %d native threads %d times.\n" |
1608 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
2139 |
+ "** Create %d user threads %d times.\n", iterations, count, |
1609 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
2140 |
+ iterations, count); |
|
|
2141 |
} |
1610 |
|
2142 |
|
1611 |
--- ../pr/tests/thrpool_client.c Sun Apr 25 11:01:02 2004 |
2143 |
for (index=0; index<iterations; index++) { |
1612 |
+++ ../pr/tests/thrpool_client.c Mon Jul 25 22:40:45 2005 |
2144 |
--- ../pr/tests/thrpool_client.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1613 |
@@ -127,9 +127,9 @@ |
2145 |
+++ ../pr/tests/thrpool_client.c 2015-11-04 02:02:20.458656000 +0000 |
|
|
2146 |
@@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int |
2147 |
PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT; |
1614 |
|
2148 |
|
1615 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
2149 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1616 |
- DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n", |
2150 |
- DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n", |
Lines 1622-1628
Link Here
|
1622 |
+ DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n", |
2156 |
+ DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n", |
1623 |
PR_GetCurrentThread(), bytes)); |
2157 |
PR_GetCurrentThread(), bytes)); |
1624 |
if (bytes < 0) { |
2158 |
if (bytes < 0) { |
1625 |
@@ -152,9 +152,9 @@ |
2159 |
return -1; |
|
|
2160 |
@@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in |
2161 |
int offset = 0; |
1626 |
|
2162 |
|
1627 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
2163 |
for (rem=len; rem; offset += bytes, rem -= bytes) { |
1628 |
- DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n", |
2164 |
- DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n", |
Lines 1634-1661
Link Here
|
1634 |
+ DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n", |
2170 |
+ DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n", |
1635 |
PR_GetCurrentThread(), bytes)); |
2171 |
PR_GetCurrentThread(), bytes)); |
1636 |
if (bytes <= 0) |
2172 |
if (bytes <= 0) |
1637 |
@@ -209,5 +209,5 @@ |
2173 |
return -1; |
|
|
2174 |
@@ -164,7 +164,7 @@ TCP_Client(void *arg) |
2175 |
|
1638 |
DPRINTF(("TCP client connecting to server:%d\n", server_port)); |
2176 |
DPRINTF(("TCP client connecting to server:%d\n", server_port)); |
1639 |
if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){ |
2177 |
if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){ |
1640 |
- fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n", |
2178 |
- fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n", |
1641 |
+ fprintf(stderr, "PR_Connect failed: (%d, %d)\n", |
2179 |
+ fprintf(stderr, "PR_Connect failed: (%d, %d)\n", |
1642 |
PR_GetError(), PR_GetOSError()); |
2180 |
PR_GetError(), PR_GetOSError()); |
1643 |
failed_already=1; |
2181 |
failed_already=1; |
1644 |
@@ -218,5 +218,5 @@ |
2182 |
return; |
|
|
2183 |
@@ -173,7 +173,7 @@ TCP_Client(void *arg) |
2184 |
/* |
1645 |
* fill in random data |
2185 |
* fill in random data |
1646 |
*/ |
2186 |
*/ |
1647 |
- memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes); |
2187 |
- memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes); |
1648 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes); |
2188 |
+ memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes); |
1649 |
/* |
2189 |
/* |
1650 |
* write to server |
2190 |
* write to server |
1651 |
@@ -326,5 +326,5 @@ |
2191 |
*/ |
|
|
2192 |
@@ -281,7 +281,7 @@ TCP_Socket_Client_Server_Test(void) |
2193 |
PR_EnterMonitor(mon2); |
1652 |
connections++; |
2194 |
connections++; |
1653 |
PR_ExitMonitor(mon2); |
2195 |
PR_ExitMonitor(mon2); |
1654 |
- DPRINTF(("Created TCP client = 0x%lx\n", thr)); |
2196 |
- DPRINTF(("Created TCP client = 0x%lx\n", thr)); |
1655 |
+ DPRINTF(("Created TCP client = %p\n", thr)); |
2197 |
+ DPRINTF(("Created TCP client = %p\n", thr)); |
1656 |
} |
2198 |
} |
1657 |
/* Wait for client jobs to exit */ |
2199 |
/* Wait for client jobs to exit */ |
1658 |
@@ -336,7 +336,7 @@ |
2200 |
PR_EnterMonitor(mon2); |
|
|
2201 |
@@ -291,9 +291,9 @@ TCP_Socket_Client_Server_Test(void) |
2202 |
} |
1659 |
PR_ExitMonitor(mon2); |
2203 |
PR_ExitMonitor(mon2); |
1660 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
2204 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
1661 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
2205 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
Lines 1665-1830
Link Here
|
1665 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
2209 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
1666 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
2210 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
1667 |
|
2211 |
|
1668 |
--- ../pr/tests/threads.c Sun Apr 25 11:01:02 2004 |
2212 |
PR_DELETE(cparamp); |
1669 |
+++ ../pr/tests/threads.c Mon Jul 25 22:43:10 2005 |
2213 |
--- ../pr/tests/thrpool_server.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1670 |
@@ -66,5 +66,5 @@ |
2214 |
+++ ../pr/tests/thrpool_server.c 2015-11-04 02:02:20.458033000 +0000 |
1671 |
DumbThread(void *arg) |
2215 |
@@ -329,7 +329,7 @@ TCP_Server(void *arg) |
1672 |
{ |
2216 |
} |
1673 |
- PRInt32 tmp = (PRInt32)arg; |
2217 |
|
1674 |
+ PRInt32 tmp = (PRInt32)(intptr_t)arg; |
2218 |
DPRINTF(( |
1675 |
PRThreadScope scope = (PRThreadScope)tmp; |
2219 |
- "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n", |
1676 |
PRThread *thr; |
2220 |
+ "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n", |
1677 |
@@ -214,8 +214,8 @@ |
2221 |
netaddr.inet.ip, netaddr.inet.port)); |
1678 |
if (debug_mode) |
2222 |
|
1679 |
{ |
2223 |
sp = PR_NEW(Server_Param); |
1680 |
- printf("\ |
2224 |
@@ -341,7 +341,7 @@ TCP_Server(void *arg) |
1681 |
-** Tests lots of thread creations. \n\ |
2225 |
sp->iod.socket = sockfd; |
1682 |
-** Create %ld native threads %ld times. \n\ |
2226 |
sp->iod.timeout = PR_SecondsToInterval(60); |
1683 |
-** Create %ld user threads %ld times \n", iterations,count,iterations,count); |
2227 |
sp->datalen = tcp_mesg_size; |
1684 |
+ printf("** Tests lots of thread creations.\n" |
2228 |
- sp->exit_mon = sc_mon; |
1685 |
+ "** Create %d native threads %d times.\n" |
2229 |
+ sp->exit_mon = NULL; |
1686 |
+ "** Create %d user threads %d times.\n", iterations, count, |
2230 |
sp->job_counterp = &job_counter; |
1687 |
+ iterations, count); |
2231 |
sp->conn_counter = 0; |
|
|
2232 |
sp->tp = tp; |
2233 |
@@ -464,7 +464,7 @@ TCP_Server_Accept(void *arg) |
2234 |
PR_FALSE); |
2235 |
|
2236 |
PR_ASSERT(NULL != jobp); |
2237 |
- DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp)); |
2238 |
+ DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp)); |
2239 |
|
2240 |
/* |
2241 |
* single-threaded update; no lock needed |
2242 |
@@ -481,7 +481,7 @@ TCP_Server_Accept(void *arg) |
2243 |
print_stats, sp, PR_FALSE); |
2244 |
|
2245 |
PR_ASSERT(NULL != jobp); |
2246 |
- DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp)); |
2247 |
+ DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp)); |
2248 |
|
2249 |
exit: |
2250 |
PR_EnterMonitor(sp->exit_mon); |
2251 |
@@ -498,9 +498,9 @@ exit: |
1688 |
} |
2252 |
} |
|
|
2253 |
PR_DestroyMonitor(sp->exit_mon); |
2254 |
printf("%30s","TCP_Socket_Client_Server_Test:"); |
2255 |
- printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l, |
2256 |
+ printf(" 1 Server %2d Clients %2d connections_per_client\n", |
2257 |
num_tcp_clients, num_tcp_connections_per_client); |
2258 |
- printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":", |
2259 |
+ printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":", |
2260 |
num_tcp_mesgs_per_connection, tcp_mesg_size); |
1689 |
|
2261 |
|
1690 |
--- ../pr/tests/thruput.c.orig 2009-02-23 00:00:45.000000000 -0500 |
2262 |
DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name)); |
1691 |
+++ ../pr/tests/thruput.c 2009-11-04 16:56:33.000000000 -0500 |
2263 |
--- ../pr/tests/thruput.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1692 |
@@ -99,5 +99,5 @@ |
2264 |
+++ ../pr/tests/thruput.c 2015-11-04 02:02:20.459783000 +0000 |
|
|
2265 |
@@ -66,7 +66,7 @@ static void PR_CALLBACK Clientel(void *a |
2266 |
{ |
1693 |
PRStatus rv; |
2267 |
PRStatus rv; |
1694 |
PRFileDesc *xport; |
2268 |
PRFileDesc *xport; |
1695 |
- PRInt32 bytes, sampled; |
2269 |
- PRInt32 bytes, sampled; |
1696 |
+ PRInt32 bytes, sampled = -1; |
2270 |
+ PRInt32 bytes, sampled = -1; |
1697 |
PRIntervalTime now, interval; |
2271 |
PRIntervalTime now, interval; |
1698 |
PRBool do_display = PR_FALSE; |
2272 |
PRBool do_display = PR_FALSE; |
1699 |
@@ -208,5 +208,5 @@ |
2273 |
Shared *shared = (Shared*)arg; |
|
|
2274 |
@@ -175,7 +175,7 @@ static void Client(const char *server_na |
2275 |
|
1700 |
static void PR_CALLBACK Servette(void *arg) |
2276 |
static void PR_CALLBACK Servette(void *arg) |
1701 |
{ |
2277 |
{ |
1702 |
- PRInt32 bytes, sampled; |
2278 |
- PRInt32 bytes, sampled; |
1703 |
+ PRInt32 bytes, sampled = -1; |
2279 |
+ PRInt32 bytes, sampled = -1; |
1704 |
PRIntervalTime now, interval; |
2280 |
PRIntervalTime now, interval; |
1705 |
PRBool do_display = PR_FALSE; |
2281 |
PRBool do_display = PR_FALSE; |
1706 |
@@ -405,4 +405,5 @@ |
2282 |
PRFileDesc *client = (PRFileDesc*)arg; |
|
|
2283 |
@@ -373,6 +373,7 @@ int main(int argc, char **argv) |
1707 |
else Client(server_name); |
2284 |
else Client(server_name); |
1708 |
|
2285 |
|
|
|
2286 |
return 0; |
1709 |
+ return 0; |
2287 |
+ return 0; |
1710 |
} /* main */ |
2288 |
} /* main */ |
1711 |
|
2289 |
|
1712 |
--- ../pr/tests/timemac.c Sun Apr 25 11:01:02 2004 |
2290 |
/* thruput.c */ |
1713 |
+++ ../pr/tests/timemac.c Mon Jul 25 22:45:33 2005 |
2291 |
--- ../pr/tests/timemac.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1714 |
@@ -63,5 +63,5 @@ |
2292 |
+++ ../pr/tests/timemac.c 2015-11-04 02:02:20.460286000 +0000 |
|
|
2293 |
@@ -24,7 +24,7 @@ static void printExplodedTime(const PREx |
2294 |
const char *sign; |
1715 |
|
2295 |
|
1716 |
/* Print day of the week, month, day, hour, minute, and second */ |
2296 |
/* Print day of the week, month, day, hour, minute, and second */ |
1717 |
- printf( "%s %s %ld %02ld:%02ld:%02ld ", |
2297 |
- printf( "%s %s %ld %02ld:%02ld:%02ld ", |
1718 |
+ printf( "%s %s %d %02d:%02d:%02d ", |
2298 |
+ printf( "%s %s %d %02d:%02d:%02d ", |
1719 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
2299 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
1720 |
et->tm_hour, et->tm_min, et->tm_sec); |
2300 |
et->tm_hour, et->tm_min, et->tm_sec); |
1721 |
@@ -79,5 +79,5 @@ |
2301 |
|
|
|
2302 |
@@ -40,7 +40,7 @@ static void printExplodedTime(const PREx |
2303 |
} |
1722 |
hourOffset = totalOffset / 3600; |
2304 |
hourOffset = totalOffset / 3600; |
1723 |
minOffset = (totalOffset % 3600) / 60; |
2305 |
minOffset = (totalOffset % 3600) / 60; |
1724 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
2306 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
1725 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
2307 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
1726 |
} |
2308 |
} |
1727 |
|
2309 |
|
1728 |
@@ -140,5 +140,5 @@ |
2310 |
/* Print year */ |
|
|
2311 |
@@ -97,7 +97,7 @@ int main(int argc, char** argv) |
2312 |
printf("Current local time is "); |
1729 |
printExplodedTime(&et); |
2313 |
printExplodedTime(&et); |
1730 |
printf("\n"); |
2314 |
printf("\n"); |
1731 |
- printf("GMT offset is %ld, DST offset is %ld\n", |
2315 |
- printf("GMT offset is %ld, DST offset is %ld\n", |
1732 |
+ printf("GMT offset is %d, DST offset is %d\n", |
2316 |
+ printf("GMT offset is %d, DST offset is %d\n", |
1733 |
et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset); |
2317 |
et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset); |
1734 |
t2 = PR_ImplodeTime(&et); |
2318 |
t2 = PR_ImplodeTime(&et); |
1735 |
--- ../pr/tests/timetest.c Sun Apr 25 11:01:02 2004 |
2319 |
if (LL_NE(t1, t2)) { |
1736 |
+++ ../pr/tests/timetest.c Mon Jul 25 22:48:03 2005 |
2320 |
--- ../pr/tests/timetest.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1737 |
@@ -75,5 +75,5 @@ |
2321 |
+++ ../pr/tests/timetest.c 2015-11-04 02:02:20.460982000 +0000 |
|
|
2322 |
@@ -36,7 +36,7 @@ static void PrintExplodedTime(const PREx |
2323 |
const char *sign; |
1738 |
|
2324 |
|
1739 |
/* Print day of the week, month, day, hour, minute, and second */ |
2325 |
/* Print day of the week, month, day, hour, minute, and second */ |
1740 |
- if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ", |
2326 |
- if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ", |
1741 |
+ if (debug_mode) printf("%s %s %d %02d:%02d:%02d ", |
2327 |
+ if (debug_mode) printf("%s %s %d %02d:%02d:%02d ", |
1742 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
2328 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
1743 |
et->tm_hour, et->tm_min, et->tm_sec); |
2329 |
et->tm_hour, et->tm_min, et->tm_sec); |
1744 |
@@ -92,5 +92,5 @@ |
2330 |
|
|
|
2331 |
@@ -53,7 +53,7 @@ static void PrintExplodedTime(const PREx |
2332 |
hourOffset = totalOffset / 3600; |
1745 |
minOffset = (totalOffset % 3600) / 60; |
2333 |
minOffset = (totalOffset % 3600) / 60; |
1746 |
if (debug_mode) |
2334 |
if (debug_mode) |
1747 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
2335 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
1748 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
2336 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
1749 |
} |
2337 |
} |
1750 |
|
2338 |
|
1751 |
@@ -276,5 +276,5 @@ |
2339 |
/* Print year */ |
|
|
2340 |
@@ -232,7 +232,7 @@ int main(int argc, char** argv) |
2341 |
if (debug_mode) printf("Current local time is "); |
1752 |
PrintExplodedTime(&et); |
2342 |
PrintExplodedTime(&et); |
1753 |
if (debug_mode) printf("\n"); |
2343 |
if (debug_mode) printf("\n"); |
1754 |
- if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n", |
2344 |
- if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n", |
1755 |
+ if (debug_mode) printf("GMT offset is %d, DST offset is %d\n", |
2345 |
+ if (debug_mode) printf("GMT offset is %d, DST offset is %d\n", |
1756 |
et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset); |
2346 |
et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset); |
1757 |
t2 = PR_ImplodeTime(&et); |
2347 |
t2 = PR_ImplodeTime(&et); |
1758 |
--- ../pr/tests/y2k.c Sun Apr 25 11:01:02 2004 |
2348 |
if (LL_NE(t1, t2)) { |
1759 |
+++ ../pr/tests/y2k.c Mon Jul 25 22:49:18 2005 |
2349 |
--- ../pr/tests/y2k.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1760 |
@@ -82,5 +82,5 @@ |
2350 |
+++ ../pr/tests/y2k.c 2015-11-04 02:02:20.461806000 +0000 |
|
|
2351 |
@@ -43,7 +43,7 @@ static void PrintExplodedTime(const PREx |
2352 |
const char *sign; |
1761 |
|
2353 |
|
1762 |
/* Print day of the week, month, day, hour, minute, and second */ |
2354 |
/* Print day of the week, month, day, hour, minute, and second */ |
1763 |
- printf("%s %s %2ld %02ld:%02ld:%02ld ", |
2355 |
- printf("%s %s %2ld %02ld:%02ld:%02ld ", |
1764 |
+ printf("%s %s %2d %02d:%02d:%02d ", |
2356 |
+ printf("%s %s %2d %02d:%02d:%02d ", |
1765 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
2357 |
dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
1766 |
et->tm_hour, et->tm_min, et->tm_sec); |
2358 |
et->tm_hour, et->tm_min, et->tm_sec); |
1767 |
@@ -101,5 +101,5 @@ |
2359 |
|
|
|
2360 |
@@ -62,7 +62,7 @@ static void PrintExplodedTime(const PREx |
2361 |
} |
1768 |
hourOffset = totalOffset / 3600; |
2362 |
hourOffset = totalOffset / 3600; |
1769 |
minOffset = (totalOffset % 3600) / 60; |
2363 |
minOffset = (totalOffset % 3600) / 60; |
1770 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
2364 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
1771 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
2365 |
+ printf("%s%02d%02d ", sign, hourOffset, minOffset); |
1772 |
} |
2366 |
} |
1773 |
#ifdef PRINT_DETAILS |
2367 |
#ifdef PRINT_DETAILS |
1774 |
--- ../pr/tests/y2ktmo.c Sun Apr 25 11:01:02 2004 |
2368 |
printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec, |
1775 |
+++ ../pr/tests/y2ktmo.c Mon Jul 25 22:58:00 2005 |
2369 |
--- ../pr/tests/y2ktmo.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1776 |
@@ -95,5 +95,5 @@ |
2370 |
+++ ../pr/tests/y2ktmo.c 2015-11-04 02:02:20.462515000 +0000 |
|
|
2371 |
@@ -70,7 +70,7 @@ static struct _timeb start_time_tb; |
2372 |
|
1777 |
static void SleepThread(void *arg) |
2373 |
static void SleepThread(void *arg) |
1778 |
{ |
2374 |
{ |
1779 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2375 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1780 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2376 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1781 |
PRIntervalTime elapsed; |
2377 |
PRIntervalTime elapsed; |
1782 |
#if defined(XP_UNIX) || defined(WIN32) |
2378 |
#if defined(XP_UNIX) || defined(WIN32) |
1783 |
@@ -142,5 +142,5 @@ |
2379 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2380 |
@@ -121,7 +121,7 @@ static void SleepThread(void *arg) |
2381 |
|
1784 |
static void AcceptThread(void *arg) |
2382 |
static void AcceptThread(void *arg) |
1785 |
{ |
2383 |
{ |
1786 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2384 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1787 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2385 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1788 |
PRIntervalTime elapsed; |
2386 |
PRIntervalTime elapsed; |
1789 |
#if defined(XP_UNIX) || defined(WIN32) |
2387 |
#if defined(XP_UNIX) || defined(WIN32) |
1790 |
@@ -214,5 +214,5 @@ |
2388 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2389 |
@@ -197,7 +197,7 @@ static void AcceptThread(void *arg) |
2390 |
|
1791 |
static void PollThread(void *arg) |
2391 |
static void PollThread(void *arg) |
1792 |
{ |
2392 |
{ |
1793 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2393 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1794 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2394 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1795 |
PRIntervalTime elapsed; |
2395 |
PRIntervalTime elapsed; |
1796 |
#if defined(XP_UNIX) || defined(WIN32) |
2396 |
#if defined(XP_UNIX) || defined(WIN32) |
1797 |
@@ -289,5 +289,5 @@ |
2397 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2398 |
@@ -276,7 +276,7 @@ static void PollThread(void *arg) |
2399 |
|
1798 |
static void WaitCondVarThread(void *arg) |
2400 |
static void WaitCondVarThread(void *arg) |
1799 |
{ |
2401 |
{ |
1800 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2402 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1801 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2403 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1802 |
PRIntervalTime elapsed; |
2404 |
PRIntervalTime elapsed; |
1803 |
#if defined(XP_UNIX) || defined(WIN32) |
2405 |
#if defined(XP_UNIX) || defined(WIN32) |
1804 |
@@ -349,5 +349,5 @@ |
2406 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2407 |
@@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg) |
2408 |
|
1805 |
static void WaitMonitorThread(void *arg) |
2409 |
static void WaitMonitorThread(void *arg) |
1806 |
{ |
2410 |
{ |
1807 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2411 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1808 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2412 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1809 |
PRIntervalTime elapsed; |
2413 |
PRIntervalTime elapsed; |
1810 |
#if defined(XP_UNIX) || defined(WIN32) |
2414 |
#if defined(XP_UNIX) || defined(WIN32) |
1811 |
@@ -402,5 +402,5 @@ |
2415 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2416 |
@@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg) |
2417 |
|
1812 |
static void WaitCMonitorThread(void *arg) |
2418 |
static void WaitCMonitorThread(void *arg) |
1813 |
{ |
2419 |
{ |
1814 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
2420 |
- PRIntervalTime timeout = (PRIntervalTime) arg; |
1815 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
2421 |
+ PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg; |
1816 |
PRIntervalTime elapsed; |
2422 |
PRIntervalTime elapsed; |
1817 |
#if defined(XP_UNIX) || defined(WIN32) |
2423 |
#if defined(XP_UNIX) || defined(WIN32) |
1818 |
@@ -525,5 +525,5 @@ |
2424 |
PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout); |
|
|
2425 |
@@ -528,7 +528,7 @@ int main(int argc, char **argv) |
2426 |
for (i = 0; i < num_thread_scopes; i++) { |
1819 |
for (j = 0; j < num_thread_funcs; j++) { |
2427 |
for (j = 0; j < num_thread_funcs; j++) { |
1820 |
threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j], |
2428 |
threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j], |
1821 |
- (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL, |
2429 |
- (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL, |
1822 |
+ (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL, |
2430 |
+ (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL, |
1823 |
threadScopes[i], PR_JOINABLE_THREAD, 0); |
2431 |
threadScopes[i], PR_JOINABLE_THREAD, 0); |
1824 |
if (threads[idx] == NULL) { |
2432 |
if (threads[idx] == NULL) { |
1825 |
--- ../pr/tests/zerolen.c.orig 2012-03-06 14:14:33.000000000 +0100 |
2433 |
fprintf(stderr, "PR_CreateThread failed\n"); |
1826 |
+++ ../pr/tests/zerolen.c 2012-06-04 13:39:40.000000000 +0200 |
2434 |
--- ../pr/tests/zerolen.c.orig 2015-10-16 13:22:19.000000000 +0000 |
1827 |
@@ -45,7 +45,7 @@ |
2435 |
+++ ../pr/tests/zerolen.c 2015-11-04 02:02:20.463071000 +0000 |
|
|
2436 |
@@ -45,7 +45,7 @@ static void ClientThread(void *arg) |
1828 |
{ |
2437 |
{ |
1829 |
PRFileDesc *sock; |
2438 |
PRFileDesc *sock; |
1830 |
PRNetAddr addr; |
2439 |
PRNetAddr addr; |
Lines 1833-1839
Link Here
|
1833 |
char buf[1024]; |
2442 |
char buf[1024]; |
1834 |
PRInt32 nbytes; |
2443 |
PRInt32 nbytes; |
1835 |
|
2444 |
|
1836 |
@@ -127,7 +127,7 @@ |
2445 |
@@ -127,7 +127,7 @@ int main() |
1837 |
* First test PR_Writev. |
2446 |
* First test PR_Writev. |
1838 |
*/ |
2447 |
*/ |
1839 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
2448 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
Lines 1842-1848
Link Here
|
1842 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
2451 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
1843 |
if (NULL == clientThread) { |
2452 |
if (NULL == clientThread) { |
1844 |
fprintf(stderr, "PR_CreateThread failed\n"); |
2453 |
fprintf(stderr, "PR_CreateThread failed\n"); |
1845 |
@@ -171,7 +171,7 @@ |
2454 |
@@ -171,7 +171,7 @@ int main() |
1846 |
* Then test PR_Write. |
2455 |
* Then test PR_Write. |
1847 |
*/ |
2456 |
*/ |
1848 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
2457 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
Lines 1851-1857
Link Here
|
1851 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
2460 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
1852 |
if (NULL == clientThread) { |
2461 |
if (NULL == clientThread) { |
1853 |
fprintf(stderr, "PR_CreateThread failed\n"); |
2462 |
fprintf(stderr, "PR_CreateThread failed\n"); |
1854 |
@@ -216,7 +216,7 @@ |
2463 |
@@ -216,7 +216,7 @@ int main() |
1855 |
* Finally test PR_Send. |
2464 |
* Finally test PR_Send. |
1856 |
*/ |
2465 |
*/ |
1857 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
2466 |
clientThread = PR_CreateThread(PR_USER_THREAD, |
Lines 1860-2047
Link Here
|
1860 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
2469 |
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); |
1861 |
if (NULL == clientThread) { |
2470 |
if (NULL == clientThread) { |
1862 |
fprintf(stderr, "PR_CreateThread failed\n"); |
2471 |
fprintf(stderr, "PR_CreateThread failed\n"); |
1863 |
--- ../pr/tests/runtests.sh Sun Apr 25 11:01:02 2004 |
|
|
1864 |
+++ ../pr/tests/runtests.sh Tue Jul 26 00:01:35 2005 |
1865 |
@@ -85,7 +85,4 @@ |
1866 |
# |
1867 |
|
1868 |
-#forktest (failed on IRIX) |
1869 |
-#nbconn - fails on some platforms |
1870 |
-#poll_er - fails on some platforms? limited use? |
1871 |
#prpoll - the bad-FD test needs to be moved to a different test |
1872 |
#sleep - specific to OS/2 |
1873 |
@@ -119,4 +116,5 @@ |
1874 |
fileio |
1875 |
foreign |
1876 |
+forktest |
1877 |
formattm |
1878 |
fsync |
1879 |
@@ -126,5 +124,4 @@ |
1880 |
initclk |
1881 |
inrval |
1882 |
-instrumt |
1883 |
intrio |
1884 |
intrupt |
1885 |
@@ -146,4 +143,5 @@ |
1886 |
multiwait |
1887 |
nameshm1 |
1888 |
+nbconn |
1889 |
nblayer |
1890 |
nonblock |
1891 |
@@ -161,4 +159,5 @@ |
1892 |
pipeping2 |
1893 |
pipeself |
1894 |
+poll_er |
1895 |
poll_nm |
1896 |
poll_to |
1897 |
@@ -230,5 +229,5 @@ |
1898 |
printf "BEGIN\t\t\t`date`\n" |
1899 |
printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n" |
1900 |
-printf "Test\t\t\tResult\n\n" |
1901 |
+printf " Test\t\t\tResult\n\n" |
1902 |
if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then |
1903 |
for prog in $TESTS |
1904 |
@@ -248,8 +247,6 @@ |
1905 |
for prog in $TESTS |
1906 |
do |
1907 |
- printf "$prog" |
1908 |
- printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1 |
1909 |
- export test_rval |
1910 |
- ./$prog >> ${LOGFILE} 2>&1 & |
1911 |
+ printf %16s $prog |
1912 |
+ ./$prog >> $prog.output 2>&1 & |
1913 |
test_pid=$! |
1914 |
sleep_pid=0 |
1915 |
@@ -266,7 +263,7 @@ |
1916 |
else |
1917 |
printf "\t\t\tFAILED\n"; |
1918 |
+ sed "s,^, $prog: ," < $prog.output |
1919 |
rval=1 |
1920 |
fi; |
1921 |
- printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1 |
1922 |
done |
1923 |
fi; |
1924 |
@@ -274,19 +271,2 @@ |
1925 |
printf "END\t\t\t`date`\n" |
1926 |
exit $rval |
1927 |
- |
1928 |
- |
1929 |
- |
1930 |
- |
1931 |
- |
1932 |
- |
1933 |
- |
1934 |
- |
1935 |
- |
1936 |
- |
1937 |
- |
1938 |
- |
1939 |
- |
1940 |
- |
1941 |
- |
1942 |
- |
1943 |
- |
1944 |
--- ../pr/tests/server_test.c.orig 2009-03-18 10:49:45.000000000 +0100 |
1945 |
+++ ../pr/tests/server_test.c 2009-06-17 09:30:18.000000000 +0200 |
1946 |
@@ -92,7 +92,7 @@ |
1947 |
#ifdef DEBUGPRINTS |
1948 |
#define DPRINTF printf |
1949 |
#else |
1950 |
-#define DPRINTF |
1951 |
+#define DPRINTF(...) |
1952 |
#endif |
1953 |
|
1954 |
|
1955 |
@@ -534,6 +534,7 @@ |
1956 |
do_work(); |
1957 |
} |
1958 |
|
1959 |
+#if 0 |
1960 |
static void do_workUK(void) |
1961 |
{ |
1962 |
ServerScope = PR_LOCAL_THREAD; |
1963 |
@@ -554,6 +555,7 @@ |
1964 |
ClientScope = PR_GLOBAL_THREAD; |
1965 |
do_work(); |
1966 |
} |
1967 |
+#endif |
1968 |
|
1969 |
|
1970 |
static void Measure(void (*func)(void), const char *msg) |
1971 |
--- ../pr/tests/servr_ku.c.orig 2009-03-18 10:49:46.000000000 +0100 |
1972 |
+++ ../pr/tests/servr_ku.c 2009-06-17 09:51:45.000000000 +0200 |
1973 |
@@ -89,7 +89,7 @@ |
1974 |
#ifdef DEBUGPRINTS |
1975 |
#define DPRINTF printf |
1976 |
#else |
1977 |
-#define DPRINTF |
1978 |
+#define DPRINTF(...) |
1979 |
#endif |
1980 |
|
1981 |
PRIntn failed_already=0; |
1982 |
--- ../pr/tests/servr_uk.c.orig 2009-03-18 10:49:46.000000000 +0100 |
1983 |
+++ ../pr/tests/servr_uk.c 2009-06-17 09:53:37.000000000 +0200 |
1984 |
@@ -89,7 +89,7 @@ |
1985 |
#ifdef DEBUGPRINTS |
1986 |
#define DPRINTF printf |
1987 |
#else |
1988 |
-#define DPRINTF |
1989 |
+#define DPRINTF(...) |
1990 |
#endif |
1991 |
|
1992 |
PRIntn failed_already=0; |
1993 |
--- ../pr/tests/servr_uu.c.orig 2009-03-18 10:49:46.000000000 +0100 |
1994 |
+++ ../pr/tests/servr_uu.c 2009-06-17 09:55:30.000000000 +0200 |
1995 |
@@ -89,7 +89,7 @@ |
1996 |
#ifdef DEBUGPRINTS |
1997 |
#define DPRINTF printf |
1998 |
#else |
1999 |
-#define DPRINTF |
2000 |
+#define DPRINTF(...) |
2001 |
#endif |
2002 |
|
2003 |
PRIntn failed_already=0; |
2004 |
--- ../pr/tests/cltsrv.c 2009-05-06 01:40:38.000000000 -0400 |
2005 |
+++ ../pr/tests/cltsrv.c 2009-11-04 15:34:25.000000000 -0500 |
2006 |
@@ -920,5 +920,5 @@ |
2007 |
PRUintn index; |
2008 |
PRBool boolean; |
2009 |
- CSClient_t *client; |
2010 |
+ CSClient_t *client = NULL; |
2011 |
PRStatus rv, joinStatus; |
2012 |
CSServer_t *server = NULL; |
2013 |
--- ../pr/tests/parsetm.c 2009-05-11 18:23:19.000000000 -0400 |
2014 |
+++ ../pr/tests/parsetm.c 2009-11-04 16:27:29.000000000 -0500 |
2015 |
@@ -64,6 +64,6 @@ |
2016 |
/* Print day of the week, month, day, hour, minute, and second */ |
2017 |
if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ", |
2018 |
- dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday, |
2019 |
- et->tm_hour, et->tm_min, et->tm_sec); |
2020 |
+ dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday, |
2021 |
+ (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec); |
2022 |
|
2023 |
/* Print time zone */ |
2024 |
@@ -80,4 +80,4 @@ |
2025 |
minOffset = (totalOffset % 3600) / 60; |
2026 |
if (debug_mode) |
2027 |
- printf("%s%02ld%02ld ", sign, hourOffset, minOffset); |
2028 |
+ printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset); |
2029 |
} |
2030 |
--- ../pr/tests/provider.c 2009-05-06 01:40:39.000000000 -0400 |
2031 |
+++ ../pr/tests/provider.c 2009-11-04 16:29:30.000000000 -0500 |
2032 |
@@ -1082,5 +1082,5 @@ |
2033 |
PRUintn index; |
2034 |
PRBool boolean; |
2035 |
- CSClient_t *client; |
2036 |
+ CSClient_t *client = NULL; |
2037 |
PRStatus rv, joinStatus; |
2038 |
CSServer_t *server = NULL; |
2039 |
--- ../pr/tests/switch.c 2009-05-06 01:40:39.000000000 -0400 |
2040 |
+++ ../pr/tests/switch.c 2009-11-04 16:48:07.000000000 -0500 |
2041 |
@@ -113,5 +113,5 @@ |
2042 |
PRBool help = PR_FALSE; |
2043 |
PRUintn concurrency = 1; |
2044 |
- Shared *shared, *link; |
2045 |
+ Shared *shared = NULL, *link; |
2046 |
PRIntervalTime timein, timeout; |
2047 |
PRThreadScope thread_scope = PR_LOCAL_THREAD; |