Skip to content

Commit df3337d

Browse files
committed
Use size_t for array index related code (scheduling)
1 parent bd1c277 commit df3337d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Scheduling.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Panel* Scheduling_newPolicyPanel(int preSelectedPolicy) {
4747
Panel_add(this, (Object*) ListItem_new(reset_on_fork ? "Reset on fork: on" : "Reset on fork: off", -1));
4848
#endif
4949

50-
for (unsigned i = 0; i < ARRAYSIZE(policies); i++) {
50+
for (size_t i = 0; i < ARRAYSIZE(policies); i++) {
5151
if (!policies[i].name)
5252
continue;
5353

@@ -72,7 +72,7 @@ void Scheduling_togglePolicyPanelResetOnFork(Panel* schedPanel) {
7272
}
7373

7474
Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority) {
75-
if (policy < 0 || (unsigned)policy >= ARRAYSIZE(policies) || policies[policy].name == NULL)
75+
if (policy < 0 || (size_t)policy >= ARRAYSIZE(policies) || policies[policy].name == NULL)
7676
return NULL;
7777

7878
if (!policies[policy].prioritySupport)
@@ -82,7 +82,7 @@ Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority) {
8282
if (min < 0)
8383
return NULL;
8484
int max = sched_get_priority_max(policy);
85-
if (max < 0 )
85+
if (max < 0)
8686
return NULL;
8787

8888
Panel* this = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Select ", "Cancel "));
@@ -104,7 +104,7 @@ static bool Scheduling_setPolicy(Process* p, Arg arg) {
104104
int policy = sarg->policy;
105105

106106
assert(policy >= 0);
107-
assert((unsigned)policy < ARRAYSIZE(policies));
107+
assert((size_t)policy < ARRAYSIZE(policies));
108108
assert(policies[policy].name);
109109

110110
const struct sched_param param = { .sched_priority = policies[policy].prioritySupport ? sarg->priority : 0 };

0 commit comments

Comments
 (0)