]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: avoid compiler warning on cygwin
authorEric Blake <eblake@redhat.com>
Wed, 6 Apr 2011 23:02:53 +0000 (17:02 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 6 Apr 2011 23:07:23 +0000 (17:07 -0600)
In file included from util/threads.c:31:
util/threads-pthread.c: In function 'virThreadSelfID':
util/threads-pthread.c:214: warning: cast from function call of type 'pthread_t' to non-matching type 'int' [-Wbad-function-cast]

* src/util/threads-pthread.c (virThreadSelfID) [!SYS_gettid]:
Add intermediate cast to silence gcc.

src/util/threads-pthread.c

index f812045a746bb72ee20a0512e80f9484c960ca49..898c4d48b08e20062572248f8f0139771060f508 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * threads-pthread.c: basic thread synchronization primitives
  *
- * Copyright (C) 2009-2010 Red Hat, Inc.
+ * Copyright (C) 2009-2011 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -211,7 +211,7 @@ int virThreadSelfID(void)
     tid = syscall(SYS_gettid);
     return (int)tid;
 #else
-    return (int)pthread_self();
+    return (int)(void *)pthread_self();
 #endif
 }