diff --git a/include/spawn.h b/include/spawn.h index 64f35c83838..2e5a759d4c9 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -48,13 +48,13 @@ * posix_spawnattr_t object using the posix_spawnattr_setflags() function:" */ -#define POSIX_SPAWN_RESETIDS (1 << 0) /* 1: Reset effective user ID */ -#define POSIX_SPAWN_SETPGROUP (1 << 1) /* 1: Set process group */ -#define POSIX_SPAWN_SETSCHEDPARAM (1 << 2) /* 1: Set task's priority */ -#define POSIX_SPAWN_SETSCHEDULER (1 << 3) /* 1: Set task's scheduler policy */ -#define POSIX_SPAWN_SETSIGDEF (1 << 4) /* 1: Set default signal actions */ -#define POSIX_SPAWN_SETSIGMASK (1 << 5) /* 1: Set sigmask */ -#define POSIX_SPAWN_SETSID (1 << 7) /* 1: Create the new session(glibc specific) */ +#define POSIX_SPAWN_RESETIDS (1u << 0) /* 1: Reset effective user ID */ +#define POSIX_SPAWN_SETPGROUP (1u << 1) /* 1: Set process group */ +#define POSIX_SPAWN_SETSCHEDPARAM (1u << 2) /* 1: Set task's priority */ +#define POSIX_SPAWN_SETSCHEDULER (1u << 3) /* 1: Set task's scheduler policy */ +#define POSIX_SPAWN_SETSIGDEF (1u << 4) /* 1: Set default signal actions */ +#define POSIX_SPAWN_SETSIGMASK (1u << 5) /* 1: Set sigmask */ +#define POSIX_SPAWN_SETSID (1u << 7) /* 1: Create the new session(glibc specific) */ /* NOTE: NuttX provides only one implementation: If * CONFIG_LIBC_ENVPATH is defined, then only posix_spawnp() behavior diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index cc0cb5a2154..156c26343ec 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -158,7 +158,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) /* Firstly, set the signal mask if requested to do so */ #ifndef CONFIG_DISABLE_ALL_SIGNALS - if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0) + if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0u) { FAR struct tcb_s *tcb = nxsched_get_tcb(pid); if (tcb) @@ -172,7 +172,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * to set the priority of the of the new task. */ - if ((attr->flags & POSIX_SPAWN_SETSCHEDPARAM) != 0) + if ((attr->flags & POSIX_SPAWN_SETSCHEDPARAM) != 0u) { #ifdef CONFIG_SCHED_SPORADIC /* Get the current sporadic scheduling parameters. Those will not be @@ -192,7 +192,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * then we will call nxsched_set_scheduler() below. */ - if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) == 0) + if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) == 0u) { sinfo("Setting priority=%d for pid=%d\n", param.sched_priority, pid); @@ -207,7 +207,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * preparation for the nxsched_set_scheduler() call below. */ - else if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0) + else if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0u) { ret = nxsched_get_param(0, ¶m); } @@ -216,7 +216,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * setting determined above. */ - if (ret == OK && (attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0) + if (ret == OK && (attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0u) { sinfo("Setting policy=%d priority=%d for pid=%d\n", attr->policy, param.sched_priority, pid);