aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-09-04 11:16:55 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-09-04 11:16:55 +0100
commit8675406ceaf254f50769ec721712ccbb5716592f (patch)
tree3a6b2684768f46fca4bc10e474cd6c09b4ec0e05 /tests
parentqemu: Don't update graphic definitions on password change failure (diff)
downloadlibvirt-8675406ceaf254f50769ec721712ccbb5716592f.tar.gz
libvirt-8675406ceaf254f50769ec721712ccbb5716592f.tar.bz2
libvirt-8675406ceaf254f50769ec721712ccbb5716592f.zip
Fix mingw64 build by using intptr_t for int->void* casts
The viratomictest.c was casting from an int to a void* via a long. This works on Linux or Mingw32, but fails on Mingw64 due to a pointer/integer size mis-match. Replacing 'long' with 'intptr_t' ensures matching type sizes
Diffstat (limited to 'tests')
-rw-r--r--tests/viratomictest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/viratomictest.c b/tests/viratomictest.c
index 425032991..4b367026d 100644
--- a/tests/viratomictest.c
+++ b/tests/viratomictest.c
@@ -114,7 +114,7 @@ volatile int atomic;
static void
thread_func(void *data)
{
- int idx = (int)(long)data;
+ int idx = (intptr_t)data;
int i;
int d;
@@ -142,7 +142,7 @@ testThreads(const void *data ATTRIBUTE_UNUSED)
bucket[i] = 0;
for (i = 0; i < THREADS; i++) {
- if (virThreadCreate(&(threads[i]), true, thread_func, (void*)(long)i) < 0)
+ if (virThreadCreate(&(threads[i]), true, thread_func, (void*)(intptr_t)i) < 0)
return -1;
}