Skip to content

Commit 597b872

Browse files
committed
chore: fix fullbuild bugs
1 parent b21ccb3 commit 597b872

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libc/src/sched/linux/sched_setcpuset.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
#include "src/__support/common.h" // LLVM_LIBC_FUNCTION
1212
#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
1313

14+
#include "hdr/sched_macros.h" // NCPUBITS
1415
#include "hdr/types/cpu_set_t.h"
1516
#include "hdr/types/size_t.h"
1617

1718
namespace LIBC_NAMESPACE_DECL {
1819

1920
LLVM_LIBC_FUNCTION(void, __sched_setcpuset,
2021
(int cpu, const size_t cpuset_size, cpu_set_t *set)) {
21-
if (cpu / 8 < cpuset_size) {
22-
const size_t element_index = cpu / NCPUBITS;
23-
const size_t bit_position = cpu % NCPUBITS;
22+
if (static_cast<size_t>(cpu) / 8 < cpuset_size) {
23+
const size_t element_index = static_cast<size_t>(cpu) / NCPUBITS;
24+
const size_t bit_position = static_cast<size_t>(cpu) % NCPUBITS;
2425

2526
const unsigned long mask = 1UL << bit_position;
2627
set->__bits[element_index] |= mask;

0 commit comments

Comments
 (0)