Fix "cast from pointer to integer of different size" warning on OpenBSD
authorTomohiro Kusumi <tkusumi@tuxera.com>
Sun, 30 Apr 2017 17:35:06 +0000 (20:35 +0300)
committerJens Axboe <axboe@fb.com>
Sun, 30 Apr 2017 22:51:21 +0000 (16:51 -0600)
commit227d026f88a4264ef717230990c82910ee3619fc
tree0c37d6fcfa334c67cf7336f31dbb6044714c1e48
parent2ef124c6e619a7e53954ccaa3c800a6196386f25
Fix "cast from pointer to integer of different size" warning on OpenBSD

OpenBSD has below compiler warning due to pthread_t being typedef'd
to struct pthread*.

 os/os-openbsd.h: In function 'gettid':
 os/os-openbsd.h:71: warning: cast from pointer to integer of different size

--
 # uname
 OpenBSD
 # grep pthread_t /usr/include -rI | grep typedef | head -1
 /usr/include/pthread.h:typedef struct   pthread                 *pthread_t;
 # cat ./p1.c
 #include <stdio.h>
 #include <pthread.h>
 int main(void) {
         pthread_t id = 1234;
         printf("%d\n", (int)id);
         return 0;
 }
 # gcc -Wall -g ./p1.c
 ./p1.c: In function 'main':
 ./p1.c:4: warning: initialization makes pointer from integer without a cast
 ./p1.c:5: warning: cast from pointer to integer of different size
 # ./a.out
 1234

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
os/os-openbsd.h