smptests: Address -Wsign-compare warnings

Most of these warnings were between int or ssize_t and size_t.
In particular, various POSIX system calls like read() and write()
return ssize_t and comparing that value with the sizeof a buffer
is a common source of these warnings. Another common source is
using an int as the iterator in a for loop with the limit being
a size_t.

With the type change, some printf() specifiers needed to change also.
This commit is contained in:
Joel Sherrill
2026-01-22 17:10:15 -06:00
parent 3a5a39c765
commit a5d3e5e8ef
7 changed files with 10 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ rtems_task Init(
{
(void) argument;
int i;
uint32_t i;
char ch;
uint32_t cpu_num;
rtems_id id;

View File

@@ -119,7 +119,7 @@ void Validate_affinity(void )
cpu_set_t cpuset0;
cpu_set_t cpuset1;
cpu_set_t cpuset2;
uint32_t i;
int i;
int sc;
int cpu_count;
rtems_task_priority priority;
@@ -231,7 +231,7 @@ static void Init(rtems_task_argument arg)
{
(void) arg;
int sc;
rtems_status_code sc;
TEST_BEGIN();

View File

@@ -78,7 +78,7 @@ rtems_id task_sem;
* Spin loop to allow tasks to delay without yeilding the
* processor.
*/
static void test_delay(int ticks)
static void test_delay(rtems_interval ticks)
{
rtems_interval start, stop;
start = rtems_clock_get_ticks_since_boot();

View File

@@ -123,7 +123,7 @@ void Validate_affinity(void )
cpu_set_t cpuset0;
cpu_set_t cpuset1;
cpu_set_t cpuset2;
uint32_t i;
int i;
int sc;
int cpu_count;
struct sched_param param;

View File

@@ -43,7 +43,7 @@ const char rtems_test_name[] = "SMPSCHEDAFFINITY 3";
#define NUM_CPUS 4
#define TASK_COUNT NUM_CPUS
static void test_delay(int ticks)
static void test_delay(rtems_interval ticks)
{
rtems_interval start, stop;
start = rtems_clock_get_ticks_since_boot();

View File

@@ -58,7 +58,7 @@ rtems_id task_sem;
static void task(rtems_task_argument arg);
static void test_delay(int ticks)
static void test_delay(rtems_interval ticks)
{
rtems_interval start, stop;
start = rtems_clock_get_ticks_since_boot();
@@ -91,8 +91,8 @@ static void test(void)
{
rtems_status_code sc;
uint32_t cpu_count;
int cpu;
int i;
uint32_t cpu;
uint32_t i;
cpu_set_t cpuset;
/* Get the number of processors that we are using. */

View File

@@ -79,7 +79,7 @@ static void verify_tasks(void);
* Spin loop to allow tasks to delay without yeilding the
* processor.
*/
static void test_delay(int ticks)
static void test_delay(rtems_interval ticks)
{
rtems_interval start, stop;
start = rtems_clock_get_ticks_since_boot();