diff --git a/src/thread/tls_align.c b/src/thread/tls_align.c index 7607833..505abf2 100644 --- a/src/thread/tls_align.c +++ b/src/thread/tls_align.c @@ -1,11 +1,10 @@ -#include #include "test.h" extern struct { char *name; - size_t size; - size_t align; - size_t addr; + unsigned size; + unsigned align; + unsigned long addr; } t[4]; int main() @@ -17,7 +16,7 @@ int main() error("name is not set for t[%d]\n", i); if (t[i].addr & (t[i].align-1)) error("bad alignment: %s, size: %u, align: %u, addr: 0x%lx\n", - t[i].name, (unsigned)t[i].size, (unsigned)t[i].align, (unsigned long)t[i].addr); + t[i].name, t[i].size, t[i].align, t[i].addr); } return test_status; } diff --git a/src/thread/tls_align_dlopen.c b/src/thread/tls_align_dlopen.c index 33c8ae6..64517e1 100644 --- a/src/thread/tls_align_dlopen.c +++ b/src/thread/tls_align_dlopen.c @@ -1,4 +1,3 @@ -#include #include #include "test.h" @@ -8,9 +7,9 @@ int main() void *h; struct { char *name; - size_t size; - size_t align; - size_t addr; + unsigned size; + unsigned align; + unsigned long addr; } *t; h = dlopen("./tls_align_dso.so", RTLD_LAZY); @@ -24,8 +23,8 @@ int main() if (!t[i].name) error("name is not set for t[%d]\n", i); if (t[i].addr & (t[i].align-1)) - error("bad alignment: %s, size: %lu, align: %lu, addr: 0x%lx\n", - t[i].name, (unsigned long)t[i].size, (unsigned long)t[i].align, (unsigned long)t[i].addr); + error("bad alignment: %s, size: %u, align: %u, addr: 0x%lx\n", + t[i].name, t[i].size, t[i].align, t[i].addr); } return test_status; } diff --git a/src/thread/tls_align_dso.c b/src/thread/tls_align_dso.c index c78e929..9ca759e 100644 --- a/src/thread/tls_align_dso.c +++ b/src/thread/tls_align_dso.c @@ -1,5 +1,3 @@ -#include - __thread char c1 = 1; __thread char xchar = 2; __thread char c2 = 3; @@ -11,16 +9,16 @@ __thread long long xllong = 8; struct { char *name; - size_t size; - size_t align; - size_t addr; + unsigned size; + unsigned align; + unsigned long addr; } t[4]; #define entry(i,x) \ t[i].name = #x; \ t[i].size = sizeof x; \ t[i].align = __alignof__(x); \ - t[i].addr = (size_t)&x; + t[i].addr = (unsigned long)&x; __attribute__((constructor)) static void init(void) {