kernel: Fix bitwise operators with unsigned operators

Bitwise operators should be used only with unsigned integer operands
because the result os bitwise operations on signed integers are
implementation-defined.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-08-15 11:52:00 -07:00 committed by Anas Nashif
commit 8aec087268
6 changed files with 29 additions and 12 deletions

View file

@ -13,6 +13,7 @@
#include <atomic.h>
#include <misc/dlist.h>
#include <misc/rb.h>
#include <misc/util.h>
#include <string.h>
#endif
@ -31,22 +32,22 @@
/* states: common uses low bits, arch-specific use high bits */
/* Not a real thread */
#define _THREAD_DUMMY (1 << 0)
#define _THREAD_DUMMY (BIT(0))
/* Thread is waiting on an object */
#define _THREAD_PENDING (1 << 1)
#define _THREAD_PENDING (BIT(1))
/* Thread has not yet started */
#define _THREAD_PRESTART (1 << 2)
#define _THREAD_PRESTART (BIT(2))
/* Thread has terminated */
#define _THREAD_DEAD (1 << 3)
#define _THREAD_DEAD (BIT(3))
/* Thread is suspended */
#define _THREAD_SUSPENDED (1 << 4)
#define _THREAD_SUSPENDED (BIT(4))
/* Thread is present in the ready queue */
#define _THREAD_QUEUED (1 << 6)
#define _THREAD_QUEUED (BIT(6))
/* end - states */