Module: xenomai-3
Branch: next
Commit: 249a27e5a3610297d213a80f49cd6f33648d91f2
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=249a27e5a3610297d213a80f49cd6f33648d91f2

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Apr 15 15:06:07 2017 +0200

lib, utils: prefer X/Open LONG_BIT over __WORDSIZE

---

 lib/cobalt/printf.c            |   14 +++++++-------
 lib/copperplate/heapobj-tlsf.c |    2 +-
 utils/slackspot/slackspot.c    |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c
index e52a5a5..e109dea 100644
--- a/lib/cobalt/printf.c
+++ b/lib/cobalt/printf.c
@@ -434,7 +434,7 @@ int rt_print_init(size_t buffer_size, const char 
*buffer_name)
                                                    bitmap,
                                                    bitmap & ~(1UL << j));
                } while (old_bitmap != bitmap && old_bitmap);
-               j += i * __WORDSIZE;
+               j += i * LONG_BIT;
        } while (!old_bitmap);
 
        buffer = (struct print_buffer *)(pool_start + j * pool_buf_size);
@@ -508,8 +508,8 @@ static void release_buffer(struct print_buffer *buffer)
                goto dofree;
 
        j = ((unsigned long)buffer - pool_start) / pool_buf_size;
-       i = j / __WORDSIZE;
-       j = j % __WORDSIZE;
+       i = j / LONG_BIT;
+       j = j % LONG_BIT;
 
        old_bitmap = atomic_long_read(&pool_bitmap[i]);
        do {
@@ -687,7 +687,7 @@ void cobalt_print_init(void)
        syncdelay.tv_nsec = (__cobalt_print_syncdelay % 1000) * 1000000;
 
        /* Fill the buffer pool */
-       pool_bitmap_len = (__cobalt_print_bufcount+__WORDSIZE-1)/__WORDSIZE;
+       pool_bitmap_len = (__cobalt_print_bufcount+LONG_BIT-1)/LONG_BIT;
        if (!pool_bitmap_len)
                goto done;
 
@@ -701,11 +701,11 @@ void cobalt_print_init(void)
        if (!pool_start)
                early_panic("error allocating print relay buffers");
 
-       for (i = 0; i < __cobalt_print_bufcount / __WORDSIZE; i++)
+       for (i = 0; i < __cobalt_print_bufcount / LONG_BIT; i++)
                atomic_long_set(&pool_bitmap[i], ~0UL);
-       if (__cobalt_print_bufcount % __WORDSIZE)
+       if (__cobalt_print_bufcount % LONG_BIT)
                atomic_long_set(&pool_bitmap[i],
-                               (1UL << (__cobalt_print_bufcount % __WORDSIZE)) 
- 1);
+                               (1UL << (__cobalt_print_bufcount % LONG_BIT)) - 
1);
 
        for (i = 0; i < __cobalt_print_bufcount; i++) {
                struct print_buffer *buffer =
diff --git a/lib/copperplate/heapobj-tlsf.c b/lib/copperplate/heapobj-tlsf.c
index e573380..e24db15 100644
--- a/lib/copperplate/heapobj-tlsf.c
+++ b/lib/copperplate/heapobj-tlsf.c
@@ -26,7 +26,7 @@
 #include "xenomai/init.h"
 #include "internal.h"
 
-#if __WORDSIZE == 32
+#if LONG_BIT == 32
 #define TLSF_BLOCK_ALIGN  (8 * 2)
 #else
 #define TLSF_BLOCK_ALIGN  (16 * 2)
diff --git a/utils/slackspot/slackspot.c b/utils/slackspot/slackspot.c
index 88ace13..031b97f 100644
--- a/utils/slackspot/slackspot.c
+++ b/utils/slackspot/slackspot.c
@@ -549,7 +549,7 @@ static inline void put_location(struct relax_spot *p, int 
depth)
        struct backtrace *b = p->backtrace + depth;
        const struct location *where = b->where;
 
-       printf("   #%-2d 0x%.*lx ", depth, __WORDSIZE / 4, where->pc);
+       printf("   #%-2d 0x%.*lx ", depth, LONG_BIT / 4, where->pc);
        if (where->function)
                printf("%s() ", where->function);
        if (where->file) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to