summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlyaS <astro.courier@gmail.com>2012-08-16 17:27:15 +0800
committerDaniel Veillard <veillard@redhat.com>2012-08-16 17:27:15 +0800
commit2d6e741ed9a5e54d48d394060590d151a3417dd7 (patch)
tree1349f7878719fff6ee7214306e04d0da14a409bf
parentbda37db361159222a9ecd05237c05b839c3f2654 (diff)
downloadlibxslt-2d6e741ed9a5e54d48d394060590d151a3417dd7.tar.gz
libxslt-2d6e741ed9a5e54d48d394060590d151a3417dd7.tar.bz2
libxslt-2d6e741ed9a5e54d48d394060590d151a3417dd7.zip
Portability fix for testThreads.c
Similar to the one in libxml2, don't assume threads id are scalars
-rw-r--r--xsltproc/testThreads.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xsltproc/testThreads.c b/xsltproc/testThreads.c
index 904cda9c..05f0039c 100644
--- a/xsltproc/testThreads.c
+++ b/xsltproc/testThreads.c
@@ -198,10 +198,8 @@ main(void)
*/
printf("Pass 1\n");
for (repeat = 0;repeat < 500;repeat++) {
- for (i = 0; i < num_threads; i++) {
- results[i] = NULL;
- tid[i] = (pthread_t) -1;
- }
+ memset(results, 0, sizeof(*results)*num_threads);
+ memset(tid, 0xff, sizeof(*tid)*num_threads);
for (i = 0; i < num_threads; i++) {
ret = pthread_create(&tid[i], NULL, threadRoutine1,
@@ -240,10 +238,8 @@ main(void)
fprintf(stderr, "Main failed to compile stylesheet\n");
exit(1);
}
- for (i = 0; i < num_threads; i++) {
- results[i] = NULL;
- tid[i] = (pthread_t) -1;
- }
+ memset(results, 0, sizeof(*results)*num_threads);
+ memset(tid, 0xff, sizeof(*tid)*num_threads);
for (i = 0; i < num_threads; i++) {
ret = pthread_create(&tid[i], NULL, threadRoutine2, (void *) cur);