thread: use unsigned (long) instead of size_t in tls_align test
authornsz <nsz@port70.net>
Mon, 8 Oct 2012 08:16:29 +0000 (10:16 +0200)
committernsz <nsz@port70.net>
Mon, 8 Oct 2012 08:16:29 +0000 (10:16 +0200)
src/thread/tls_align.c
src/thread/tls_align_dlopen.c
src/thread/tls_align_dso.c

index 7607833..505abf2 100644 (file)
@@ -1,11 +1,10 @@
-#include <stddef.h>
 #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;
 }
index 33c8ae6..64517e1 100644 (file)
@@ -1,4 +1,3 @@
-#include <stddef.h>
 #include <dlfcn.h>
 #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;
 }
index c78e929..9ca759e 100644 (file)
@@ -1,5 +1,3 @@
-#include <stddef.h>
-
 __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)
 {